iclient-mapboxgl.js 4.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542695436954469545695466954769548695496955069551695526955369554695556955669557695586955969560695616956269563695646956569566695676956869569695706957169572695736957469575695766957769578695796958069581695826958369584695856958669587695886958969590695916959269593695946959569596695976959869599696006960169602696036960469605696066960769608696096961069611696126961369614696156961669617696186961969620696216962269623696246962569626696276962869629696306963169632696336963469635696366963769638696396964069641696426964369644696456964669647696486964969650696516965269653696546965569656696576965869659696606966169662696636966469665696666966769668696696967069671696726967369674696756967669677696786967969680696816968269683696846968569686696876968869689696906969169692696936969469695696966969769698696996970069701697026970369704697056970669707697086970969710697116971269713697146971569716697176971869719697206972169722697236972469725697266972769728697296973069731697326973369734697356973669737697386973969740697416974269743697446974569746697476974869749697506975169752697536975469755697566975769758697596976069761697626976369764697656976669767697686976969770697716977269773697746977569776697776977869779697806978169782697836978469785697866978769788697896979069791697926979369794697956979669797697986979969800698016980269803698046980569806698076980869809698106981169812698136981469815698166981769818698196982069821698226982369824698256982669827698286982969830698316983269833698346983569836698376983869839698406984169842698436984469845698466984769848698496985069851698526985369854698556985669857698586985969860698616986269863698646986569866698676986869869698706987169872698736987469875698766987769878698796988069881698826988369884698856988669887698886988969890698916989269893698946989569896698976989869899699006990169902699036990469905699066990769908699096991069911699126991369914699156991669917699186991969920699216992269923699246992569926699276992869929699306993169932699336993469935699366993769938699396994069941699426994369944699456994669947699486994969950699516995269953699546995569956699576995869959699606996169962699636996469965699666996769968699696997069971699726997369974699756997669977699786997969980699816998269983699846998569986699876998869989699906999169992699936999469995699966999769998699997000070001700027000370004700057000670007700087000970010700117001270013700147001570016700177001870019700207002170022700237002470025700267002770028700297003070031700327003370034700357003670037700387003970040700417004270043700447004570046700477004870049700507005170052700537005470055700567005770058700597006070061700627006370064700657006670067700687006970070700717007270073700747007570076700777007870079700807008170082700837008470085700867008770088700897009070091700927009370094700957009670097700987009970100701017010270103701047010570106701077010870109701107011170112701137011470115701167011770118701197012070121701227012370124701257012670127701287012970130701317013270133701347013570136701377013870139701407014170142701437014470145701467014770148701497015070151701527015370154701557015670157701587015970160701617016270163701647016570166701677016870169701707017170172701737017470175701767017770178701797018070181701827018370184701857018670187701887018970190701917019270193701947019570196701977019870199702007020170202702037020470205702067020770208702097021070211702127021370214702157021670217702187021970220702217022270223702247022570226702277022870229702307023170232702337023470235702367023770238702397024070241702427024370244702457024670247702487024970250702517025270253702547025570256702577025870259702607026170262702637026470265702667026770268702697027070271702727027370274702757027670277702787027970280702817028270283702847028570286702877028870289702907029170292702937029470295702967029770298702997030070301703027030370304703057030670307703087030970310703117031270313703147031570316703177031870319703207032170322703237032470325703267032770328703297033070331703327033370334703357033670337703387033970340703417034270343703447034570346703477034870349703507035170352703537035470355703567035770358703597036070361703627036370364703657036670367703687036970370703717037270373703747037570376703777037870379703807038170382703837038470385703867038770388703897039070391703927039370394703957039670397703987039970400704017040270403704047040570406704077040870409704107041170412704137041470415704167041770418704197042070421704227042370424704257042670427704287042970430704317043270433704347043570436704377043870439704407044170442704437044470445704467044770448704497045070451704527045370454704557045670457704587045970460704617046270463704647046570466704677046870469704707047170472704737047470475704767047770478704797048070481704827048370484704857048670487704887048970490704917049270493704947049570496704977049870499705007050170502705037050470505705067050770508705097051070511705127051370514705157051670517705187051970520705217052270523705247052570526705277052870529705307053170532705337053470535705367053770538705397054070541705427054370544705457054670547705487054970550705517055270553705547055570556705577055870559705607056170562705637056470565705667056770568705697057070571705727057370574705757057670577705787057970580705817058270583705847058570586705877058870589705907059170592705937059470595705967059770598705997060070601706027060370604706057060670607706087060970610706117061270613706147061570616706177061870619706207062170622706237062470625706267062770628706297063070631706327063370634706357063670637706387063970640706417064270643706447064570646706477064870649706507065170652706537065470655706567065770658706597066070661706627066370664706657066670667706687066970670706717067270673706747067570676706777067870679706807068170682706837068470685706867068770688706897069070691706927069370694706957069670697706987069970700707017070270703707047070570706707077070870709707107071170712707137071470715707167071770718707197072070721707227072370724707257072670727707287072970730707317073270733707347073570736707377073870739707407074170742707437074470745707467074770748707497075070751707527075370754707557075670757707587075970760707617076270763707647076570766707677076870769707707077170772707737077470775707767077770778707797078070781707827078370784707857078670787707887078970790707917079270793707947079570796707977079870799708007080170802708037080470805708067080770808708097081070811708127081370814708157081670817708187081970820708217082270823708247082570826708277082870829708307083170832708337083470835708367083770838708397084070841708427084370844708457084670847708487084970850708517085270853708547085570856708577085870859708607086170862708637086470865708667086770868708697087070871708727087370874708757087670877708787087970880708817088270883708847088570886708877088870889708907089170892708937089470895708967089770898708997090070901709027090370904709057090670907709087090970910709117091270913709147091570916709177091870919709207092170922709237092470925709267092770928709297093070931709327093370934709357093670937709387093970940709417094270943709447094570946709477094870949709507095170952709537095470955709567095770958709597096070961709627096370964709657096670967709687096970970709717097270973709747097570976709777097870979709807098170982709837098470985709867098770988709897099070991709927099370994709957099670997709987099971000710017100271003710047100571006710077100871009710107101171012710137101471015710167101771018710197102071021710227102371024710257102671027710287102971030710317103271033710347103571036710377103871039710407104171042710437104471045710467104771048710497105071051710527105371054710557105671057710587105971060710617106271063710647106571066710677106871069710707107171072710737107471075710767107771078710797108071081710827108371084710857108671087710887108971090710917109271093710947109571096710977109871099711007110171102711037110471105711067110771108711097111071111711127111371114711157111671117711187111971120711217112271123711247112571126711277112871129711307113171132711337113471135711367113771138711397114071141711427114371144711457114671147711487114971150711517115271153711547115571156711577115871159711607116171162711637116471165711667116771168711697117071171711727117371174711757117671177711787117971180711817118271183711847118571186711877118871189711907119171192711937119471195711967119771198711997120071201712027120371204712057120671207712087120971210712117121271213712147121571216712177121871219712207122171222712237122471225712267122771228712297123071231712327123371234712357123671237712387123971240712417124271243712447124571246712477124871249712507125171252712537125471255712567125771258712597126071261712627126371264712657126671267712687126971270712717127271273712747127571276712777127871279712807128171282712837128471285712867128771288712897129071291712927129371294712957129671297712987129971300713017130271303713047130571306713077130871309713107131171312713137131471315713167131771318713197132071321713227132371324713257132671327713287132971330713317133271333713347133571336713377133871339713407134171342713437134471345713467134771348713497135071351713527135371354713557135671357713587135971360713617136271363713647136571366713677136871369713707137171372713737137471375713767137771378713797138071381713827138371384713857138671387713887138971390713917139271393713947139571396713977139871399714007140171402714037140471405714067140771408714097141071411714127141371414714157141671417714187141971420714217142271423714247142571426714277142871429714307143171432714337143471435714367143771438714397144071441714427144371444714457144671447714487144971450714517145271453714547145571456714577145871459714607146171462714637146471465714667146771468714697147071471714727147371474714757147671477714787147971480714817148271483714847148571486714877148871489714907149171492714937149471495714967149771498714997150071501715027150371504715057150671507715087150971510715117151271513715147151571516715177151871519715207152171522715237152471525715267152771528715297153071531715327153371534715357153671537715387153971540715417154271543715447154571546715477154871549715507155171552715537155471555715567155771558715597156071561715627156371564715657156671567715687156971570715717157271573715747157571576715777157871579715807158171582715837158471585715867158771588715897159071591715927159371594715957159671597715987159971600716017160271603716047160571606716077160871609716107161171612716137161471615716167161771618716197162071621716227162371624716257162671627716287162971630716317163271633716347163571636716377163871639716407164171642716437164471645716467164771648716497165071651716527165371654716557165671657716587165971660716617166271663716647166571666716677166871669716707167171672716737167471675716767167771678716797168071681716827168371684716857168671687716887168971690716917169271693716947169571696716977169871699717007170171702717037170471705717067170771708717097171071711717127171371714717157171671717717187171971720717217172271723717247172571726717277172871729717307173171732717337173471735717367173771738717397174071741717427174371744717457174671747717487174971750717517175271753717547175571756717577175871759717607176171762717637176471765717667176771768717697177071771717727177371774717757177671777717787177971780717817178271783717847178571786717877178871789717907179171792717937179471795717967179771798717997180071801718027180371804718057180671807718087180971810718117181271813718147181571816718177181871819718207182171822718237182471825718267182771828718297183071831718327183371834718357183671837718387183971840718417184271843718447184571846718477184871849718507185171852718537185471855718567185771858718597186071861718627186371864718657186671867718687186971870718717187271873718747187571876718777187871879718807188171882718837188471885718867188771888718897189071891718927189371894718957189671897718987189971900719017190271903719047190571906719077190871909719107191171912719137191471915719167191771918719197192071921719227192371924719257192671927719287192971930719317193271933719347193571936719377193871939719407194171942719437194471945719467194771948719497195071951719527195371954719557195671957719587195971960719617196271963719647196571966719677196871969719707197171972719737197471975719767197771978719797198071981719827198371984719857198671987719887198971990719917199271993719947199571996719977199871999720007200172002720037200472005720067200772008720097201072011720127201372014720157201672017720187201972020720217202272023720247202572026720277202872029720307203172032720337203472035720367203772038720397204072041720427204372044720457204672047720487204972050720517205272053720547205572056720577205872059720607206172062720637206472065720667206772068720697207072071720727207372074720757207672077720787207972080720817208272083720847208572086720877208872089720907209172092720937209472095720967209772098720997210072101721027210372104721057210672107721087210972110721117211272113721147211572116721177211872119721207212172122721237212472125721267212772128721297213072131721327213372134721357213672137721387213972140721417214272143721447214572146721477214872149721507215172152721537215472155721567215772158721597216072161721627216372164721657216672167721687216972170721717217272173721747217572176721777217872179721807218172182721837218472185721867218772188721897219072191721927219372194721957219672197721987219972200722017220272203722047220572206722077220872209722107221172212722137221472215722167221772218722197222072221722227222372224722257222672227722287222972230722317223272233722347223572236722377223872239722407224172242722437224472245722467224772248722497225072251722527225372254722557225672257722587225972260722617226272263722647226572266722677226872269722707227172272722737227472275722767227772278722797228072281722827228372284722857228672287722887228972290722917229272293722947229572296722977229872299723007230172302723037230472305723067230772308723097231072311723127231372314723157231672317723187231972320723217232272323723247232572326723277232872329723307233172332723337233472335723367233772338723397234072341723427234372344723457234672347723487234972350723517235272353723547235572356723577235872359723607236172362723637236472365723667236772368723697237072371723727237372374723757237672377723787237972380723817238272383723847238572386723877238872389723907239172392723937239472395723967239772398723997240072401724027240372404724057240672407724087240972410724117241272413724147241572416724177241872419724207242172422724237242472425724267242772428724297243072431724327243372434724357243672437724387243972440724417244272443724447244572446724477244872449724507245172452724537245472455724567245772458724597246072461724627246372464724657246672467724687246972470724717247272473724747247572476724777247872479724807248172482724837248472485724867248772488724897249072491724927249372494724957249672497724987249972500725017250272503725047250572506725077250872509725107251172512725137251472515725167251772518725197252072521725227252372524725257252672527725287252972530725317253272533725347253572536725377253872539725407254172542725437254472545725467254772548725497255072551725527255372554725557255672557725587255972560725617256272563725647256572566725677256872569725707257172572725737257472575725767257772578725797258072581725827258372584725857258672587725887258972590725917259272593725947259572596725977259872599726007260172602726037260472605726067260772608726097261072611726127261372614726157261672617726187261972620726217262272623726247262572626726277262872629726307263172632726337263472635726367263772638726397264072641726427264372644726457264672647726487264972650726517265272653726547265572656726577265872659726607266172662726637266472665726667266772668726697267072671726727267372674726757267672677726787267972680726817268272683726847268572686726877268872689726907269172692726937269472695726967269772698726997270072701727027270372704727057270672707727087270972710727117271272713727147271572716727177271872719727207272172722727237272472725727267272772728727297273072731727327273372734727357273672737727387273972740727417274272743727447274572746727477274872749727507275172752727537275472755727567275772758727597276072761727627276372764727657276672767727687276972770727717277272773727747277572776727777277872779727807278172782727837278472785727867278772788727897279072791727927279372794727957279672797727987279972800728017280272803728047280572806728077280872809728107281172812728137281472815728167281772818728197282072821728227282372824728257282672827728287282972830728317283272833728347283572836728377283872839728407284172842728437284472845728467284772848728497285072851728527285372854728557285672857728587285972860728617286272863728647286572866728677286872869728707287172872728737287472875728767287772878728797288072881728827288372884728857288672887728887288972890728917289272893728947289572896728977289872899729007290172902729037290472905729067290772908729097291072911729127291372914729157291672917729187291972920729217292272923729247292572926729277292872929729307293172932729337293472935729367293772938729397294072941729427294372944729457294672947729487294972950729517295272953729547295572956729577295872959729607296172962729637296472965729667296772968729697297072971729727297372974729757297672977729787297972980729817298272983729847298572986729877298872989729907299172992729937299472995729967299772998729997300073001730027300373004730057300673007730087300973010730117301273013730147301573016730177301873019730207302173022730237302473025730267302773028730297303073031730327303373034730357303673037730387303973040730417304273043730447304573046730477304873049730507305173052730537305473055730567305773058730597306073061730627306373064730657306673067730687306973070730717307273073730747307573076730777307873079730807308173082730837308473085730867308773088730897309073091730927309373094730957309673097730987309973100731017310273103731047310573106731077310873109731107311173112731137311473115731167311773118731197312073121731227312373124731257312673127731287312973130731317313273133731347313573136731377313873139731407314173142731437314473145731467314773148731497315073151731527315373154731557315673157731587315973160731617316273163731647316573166731677316873169731707317173172731737317473175731767317773178731797318073181731827318373184731857318673187731887318973190731917319273193731947319573196731977319873199732007320173202732037320473205732067320773208732097321073211732127321373214732157321673217732187321973220732217322273223732247322573226732277322873229732307323173232732337323473235732367323773238732397324073241732427324373244732457324673247732487324973250732517325273253732547325573256732577325873259732607326173262732637326473265732667326773268732697327073271732727327373274732757327673277732787327973280732817328273283732847328573286732877328873289732907329173292732937329473295732967329773298732997330073301733027330373304733057330673307733087330973310733117331273313733147331573316733177331873319733207332173322733237332473325733267332773328733297333073331733327333373334733357333673337733387333973340733417334273343733447334573346733477334873349733507335173352733537335473355733567335773358733597336073361733627336373364733657336673367733687336973370733717337273373733747337573376733777337873379733807338173382733837338473385733867338773388733897339073391733927339373394733957339673397733987339973400734017340273403734047340573406734077340873409734107341173412734137341473415734167341773418734197342073421734227342373424734257342673427734287342973430734317343273433734347343573436734377343873439734407344173442734437344473445734467344773448734497345073451734527345373454734557345673457734587345973460734617346273463734647346573466734677346873469734707347173472734737347473475734767347773478734797348073481734827348373484734857348673487734887348973490734917349273493734947349573496734977349873499735007350173502735037350473505735067350773508735097351073511735127351373514735157351673517735187351973520735217352273523735247352573526735277352873529735307353173532735337353473535735367353773538735397354073541735427354373544735457354673547735487354973550735517355273553735547355573556735577355873559735607356173562735637356473565735667356773568735697357073571735727357373574735757357673577735787357973580735817358273583735847358573586735877358873589735907359173592735937359473595735967359773598735997360073601736027360373604736057360673607736087360973610736117361273613736147361573616736177361873619736207362173622736237362473625736267362773628736297363073631736327363373634736357363673637736387363973640736417364273643736447364573646736477364873649736507365173652736537365473655736567365773658736597366073661736627366373664736657366673667736687366973670736717367273673736747367573676736777367873679736807368173682736837368473685736867368773688736897369073691736927369373694736957369673697736987369973700737017370273703737047370573706737077370873709737107371173712737137371473715737167371773718737197372073721737227372373724737257372673727737287372973730737317373273733737347373573736737377373873739737407374173742737437374473745737467374773748737497375073751737527375373754737557375673757737587375973760737617376273763737647376573766737677376873769737707377173772737737377473775737767377773778737797378073781737827378373784737857378673787737887378973790737917379273793737947379573796737977379873799738007380173802738037380473805738067380773808738097381073811738127381373814738157381673817738187381973820738217382273823738247382573826738277382873829738307383173832738337383473835738367383773838738397384073841738427384373844738457384673847738487384973850738517385273853738547385573856738577385873859738607386173862738637386473865738667386773868738697387073871738727387373874738757387673877738787387973880738817388273883738847388573886738877388873889738907389173892738937389473895738967389773898738997390073901739027390373904739057390673907739087390973910739117391273913739147391573916739177391873919739207392173922739237392473925739267392773928739297393073931739327393373934739357393673937739387393973940739417394273943739447394573946739477394873949739507395173952739537395473955739567395773958739597396073961739627396373964739657396673967739687396973970739717397273973739747397573976739777397873979739807398173982739837398473985739867398773988739897399073991739927399373994739957399673997739987399974000740017400274003740047400574006740077400874009740107401174012740137401474015740167401774018740197402074021740227402374024740257402674027740287402974030740317403274033740347403574036740377403874039740407404174042740437404474045740467404774048740497405074051740527405374054740557405674057740587405974060740617406274063740647406574066740677406874069740707407174072740737407474075740767407774078740797408074081740827408374084740857408674087740887408974090740917409274093740947409574096740977409874099741007410174102741037410474105741067410774108741097411074111741127411374114741157411674117741187411974120741217412274123741247412574126741277412874129741307413174132741337413474135741367413774138741397414074141741427414374144741457414674147741487414974150741517415274153741547415574156741577415874159741607416174162741637416474165741667416774168741697417074171741727417374174741757417674177741787417974180741817418274183741847418574186741877418874189741907419174192741937419474195741967419774198741997420074201742027420374204742057420674207742087420974210742117421274213742147421574216742177421874219742207422174222742237422474225742267422774228742297423074231742327423374234742357423674237742387423974240742417424274243742447424574246742477424874249742507425174252742537425474255742567425774258742597426074261742627426374264742657426674267742687426974270742717427274273742747427574276742777427874279742807428174282742837428474285742867428774288742897429074291742927429374294742957429674297742987429974300743017430274303743047430574306743077430874309743107431174312743137431474315743167431774318743197432074321743227432374324743257432674327743287432974330743317433274333743347433574336743377433874339743407434174342743437434474345743467434774348743497435074351743527435374354743557435674357743587435974360743617436274363743647436574366743677436874369743707437174372743737437474375743767437774378743797438074381743827438374384743857438674387743887438974390743917439274393743947439574396743977439874399744007440174402744037440474405744067440774408744097441074411744127441374414744157441674417744187441974420744217442274423744247442574426744277442874429744307443174432744337443474435744367443774438744397444074441744427444374444744457444674447744487444974450744517445274453744547445574456744577445874459744607446174462744637446474465744667446774468744697447074471744727447374474744757447674477744787447974480744817448274483744847448574486744877448874489744907449174492744937449474495744967449774498744997450074501745027450374504745057450674507745087450974510745117451274513745147451574516745177451874519745207452174522745237452474525745267452774528745297453074531745327453374534745357453674537745387453974540745417454274543745447454574546745477454874549745507455174552745537455474555745567455774558745597456074561745627456374564745657456674567745687456974570745717457274573745747457574576745777457874579745807458174582745837458474585745867458774588745897459074591745927459374594745957459674597745987459974600746017460274603746047460574606746077460874609746107461174612746137461474615746167461774618746197462074621746227462374624746257462674627746287462974630746317463274633746347463574636746377463874639746407464174642746437464474645746467464774648746497465074651746527465374654746557465674657746587465974660746617466274663746647466574666746677466874669746707467174672746737467474675746767467774678746797468074681746827468374684746857468674687746887468974690746917469274693746947469574696746977469874699747007470174702747037470474705747067470774708747097471074711747127471374714747157471674717747187471974720747217472274723747247472574726747277472874729747307473174732747337473474735747367473774738747397474074741747427474374744747457474674747747487474974750747517475274753747547475574756747577475874759747607476174762747637476474765747667476774768747697477074771747727477374774747757477674777747787477974780747817478274783747847478574786747877478874789747907479174792747937479474795747967479774798747997480074801748027480374804748057480674807748087480974810748117481274813748147481574816748177481874819748207482174822748237482474825748267482774828748297483074831748327483374834748357483674837748387483974840748417484274843748447484574846748477484874849748507485174852748537485474855748567485774858748597486074861748627486374864748657486674867748687486974870748717487274873748747487574876748777487874879748807488174882748837488474885748867488774888748897489074891748927489374894748957489674897748987489974900749017490274903749047490574906749077490874909749107491174912749137491474915749167491774918749197492074921749227492374924749257492674927749287492974930749317493274933749347493574936749377493874939749407494174942749437494474945749467494774948749497495074951749527495374954749557495674957749587495974960749617496274963749647496574966749677496874969749707497174972749737497474975749767497774978749797498074981749827498374984749857498674987749887498974990749917499274993749947499574996749977499874999750007500175002750037500475005750067500775008750097501075011750127501375014750157501675017750187501975020750217502275023750247502575026750277502875029750307503175032750337503475035750367503775038750397504075041750427504375044750457504675047750487504975050750517505275053750547505575056750577505875059750607506175062750637506475065750667506775068750697507075071750727507375074750757507675077750787507975080750817508275083750847508575086750877508875089750907509175092750937509475095750967509775098750997510075101751027510375104751057510675107751087510975110751117511275113751147511575116751177511875119751207512175122751237512475125751267512775128751297513075131751327513375134751357513675137751387513975140751417514275143751447514575146751477514875149751507515175152751537515475155751567515775158751597516075161751627516375164751657516675167751687516975170751717517275173751747517575176751777517875179751807518175182751837518475185751867518775188751897519075191751927519375194751957519675197751987519975200752017520275203752047520575206752077520875209752107521175212752137521475215752167521775218752197522075221752227522375224752257522675227752287522975230752317523275233752347523575236752377523875239752407524175242752437524475245752467524775248752497525075251752527525375254752557525675257752587525975260752617526275263752647526575266752677526875269752707527175272752737527475275752767527775278752797528075281752827528375284752857528675287752887528975290752917529275293752947529575296752977529875299753007530175302753037530475305753067530775308753097531075311753127531375314753157531675317753187531975320753217532275323753247532575326753277532875329753307533175332753337533475335753367533775338753397534075341753427534375344753457534675347753487534975350753517535275353753547535575356753577535875359753607536175362753637536475365753667536775368753697537075371753727537375374753757537675377753787537975380753817538275383753847538575386753877538875389753907539175392753937539475395753967539775398753997540075401754027540375404754057540675407754087540975410754117541275413754147541575416754177541875419754207542175422754237542475425754267542775428754297543075431754327543375434754357543675437754387543975440754417544275443754447544575446754477544875449754507545175452754537545475455754567545775458754597546075461754627546375464754657546675467754687546975470754717547275473754747547575476754777547875479754807548175482754837548475485754867548775488754897549075491754927549375494754957549675497754987549975500755017550275503755047550575506755077550875509755107551175512755137551475515755167551775518755197552075521755227552375524755257552675527755287552975530755317553275533755347553575536755377553875539755407554175542755437554475545755467554775548755497555075551755527555375554755557555675557755587555975560755617556275563755647556575566755677556875569755707557175572755737557475575755767557775578755797558075581755827558375584755857558675587755887558975590755917559275593755947559575596755977559875599756007560175602756037560475605756067560775608756097561075611756127561375614756157561675617756187561975620756217562275623756247562575626756277562875629756307563175632756337563475635756367563775638756397564075641756427564375644756457564675647756487564975650756517565275653756547565575656756577565875659756607566175662756637566475665756667566775668756697567075671756727567375674756757567675677756787567975680756817568275683756847568575686756877568875689756907569175692756937569475695756967569775698756997570075701757027570375704757057570675707757087570975710757117571275713757147571575716757177571875719757207572175722757237572475725757267572775728757297573075731757327573375734757357573675737757387573975740757417574275743757447574575746757477574875749757507575175752757537575475755757567575775758757597576075761757627576375764757657576675767757687576975770757717577275773757747577575776757777577875779757807578175782757837578475785757867578775788757897579075791757927579375794757957579675797757987579975800758017580275803758047580575806758077580875809758107581175812758137581475815758167581775818758197582075821758227582375824758257582675827758287582975830758317583275833758347583575836758377583875839758407584175842758437584475845758467584775848758497585075851758527585375854758557585675857758587585975860758617586275863758647586575866758677586875869758707587175872758737587475875758767587775878758797588075881758827588375884758857588675887758887588975890758917589275893758947589575896758977589875899759007590175902759037590475905759067590775908759097591075911759127591375914759157591675917759187591975920759217592275923759247592575926759277592875929759307593175932759337593475935759367593775938759397594075941759427594375944759457594675947759487594975950759517595275953759547595575956759577595875959759607596175962759637596475965759667596775968759697597075971759727597375974759757597675977759787597975980759817598275983759847598575986759877598875989759907599175992759937599475995759967599775998759997600076001760027600376004760057600676007760087600976010760117601276013760147601576016760177601876019760207602176022760237602476025760267602776028760297603076031760327603376034760357603676037760387603976040760417604276043760447604576046760477604876049760507605176052760537605476055760567605776058760597606076061760627606376064760657606676067760687606976070760717607276073760747607576076760777607876079760807608176082760837608476085760867608776088760897609076091760927609376094760957609676097760987609976100761017610276103761047610576106761077610876109761107611176112761137611476115761167611776118761197612076121761227612376124761257612676127761287612976130761317613276133761347613576136761377613876139761407614176142761437614476145761467614776148761497615076151761527615376154761557615676157761587615976160761617616276163761647616576166761677616876169761707617176172761737617476175761767617776178761797618076181761827618376184761857618676187761887618976190761917619276193761947619576196761977619876199762007620176202762037620476205762067620776208762097621076211762127621376214762157621676217762187621976220762217622276223762247622576226762277622876229762307623176232762337623476235762367623776238762397624076241762427624376244762457624676247762487624976250762517625276253762547625576256762577625876259762607626176262762637626476265762667626776268762697627076271762727627376274762757627676277762787627976280762817628276283762847628576286762877628876289762907629176292762937629476295762967629776298762997630076301763027630376304763057630676307763087630976310763117631276313763147631576316763177631876319763207632176322763237632476325763267632776328763297633076331763327633376334763357633676337763387633976340763417634276343763447634576346763477634876349763507635176352763537635476355763567635776358763597636076361763627636376364763657636676367763687636976370763717637276373763747637576376763777637876379763807638176382763837638476385763867638776388763897639076391763927639376394763957639676397763987639976400764017640276403764047640576406764077640876409764107641176412764137641476415764167641776418764197642076421764227642376424764257642676427764287642976430764317643276433764347643576436764377643876439764407644176442764437644476445764467644776448764497645076451764527645376454764557645676457764587645976460764617646276463764647646576466764677646876469764707647176472764737647476475764767647776478764797648076481764827648376484764857648676487764887648976490764917649276493764947649576496764977649876499765007650176502765037650476505765067650776508765097651076511765127651376514765157651676517765187651976520765217652276523765247652576526765277652876529765307653176532765337653476535765367653776538765397654076541765427654376544765457654676547765487654976550765517655276553765547655576556765577655876559765607656176562765637656476565765667656776568765697657076571765727657376574765757657676577765787657976580765817658276583765847658576586765877658876589765907659176592765937659476595765967659776598765997660076601766027660376604766057660676607766087660976610766117661276613766147661576616766177661876619766207662176622766237662476625766267662776628766297663076631766327663376634766357663676637766387663976640766417664276643766447664576646766477664876649766507665176652766537665476655766567665776658766597666076661766627666376664766657666676667766687666976670766717667276673766747667576676766777667876679766807668176682766837668476685766867668776688766897669076691766927669376694766957669676697766987669976700767017670276703767047670576706767077670876709767107671176712767137671476715767167671776718767197672076721767227672376724767257672676727767287672976730767317673276733767347673576736767377673876739767407674176742767437674476745767467674776748767497675076751767527675376754767557675676757767587675976760767617676276763767647676576766767677676876769767707677176772767737677476775767767677776778767797678076781767827678376784767857678676787767887678976790767917679276793767947679576796767977679876799768007680176802768037680476805768067680776808768097681076811768127681376814768157681676817768187681976820768217682276823768247682576826768277682876829768307683176832768337683476835768367683776838768397684076841768427684376844768457684676847768487684976850768517685276853768547685576856768577685876859768607686176862768637686476865768667686776868768697687076871768727687376874768757687676877768787687976880768817688276883768847688576886768877688876889768907689176892768937689476895768967689776898768997690076901769027690376904769057690676907769087690976910769117691276913769147691576916769177691876919769207692176922769237692476925769267692776928769297693076931769327693376934769357693676937769387693976940769417694276943769447694576946769477694876949769507695176952769537695476955769567695776958769597696076961769627696376964769657696676967769687696976970769717697276973769747697576976769777697876979769807698176982769837698476985769867698776988769897699076991769927699376994769957699676997769987699977000770017700277003770047700577006770077700877009770107701177012770137701477015770167701777018770197702077021770227702377024770257702677027770287702977030770317703277033770347703577036770377703877039770407704177042770437704477045770467704777048770497705077051770527705377054770557705677057770587705977060770617706277063770647706577066770677706877069770707707177072770737707477075770767707777078770797708077081770827708377084770857708677087770887708977090770917709277093770947709577096770977709877099771007710177102771037710477105771067710777108771097711077111771127711377114771157711677117771187711977120771217712277123771247712577126771277712877129771307713177132771337713477135771367713777138771397714077141771427714377144771457714677147771487714977150771517715277153771547715577156771577715877159771607716177162771637716477165771667716777168771697717077171771727717377174771757717677177771787717977180771817718277183771847718577186771877718877189771907719177192771937719477195771967719777198771997720077201772027720377204772057720677207772087720977210772117721277213772147721577216772177721877219772207722177222772237722477225772267722777228772297723077231772327723377234772357723677237772387723977240772417724277243772447724577246772477724877249772507725177252772537725477255772567725777258772597726077261772627726377264772657726677267772687726977270772717727277273772747727577276772777727877279772807728177282772837728477285772867728777288772897729077291772927729377294772957729677297772987729977300773017730277303773047730577306773077730877309773107731177312773137731477315773167731777318773197732077321773227732377324773257732677327773287732977330773317733277333773347733577336773377733877339773407734177342773437734477345773467734777348773497735077351773527735377354773557735677357773587735977360773617736277363773647736577366773677736877369773707737177372773737737477375773767737777378773797738077381773827738377384773857738677387773887738977390773917739277393773947739577396773977739877399774007740177402774037740477405774067740777408774097741077411774127741377414774157741677417774187741977420774217742277423774247742577426774277742877429774307743177432774337743477435774367743777438774397744077441774427744377444774457744677447774487744977450774517745277453774547745577456774577745877459774607746177462774637746477465774667746777468774697747077471774727747377474774757747677477774787747977480774817748277483774847748577486774877748877489774907749177492774937749477495774967749777498774997750077501775027750377504775057750677507775087750977510775117751277513775147751577516775177751877519775207752177522775237752477525775267752777528775297753077531775327753377534775357753677537775387753977540775417754277543775447754577546775477754877549775507755177552775537755477555775567755777558775597756077561775627756377564775657756677567775687756977570775717757277573775747757577576775777757877579775807758177582775837758477585775867758777588775897759077591775927759377594775957759677597775987759977600776017760277603776047760577606776077760877609776107761177612776137761477615776167761777618776197762077621776227762377624776257762677627776287762977630776317763277633776347763577636776377763877639776407764177642776437764477645776467764777648776497765077651776527765377654776557765677657776587765977660776617766277663776647766577666776677766877669776707767177672776737767477675776767767777678776797768077681776827768377684776857768677687776887768977690776917769277693776947769577696776977769877699777007770177702777037770477705777067770777708777097771077711777127771377714777157771677717777187771977720777217772277723777247772577726777277772877729777307773177732777337773477735777367773777738777397774077741777427774377744777457774677747777487774977750777517775277753777547775577756777577775877759777607776177762777637776477765777667776777768777697777077771777727777377774777757777677777777787777977780777817778277783777847778577786777877778877789777907779177792777937779477795777967779777798777997780077801778027780377804778057780677807778087780977810778117781277813778147781577816778177781877819778207782177822778237782477825778267782777828778297783077831778327783377834778357783677837778387783977840778417784277843778447784577846778477784877849778507785177852778537785477855778567785777858778597786077861778627786377864778657786677867778687786977870778717787277873778747787577876778777787877879778807788177882778837788477885778867788777888778897789077891778927789377894778957789677897778987789977900779017790277903779047790577906779077790877909779107791177912779137791477915779167791777918779197792077921779227792377924779257792677927779287792977930779317793277933779347793577936779377793877939779407794177942779437794477945779467794777948779497795077951779527795377954779557795677957779587795977960779617796277963779647796577966779677796877969779707797177972779737797477975779767797777978779797798077981779827798377984779857798677987779887798977990779917799277993779947799577996779977799877999780007800178002780037800478005780067800778008780097801078011780127801378014780157801678017780187801978020780217802278023780247802578026780277802878029780307803178032780337803478035780367803778038780397804078041780427804378044780457804678047780487804978050780517805278053780547805578056780577805878059780607806178062780637806478065780667806778068780697807078071780727807378074780757807678077780787807978080780817808278083780847808578086780877808878089780907809178092780937809478095780967809778098780997810078101781027810378104781057810678107781087810978110781117811278113781147811578116781177811878119781207812178122781237812478125781267812778128781297813078131781327813378134781357813678137781387813978140781417814278143781447814578146781477814878149781507815178152781537815478155781567815778158781597816078161781627816378164781657816678167781687816978170781717817278173781747817578176781777817878179781807818178182781837818478185781867818778188781897819078191781927819378194781957819678197781987819978200782017820278203782047820578206782077820878209782107821178212782137821478215782167821778218782197822078221782227822378224782257822678227782287822978230782317823278233782347823578236782377823878239782407824178242782437824478245782467824778248782497825078251782527825378254782557825678257782587825978260782617826278263782647826578266782677826878269782707827178272782737827478275782767827778278782797828078281782827828378284782857828678287782887828978290782917829278293782947829578296782977829878299783007830178302783037830478305783067830778308783097831078311783127831378314783157831678317783187831978320783217832278323783247832578326783277832878329783307833178332783337833478335783367833778338783397834078341783427834378344783457834678347783487834978350783517835278353783547835578356783577835878359783607836178362783637836478365783667836778368783697837078371783727837378374783757837678377783787837978380783817838278383783847838578386783877838878389783907839178392783937839478395783967839778398783997840078401784027840378404784057840678407784087840978410784117841278413784147841578416784177841878419784207842178422784237842478425784267842778428784297843078431784327843378434784357843678437784387843978440784417844278443784447844578446784477844878449784507845178452784537845478455784567845778458784597846078461784627846378464784657846678467784687846978470784717847278473784747847578476784777847878479784807848178482784837848478485784867848778488784897849078491784927849378494784957849678497784987849978500785017850278503785047850578506785077850878509785107851178512785137851478515785167851778518785197852078521785227852378524785257852678527785287852978530785317853278533785347853578536785377853878539785407854178542785437854478545785467854778548785497855078551785527855378554785557855678557785587855978560785617856278563785647856578566785677856878569785707857178572785737857478575785767857778578785797858078581785827858378584785857858678587785887858978590785917859278593785947859578596785977859878599786007860178602786037860478605786067860778608786097861078611786127861378614786157861678617786187861978620786217862278623786247862578626786277862878629786307863178632786337863478635786367863778638786397864078641786427864378644786457864678647786487864978650786517865278653786547865578656786577865878659786607866178662786637866478665786667866778668786697867078671786727867378674786757867678677786787867978680786817868278683786847868578686786877868878689786907869178692786937869478695786967869778698786997870078701787027870378704787057870678707787087870978710787117871278713787147871578716787177871878719787207872178722787237872478725787267872778728787297873078731787327873378734787357873678737787387873978740787417874278743787447874578746787477874878749787507875178752787537875478755787567875778758787597876078761787627876378764787657876678767787687876978770787717877278773787747877578776787777877878779787807878178782787837878478785787867878778788787897879078791787927879378794787957879678797787987879978800788017880278803788047880578806788077880878809788107881178812788137881478815788167881778818788197882078821788227882378824788257882678827788287882978830788317883278833788347883578836788377883878839788407884178842788437884478845788467884778848788497885078851788527885378854788557885678857788587885978860788617886278863788647886578866788677886878869788707887178872788737887478875788767887778878788797888078881788827888378884788857888678887788887888978890788917889278893788947889578896788977889878899789007890178902789037890478905789067890778908789097891078911789127891378914789157891678917789187891978920789217892278923789247892578926789277892878929789307893178932789337893478935789367893778938789397894078941789427894378944789457894678947789487894978950789517895278953789547895578956789577895878959789607896178962789637896478965789667896778968789697897078971789727897378974789757897678977789787897978980789817898278983789847898578986789877898878989789907899178992789937899478995789967899778998789997900079001790027900379004790057900679007790087900979010790117901279013790147901579016790177901879019790207902179022790237902479025790267902779028790297903079031790327903379034790357903679037790387903979040790417904279043790447904579046790477904879049790507905179052790537905479055790567905779058790597906079061790627906379064790657906679067790687906979070790717907279073790747907579076790777907879079790807908179082790837908479085790867908779088790897909079091790927909379094790957909679097790987909979100791017910279103791047910579106791077910879109791107911179112791137911479115791167911779118791197912079121791227912379124791257912679127791287912979130791317913279133791347913579136791377913879139791407914179142791437914479145791467914779148791497915079151791527915379154791557915679157791587915979160791617916279163791647916579166791677916879169791707917179172791737917479175791767917779178791797918079181791827918379184791857918679187791887918979190791917919279193791947919579196791977919879199792007920179202792037920479205792067920779208792097921079211792127921379214792157921679217792187921979220792217922279223792247922579226792277922879229792307923179232792337923479235792367923779238792397924079241792427924379244792457924679247792487924979250792517925279253792547925579256792577925879259792607926179262792637926479265792667926779268792697927079271792727927379274792757927679277792787927979280792817928279283792847928579286792877928879289792907929179292792937929479295792967929779298792997930079301793027930379304793057930679307793087930979310793117931279313793147931579316793177931879319793207932179322793237932479325793267932779328793297933079331793327933379334793357933679337793387933979340793417934279343793447934579346793477934879349793507935179352793537935479355793567935779358793597936079361793627936379364793657936679367793687936979370793717937279373793747937579376793777937879379793807938179382793837938479385793867938779388793897939079391793927939379394793957939679397793987939979400794017940279403794047940579406794077940879409794107941179412794137941479415794167941779418794197942079421794227942379424794257942679427794287942979430794317943279433794347943579436794377943879439794407944179442794437944479445794467944779448794497945079451794527945379454794557945679457794587945979460794617946279463794647946579466794677946879469794707947179472794737947479475794767947779478794797948079481794827948379484794857948679487794887948979490794917949279493794947949579496794977949879499795007950179502795037950479505795067950779508795097951079511795127951379514795157951679517795187951979520795217952279523795247952579526795277952879529795307953179532795337953479535795367953779538795397954079541795427954379544795457954679547795487954979550795517955279553795547955579556795577955879559795607956179562795637956479565795667956779568795697957079571795727957379574795757957679577795787957979580795817958279583795847958579586795877958879589795907959179592795937959479595795967959779598795997960079601796027960379604796057960679607796087960979610796117961279613796147961579616796177961879619796207962179622796237962479625796267962779628796297963079631796327963379634796357963679637796387963979640796417964279643796447964579646796477964879649796507965179652796537965479655796567965779658796597966079661796627966379664796657966679667796687966979670796717967279673796747967579676796777967879679796807968179682796837968479685796867968779688796897969079691796927969379694796957969679697796987969979700797017970279703797047970579706797077970879709797107971179712797137971479715797167971779718797197972079721797227972379724797257972679727797287972979730797317973279733797347973579736797377973879739797407974179742797437974479745797467974779748797497975079751797527975379754797557975679757797587975979760797617976279763797647976579766797677976879769797707977179772797737977479775797767977779778797797978079781797827978379784797857978679787797887978979790797917979279793797947979579796797977979879799798007980179802798037980479805798067980779808798097981079811798127981379814798157981679817798187981979820798217982279823798247982579826798277982879829798307983179832798337983479835798367983779838798397984079841798427984379844798457984679847798487984979850798517985279853798547985579856798577985879859798607986179862798637986479865798667986779868798697987079871798727987379874798757987679877798787987979880798817988279883798847988579886798877988879889798907989179892798937989479895798967989779898798997990079901799027990379904799057990679907799087990979910799117991279913799147991579916799177991879919799207992179922799237992479925799267992779928799297993079931799327993379934799357993679937799387993979940799417994279943799447994579946799477994879949799507995179952799537995479955799567995779958799597996079961799627996379964799657996679967799687996979970799717997279973799747997579976799777997879979799807998179982799837998479985799867998779988799897999079991799927999379994799957999679997799987999980000800018000280003800048000580006800078000880009800108001180012800138001480015800168001780018800198002080021800228002380024800258002680027800288002980030800318003280033800348003580036800378003880039800408004180042800438004480045800468004780048800498005080051800528005380054800558005680057800588005980060800618006280063800648006580066800678006880069800708007180072800738007480075800768007780078800798008080081800828008380084800858008680087800888008980090800918009280093800948009580096800978009880099801008010180102801038010480105801068010780108801098011080111801128011380114801158011680117801188011980120801218012280123801248012580126801278012880129801308013180132801338013480135801368013780138801398014080141801428014380144801458014680147801488014980150801518015280153801548015580156801578015880159801608016180162801638016480165801668016780168801698017080171801728017380174801758017680177801788017980180801818018280183801848018580186801878018880189801908019180192801938019480195801968019780198801998020080201802028020380204802058020680207802088020980210802118021280213802148021580216802178021880219802208022180222802238022480225802268022780228802298023080231802328023380234802358023680237802388023980240802418024280243802448024580246802478024880249802508025180252802538025480255802568025780258802598026080261802628026380264802658026680267802688026980270802718027280273802748027580276802778027880279802808028180282802838028480285802868028780288802898029080291802928029380294802958029680297802988029980300803018030280303803048030580306803078030880309803108031180312803138031480315803168031780318803198032080321803228032380324803258032680327803288032980330803318033280333803348033580336803378033880339803408034180342803438034480345803468034780348803498035080351803528035380354803558035680357803588035980360803618036280363803648036580366803678036880369803708037180372803738037480375803768037780378803798038080381803828038380384803858038680387803888038980390803918039280393803948039580396803978039880399804008040180402804038040480405804068040780408804098041080411804128041380414804158041680417804188041980420804218042280423804248042580426804278042880429804308043180432804338043480435804368043780438804398044080441804428044380444804458044680447804488044980450804518045280453804548045580456804578045880459804608046180462804638046480465804668046780468804698047080471804728047380474804758047680477804788047980480804818048280483804848048580486804878048880489804908049180492804938049480495804968049780498804998050080501805028050380504805058050680507805088050980510805118051280513805148051580516805178051880519805208052180522805238052480525805268052780528805298053080531805328053380534805358053680537805388053980540805418054280543805448054580546805478054880549805508055180552805538055480555805568055780558805598056080561805628056380564805658056680567805688056980570805718057280573805748057580576805778057880579805808058180582805838058480585805868058780588805898059080591805928059380594805958059680597805988059980600806018060280603806048060580606806078060880609806108061180612806138061480615806168061780618806198062080621806228062380624806258062680627806288062980630806318063280633806348063580636806378063880639806408064180642806438064480645806468064780648806498065080651806528065380654806558065680657806588065980660806618066280663806648066580666806678066880669806708067180672806738067480675806768067780678806798068080681806828068380684806858068680687806888068980690806918069280693806948069580696806978069880699807008070180702807038070480705807068070780708807098071080711807128071380714807158071680717807188071980720807218072280723807248072580726807278072880729807308073180732807338073480735807368073780738807398074080741807428074380744807458074680747807488074980750807518075280753807548075580756807578075880759807608076180762807638076480765807668076780768807698077080771807728077380774807758077680777807788077980780807818078280783807848078580786807878078880789807908079180792807938079480795807968079780798807998080080801808028080380804808058080680807808088080980810808118081280813808148081580816808178081880819808208082180822808238082480825808268082780828808298083080831808328083380834808358083680837808388083980840808418084280843808448084580846808478084880849808508085180852808538085480855808568085780858808598086080861808628086380864808658086680867808688086980870808718087280873808748087580876808778087880879808808088180882808838088480885808868088780888808898089080891808928089380894808958089680897808988089980900809018090280903809048090580906809078090880909809108091180912809138091480915809168091780918809198092080921809228092380924809258092680927809288092980930809318093280933809348093580936809378093880939809408094180942809438094480945809468094780948809498095080951809528095380954809558095680957809588095980960809618096280963809648096580966809678096880969809708097180972809738097480975809768097780978809798098080981809828098380984809858098680987809888098980990809918099280993809948099580996809978099880999810008100181002810038100481005810068100781008810098101081011810128101381014810158101681017810188101981020810218102281023810248102581026810278102881029810308103181032810338103481035810368103781038810398104081041810428104381044810458104681047810488104981050810518105281053810548105581056810578105881059810608106181062810638106481065810668106781068810698107081071810728107381074810758107681077810788107981080810818108281083810848108581086810878108881089810908109181092810938109481095810968109781098810998110081101811028110381104811058110681107811088110981110811118111281113811148111581116811178111881119811208112181122811238112481125811268112781128811298113081131811328113381134811358113681137811388113981140811418114281143811448114581146811478114881149811508115181152811538115481155811568115781158811598116081161811628116381164811658116681167811688116981170811718117281173811748117581176811778117881179811808118181182811838118481185811868118781188811898119081191811928119381194811958119681197811988119981200812018120281203812048120581206812078120881209812108121181212812138121481215812168121781218812198122081221812228122381224812258122681227812288122981230812318123281233812348123581236812378123881239812408124181242812438124481245812468124781248812498125081251812528125381254812558125681257812588125981260812618126281263812648126581266812678126881269812708127181272812738127481275812768127781278812798128081281812828128381284812858128681287812888128981290812918129281293812948129581296812978129881299813008130181302813038130481305813068130781308813098131081311813128131381314813158131681317813188131981320813218132281323813248132581326813278132881329813308133181332813338133481335813368133781338813398134081341813428134381344813458134681347813488134981350813518135281353813548135581356813578135881359813608136181362813638136481365813668136781368813698137081371813728137381374813758137681377813788137981380813818138281383813848138581386813878138881389813908139181392813938139481395813968139781398813998140081401814028140381404814058140681407814088140981410814118141281413814148141581416814178141881419814208142181422814238142481425814268142781428814298143081431814328143381434814358143681437814388143981440814418144281443814448144581446814478144881449814508145181452814538145481455814568145781458814598146081461814628146381464814658146681467814688146981470814718147281473814748147581476814778147881479814808148181482814838148481485814868148781488814898149081491814928149381494814958149681497814988149981500815018150281503815048150581506815078150881509815108151181512815138151481515815168151781518815198152081521815228152381524815258152681527815288152981530815318153281533815348153581536815378153881539815408154181542815438154481545815468154781548815498155081551815528155381554815558155681557815588155981560815618156281563815648156581566815678156881569815708157181572815738157481575815768157781578815798158081581815828158381584815858158681587815888158981590815918159281593815948159581596815978159881599816008160181602816038160481605816068160781608816098161081611816128161381614816158161681617816188161981620816218162281623816248162581626816278162881629816308163181632816338163481635816368163781638816398164081641816428164381644816458164681647816488164981650816518165281653816548165581656816578165881659816608166181662816638166481665816668166781668816698167081671816728167381674816758167681677816788167981680816818168281683816848168581686816878168881689816908169181692816938169481695816968169781698816998170081701817028170381704817058170681707817088170981710817118171281713817148171581716817178171881719817208172181722817238172481725817268172781728817298173081731817328173381734817358173681737817388173981740817418174281743817448174581746817478174881749817508175181752817538175481755817568175781758817598176081761817628176381764817658176681767817688176981770817718177281773817748177581776817778177881779817808178181782817838178481785817868178781788817898179081791817928179381794817958179681797817988179981800818018180281803818048180581806818078180881809818108181181812818138181481815818168181781818818198182081821818228182381824818258182681827818288182981830818318183281833818348183581836818378183881839818408184181842818438184481845818468184781848818498185081851818528185381854818558185681857818588185981860818618186281863818648186581866818678186881869818708187181872818738187481875818768187781878818798188081881818828188381884818858188681887818888188981890818918189281893818948189581896818978189881899819008190181902819038190481905819068190781908819098191081911819128191381914819158191681917819188191981920819218192281923819248192581926819278192881929819308193181932819338193481935819368193781938819398194081941819428194381944819458194681947819488194981950819518195281953819548195581956819578195881959819608196181962819638196481965819668196781968819698197081971819728197381974819758197681977819788197981980819818198281983819848198581986819878198881989819908199181992819938199481995819968199781998819998200082001820028200382004820058200682007820088200982010820118201282013820148201582016820178201882019820208202182022820238202482025820268202782028820298203082031820328203382034820358203682037820388203982040820418204282043820448204582046820478204882049820508205182052820538205482055820568205782058820598206082061820628206382064820658206682067820688206982070820718207282073820748207582076820778207882079820808208182082820838208482085820868208782088820898209082091820928209382094820958209682097820988209982100821018210282103821048210582106821078210882109821108211182112821138211482115821168211782118821198212082121821228212382124821258212682127821288212982130821318213282133821348213582136821378213882139821408214182142821438214482145821468214782148821498215082151821528215382154821558215682157821588215982160821618216282163821648216582166821678216882169821708217182172821738217482175821768217782178821798218082181821828218382184821858218682187821888218982190821918219282193821948219582196821978219882199822008220182202822038220482205822068220782208822098221082211822128221382214822158221682217822188221982220822218222282223822248222582226822278222882229822308223182232822338223482235822368223782238822398224082241822428224382244822458224682247822488224982250822518225282253822548225582256822578225882259822608226182262822638226482265822668226782268822698227082271822728227382274822758227682277822788227982280822818228282283822848228582286822878228882289822908229182292822938229482295822968229782298822998230082301823028230382304823058230682307823088230982310823118231282313823148231582316823178231882319823208232182322823238232482325823268232782328823298233082331823328233382334823358233682337823388233982340823418234282343823448234582346823478234882349823508235182352823538235482355823568235782358823598236082361823628236382364823658236682367823688236982370823718237282373823748237582376823778237882379823808238182382823838238482385823868238782388823898239082391823928239382394823958239682397823988239982400824018240282403824048240582406824078240882409824108241182412824138241482415824168241782418824198242082421824228242382424824258242682427824288242982430824318243282433824348243582436824378243882439824408244182442824438244482445824468244782448824498245082451824528245382454824558245682457824588245982460824618246282463824648246582466824678246882469824708247182472824738247482475824768247782478824798248082481824828248382484824858248682487824888248982490824918249282493824948249582496824978249882499825008250182502825038250482505825068250782508825098251082511825128251382514825158251682517825188251982520825218252282523825248252582526825278252882529825308253182532825338253482535825368253782538825398254082541825428254382544825458254682547825488254982550825518255282553825548255582556825578255882559825608256182562825638256482565825668256782568825698257082571825728257382574825758257682577825788257982580825818258282583825848258582586825878258882589825908259182592825938259482595825968259782598825998260082601826028260382604826058260682607826088260982610826118261282613826148261582616826178261882619826208262182622826238262482625826268262782628826298263082631826328263382634826358263682637826388263982640826418264282643826448264582646826478264882649826508265182652826538265482655826568265782658826598266082661826628266382664826658266682667826688266982670826718267282673826748267582676826778267882679826808268182682826838268482685826868268782688826898269082691826928269382694826958269682697826988269982700827018270282703827048270582706827078270882709827108271182712827138271482715827168271782718827198272082721827228272382724827258272682727827288272982730827318273282733827348273582736827378273882739827408274182742827438274482745827468274782748827498275082751827528275382754827558275682757827588275982760827618276282763827648276582766827678276882769827708277182772827738277482775827768277782778827798278082781827828278382784827858278682787827888278982790827918279282793827948279582796827978279882799828008280182802828038280482805828068280782808828098281082811828128281382814828158281682817828188281982820828218282282823828248282582826828278282882829828308283182832828338283482835828368283782838828398284082841828428284382844828458284682847828488284982850828518285282853828548285582856828578285882859828608286182862828638286482865828668286782868828698287082871828728287382874828758287682877828788287982880828818288282883828848288582886828878288882889828908289182892828938289482895828968289782898828998290082901829028290382904829058290682907829088290982910829118291282913829148291582916829178291882919829208292182922829238292482925829268292782928829298293082931829328293382934829358293682937829388293982940829418294282943829448294582946829478294882949829508295182952829538295482955829568295782958829598296082961829628296382964829658296682967829688296982970829718297282973829748297582976829778297882979829808298182982829838298482985829868298782988829898299082991829928299382994829958299682997829988299983000830018300283003830048300583006830078300883009830108301183012830138301483015830168301783018830198302083021830228302383024830258302683027830288302983030830318303283033830348303583036830378303883039830408304183042830438304483045830468304783048830498305083051830528305383054830558305683057830588305983060830618306283063830648306583066830678306883069830708307183072830738307483075830768307783078830798308083081830828308383084830858308683087830888308983090830918309283093830948309583096830978309883099831008310183102831038310483105831068310783108831098311083111831128311383114831158311683117831188311983120831218312283123831248312583126831278312883129831308313183132831338313483135831368313783138831398314083141831428314383144831458314683147831488314983150831518315283153831548315583156831578315883159831608316183162831638316483165831668316783168831698317083171831728317383174831758317683177831788317983180831818318283183831848318583186831878318883189831908319183192831938319483195831968319783198831998320083201832028320383204832058320683207832088320983210832118321283213832148321583216832178321883219832208322183222832238322483225832268322783228832298323083231832328323383234832358323683237832388323983240832418324283243832448324583246832478324883249832508325183252832538325483255832568325783258832598326083261832628326383264832658326683267832688326983270832718327283273832748327583276832778327883279832808328183282832838328483285832868328783288832898329083291832928329383294832958329683297832988329983300833018330283303833048330583306833078330883309833108331183312833138331483315833168331783318833198332083321833228332383324833258332683327833288332983330833318333283333833348333583336833378333883339833408334183342833438334483345833468334783348833498335083351833528335383354833558335683357833588335983360833618336283363833648336583366833678336883369833708337183372833738337483375833768337783378833798338083381833828338383384833858338683387833888338983390833918339283393833948339583396833978339883399834008340183402834038340483405834068340783408834098341083411834128341383414834158341683417834188341983420834218342283423834248342583426834278342883429834308343183432834338343483435834368343783438834398344083441834428344383444834458344683447834488344983450834518345283453834548345583456834578345883459834608346183462834638346483465834668346783468834698347083471834728347383474834758347683477834788347983480834818348283483834848348583486834878348883489834908349183492834938349483495834968349783498834998350083501835028350383504835058350683507835088350983510835118351283513835148351583516835178351883519835208352183522835238352483525835268352783528835298353083531835328353383534835358353683537835388353983540835418354283543835448354583546835478354883549835508355183552835538355483555835568355783558835598356083561835628356383564835658356683567835688356983570835718357283573835748357583576835778357883579835808358183582835838358483585835868358783588835898359083591835928359383594835958359683597835988359983600836018360283603836048360583606836078360883609836108361183612836138361483615836168361783618836198362083621836228362383624836258362683627836288362983630836318363283633836348363583636836378363883639836408364183642836438364483645836468364783648836498365083651836528365383654836558365683657836588365983660836618366283663836648366583666836678366883669836708367183672836738367483675836768367783678836798368083681836828368383684836858368683687836888368983690836918369283693836948369583696836978369883699837008370183702837038370483705837068370783708837098371083711837128371383714837158371683717837188371983720837218372283723837248372583726837278372883729837308373183732837338373483735837368373783738837398374083741837428374383744837458374683747837488374983750837518375283753837548375583756837578375883759837608376183762837638376483765837668376783768837698377083771837728377383774837758377683777837788377983780837818378283783837848378583786837878378883789837908379183792837938379483795837968379783798837998380083801838028380383804838058380683807838088380983810838118381283813838148381583816838178381883819838208382183822838238382483825838268382783828838298383083831838328383383834838358383683837838388383983840838418384283843838448384583846838478384883849838508385183852838538385483855838568385783858838598386083861838628386383864838658386683867838688386983870838718387283873838748387583876838778387883879838808388183882838838388483885838868388783888838898389083891838928389383894838958389683897838988389983900839018390283903839048390583906839078390883909839108391183912839138391483915839168391783918839198392083921839228392383924839258392683927839288392983930839318393283933839348393583936839378393883939839408394183942839438394483945839468394783948839498395083951839528395383954839558395683957839588395983960839618396283963839648396583966839678396883969839708397183972839738397483975839768397783978839798398083981839828398383984839858398683987839888398983990839918399283993839948399583996839978399883999840008400184002840038400484005840068400784008840098401084011840128401384014840158401684017840188401984020840218402284023840248402584026840278402884029840308403184032840338403484035840368403784038840398404084041840428404384044840458404684047840488404984050840518405284053840548405584056840578405884059840608406184062840638406484065840668406784068840698407084071840728407384074840758407684077840788407984080840818408284083840848408584086840878408884089840908409184092840938409484095840968409784098840998410084101841028410384104841058410684107841088410984110841118411284113841148411584116841178411884119841208412184122841238412484125841268412784128841298413084131841328413384134841358413684137841388413984140841418414284143841448414584146841478414884149841508415184152841538415484155841568415784158841598416084161841628416384164841658416684167841688416984170841718417284173841748417584176841778417884179841808418184182841838418484185841868418784188841898419084191841928419384194841958419684197841988419984200842018420284203842048420584206842078420884209842108421184212842138421484215842168421784218842198422084221842228422384224842258422684227842288422984230842318423284233842348423584236842378423884239842408424184242842438424484245842468424784248842498425084251842528425384254842558425684257842588425984260842618426284263842648426584266842678426884269842708427184272842738427484275842768427784278842798428084281842828428384284842858428684287842888428984290842918429284293842948429584296842978429884299843008430184302843038430484305843068430784308843098431084311843128431384314843158431684317843188431984320843218432284323843248432584326843278432884329843308433184332843338433484335843368433784338843398434084341843428434384344843458434684347843488434984350843518435284353843548435584356843578435884359843608436184362843638436484365843668436784368843698437084371843728437384374843758437684377843788437984380843818438284383843848438584386843878438884389843908439184392843938439484395843968439784398843998440084401844028440384404844058440684407844088440984410844118441284413844148441584416844178441884419844208442184422844238442484425844268442784428844298443084431844328443384434844358443684437844388443984440844418444284443844448444584446844478444884449844508445184452844538445484455844568445784458844598446084461844628446384464844658446684467844688446984470844718447284473844748447584476844778447884479844808448184482844838448484485844868448784488844898449084491844928449384494844958449684497844988449984500845018450284503845048450584506845078450884509845108451184512845138451484515845168451784518845198452084521845228452384524845258452684527845288452984530845318453284533845348453584536845378453884539845408454184542845438454484545845468454784548845498455084551845528455384554845558455684557845588455984560845618456284563845648456584566845678456884569845708457184572845738457484575845768457784578845798458084581845828458384584845858458684587845888458984590845918459284593845948459584596845978459884599846008460184602846038460484605846068460784608846098461084611846128461384614846158461684617846188461984620846218462284623846248462584626846278462884629846308463184632846338463484635846368463784638846398464084641846428464384644846458464684647846488464984650846518465284653846548465584656846578465884659846608466184662846638466484665846668466784668846698467084671846728467384674846758467684677846788467984680846818468284683846848468584686846878468884689846908469184692846938469484695846968469784698846998470084701847028470384704847058470684707847088470984710847118471284713847148471584716847178471884719847208472184722847238472484725847268472784728847298473084731847328473384734847358473684737847388473984740847418474284743847448474584746847478474884749847508475184752847538475484755847568475784758847598476084761847628476384764847658476684767847688476984770847718477284773847748477584776847778477884779847808478184782847838478484785847868478784788847898479084791847928479384794847958479684797847988479984800848018480284803848048480584806848078480884809848108481184812848138481484815848168481784818848198482084821848228482384824848258482684827848288482984830848318483284833848348483584836848378483884839848408484184842848438484484845848468484784848848498485084851848528485384854848558485684857848588485984860848618486284863848648486584866848678486884869848708487184872848738487484875848768487784878848798488084881848828488384884848858488684887848888488984890848918489284893848948489584896848978489884899849008490184902849038490484905849068490784908849098491084911849128491384914849158491684917849188491984920849218492284923849248492584926849278492884929849308493184932849338493484935849368493784938849398494084941849428494384944849458494684947849488494984950849518495284953849548495584956849578495884959849608496184962849638496484965849668496784968849698497084971849728497384974849758497684977849788497984980849818498284983849848498584986849878498884989849908499184992849938499484995849968499784998849998500085001850028500385004850058500685007850088500985010850118501285013850148501585016850178501885019850208502185022850238502485025850268502785028850298503085031850328503385034850358503685037850388503985040850418504285043850448504585046850478504885049850508505185052850538505485055850568505785058850598506085061850628506385064850658506685067850688506985070850718507285073850748507585076850778507885079850808508185082850838508485085850868508785088850898509085091850928509385094850958509685097850988509985100851018510285103851048510585106851078510885109851108511185112851138511485115851168511785118851198512085121851228512385124851258512685127851288512985130851318513285133851348513585136851378513885139851408514185142851438514485145851468514785148851498515085151851528515385154851558515685157851588515985160851618516285163851648516585166851678516885169851708517185172851738517485175851768517785178851798518085181851828518385184851858518685187851888518985190851918519285193851948519585196851978519885199852008520185202852038520485205852068520785208852098521085211852128521385214852158521685217852188521985220852218522285223852248522585226852278522885229852308523185232852338523485235852368523785238852398524085241852428524385244852458524685247852488524985250852518525285253852548525585256852578525885259852608526185262852638526485265852668526785268852698527085271852728527385274852758527685277852788527985280852818528285283852848528585286852878528885289852908529185292852938529485295852968529785298852998530085301853028530385304853058530685307853088530985310853118531285313853148531585316853178531885319853208532185322853238532485325853268532785328853298533085331853328533385334853358533685337853388533985340853418534285343853448534585346853478534885349853508535185352853538535485355853568535785358853598536085361853628536385364853658536685367853688536985370853718537285373853748537585376853778537885379853808538185382853838538485385853868538785388853898539085391853928539385394853958539685397853988539985400854018540285403854048540585406854078540885409854108541185412854138541485415854168541785418854198542085421854228542385424854258542685427854288542985430854318543285433854348543585436854378543885439854408544185442854438544485445854468544785448854498545085451854528545385454854558545685457854588545985460854618546285463854648546585466854678546885469854708547185472854738547485475854768547785478854798548085481854828548385484854858548685487854888548985490854918549285493854948549585496854978549885499855008550185502855038550485505855068550785508855098551085511855128551385514855158551685517855188551985520855218552285523855248552585526855278552885529855308553185532855338553485535855368553785538855398554085541855428554385544855458554685547855488554985550855518555285553855548555585556855578555885559855608556185562855638556485565855668556785568855698557085571855728557385574855758557685577855788557985580855818558285583855848558585586855878558885589855908559185592855938559485595855968559785598855998560085601856028560385604856058560685607856088560985610856118561285613856148561585616856178561885619856208562185622856238562485625856268562785628856298563085631856328563385634856358563685637856388563985640856418564285643856448564585646856478564885649856508565185652856538565485655856568565785658856598566085661856628566385664856658566685667856688566985670856718567285673856748567585676856778567885679856808568185682856838568485685856868568785688856898569085691856928569385694856958569685697856988569985700857018570285703857048570585706857078570885709857108571185712857138571485715857168571785718857198572085721857228572385724857258572685727857288572985730857318573285733857348573585736857378573885739857408574185742857438574485745857468574785748857498575085751857528575385754857558575685757857588575985760857618576285763857648576585766857678576885769857708577185772857738577485775857768577785778857798578085781857828578385784857858578685787857888578985790857918579285793857948579585796857978579885799858008580185802858038580485805858068580785808858098581085811858128581385814858158581685817858188581985820858218582285823858248582585826858278582885829858308583185832858338583485835858368583785838858398584085841858428584385844858458584685847858488584985850858518585285853858548585585856858578585885859858608586185862858638586485865858668586785868858698587085871858728587385874858758587685877858788587985880858818588285883858848588585886858878588885889858908589185892858938589485895858968589785898858998590085901859028590385904859058590685907859088590985910859118591285913859148591585916859178591885919859208592185922859238592485925859268592785928859298593085931859328593385934859358593685937859388593985940859418594285943859448594585946859478594885949859508595185952859538595485955859568595785958859598596085961859628596385964859658596685967859688596985970859718597285973859748597585976859778597885979859808598185982859838598485985859868598785988859898599085991859928599385994859958599685997859988599986000860018600286003860048600586006860078600886009860108601186012860138601486015860168601786018860198602086021860228602386024860258602686027860288602986030860318603286033860348603586036860378603886039860408604186042860438604486045860468604786048860498605086051860528605386054860558605686057860588605986060860618606286063860648606586066860678606886069860708607186072860738607486075860768607786078860798608086081860828608386084860858608686087860888608986090860918609286093860948609586096860978609886099861008610186102861038610486105861068610786108861098611086111861128611386114861158611686117861188611986120861218612286123861248612586126861278612886129861308613186132861338613486135861368613786138861398614086141861428614386144861458614686147861488614986150861518615286153861548615586156861578615886159861608616186162861638616486165861668616786168861698617086171861728617386174861758617686177861788617986180861818618286183861848618586186861878618886189861908619186192861938619486195861968619786198861998620086201862028620386204862058620686207862088620986210862118621286213862148621586216862178621886219862208622186222862238622486225862268622786228862298623086231862328623386234862358623686237862388623986240862418624286243862448624586246862478624886249862508625186252862538625486255862568625786258862598626086261862628626386264862658626686267862688626986270862718627286273862748627586276862778627886279862808628186282862838628486285862868628786288862898629086291862928629386294862958629686297862988629986300863018630286303863048630586306863078630886309863108631186312863138631486315863168631786318863198632086321863228632386324863258632686327863288632986330863318633286333863348633586336863378633886339863408634186342863438634486345863468634786348863498635086351863528635386354863558635686357863588635986360863618636286363863648636586366863678636886369863708637186372863738637486375863768637786378863798638086381863828638386384863858638686387863888638986390863918639286393863948639586396863978639886399864008640186402864038640486405864068640786408864098641086411864128641386414864158641686417864188641986420864218642286423864248642586426864278642886429864308643186432864338643486435864368643786438864398644086441864428644386444864458644686447864488644986450864518645286453864548645586456864578645886459864608646186462864638646486465864668646786468864698647086471864728647386474864758647686477864788647986480864818648286483864848648586486864878648886489864908649186492864938649486495864968649786498864998650086501865028650386504865058650686507865088650986510865118651286513865148651586516865178651886519865208652186522865238652486525865268652786528865298653086531865328653386534865358653686537865388653986540865418654286543865448654586546865478654886549865508655186552865538655486555865568655786558865598656086561865628656386564865658656686567865688656986570865718657286573865748657586576865778657886579865808658186582865838658486585865868658786588865898659086591865928659386594865958659686597865988659986600866018660286603866048660586606866078660886609866108661186612866138661486615866168661786618866198662086621866228662386624866258662686627866288662986630866318663286633866348663586636866378663886639866408664186642866438664486645866468664786648866498665086651866528665386654866558665686657866588665986660866618666286663866648666586666866678666886669866708667186672866738667486675866768667786678866798668086681866828668386684866858668686687866888668986690866918669286693866948669586696866978669886699867008670186702867038670486705867068670786708867098671086711867128671386714867158671686717867188671986720867218672286723867248672586726867278672886729867308673186732867338673486735867368673786738867398674086741867428674386744867458674686747867488674986750867518675286753867548675586756867578675886759867608676186762867638676486765867668676786768867698677086771867728677386774867758677686777867788677986780867818678286783867848678586786867878678886789867908679186792867938679486795867968679786798867998680086801868028680386804868058680686807868088680986810868118681286813868148681586816868178681886819868208682186822868238682486825868268682786828868298683086831868328683386834868358683686837868388683986840868418684286843868448684586846868478684886849868508685186852868538685486855868568685786858868598686086861868628686386864868658686686867868688686986870868718687286873868748687586876868778687886879868808688186882868838688486885868868688786888868898689086891868928689386894868958689686897868988689986900869018690286903869048690586906869078690886909869108691186912869138691486915869168691786918869198692086921869228692386924869258692686927869288692986930869318693286933869348693586936869378693886939869408694186942869438694486945869468694786948869498695086951869528695386954869558695686957869588695986960869618696286963869648696586966869678696886969869708697186972869738697486975869768697786978869798698086981869828698386984869858698686987869888698986990869918699286993869948699586996869978699886999870008700187002870038700487005870068700787008870098701087011870128701387014870158701687017870188701987020870218702287023870248702587026870278702887029870308703187032870338703487035870368703787038870398704087041870428704387044870458704687047870488704987050870518705287053870548705587056870578705887059870608706187062870638706487065870668706787068870698707087071870728707387074870758707687077870788707987080870818708287083870848708587086870878708887089870908709187092870938709487095870968709787098870998710087101871028710387104871058710687107871088710987110871118711287113871148711587116871178711887119871208712187122871238712487125871268712787128871298713087131871328713387134871358713687137871388713987140871418714287143871448714587146871478714887149871508715187152871538715487155871568715787158871598716087161871628716387164871658716687167871688716987170871718717287173871748717587176871778717887179871808718187182871838718487185871868718787188871898719087191871928719387194871958719687197871988719987200872018720287203872048720587206872078720887209872108721187212872138721487215872168721787218872198722087221872228722387224872258722687227872288722987230872318723287233872348723587236872378723887239872408724187242872438724487245872468724787248872498725087251872528725387254872558725687257872588725987260872618726287263872648726587266872678726887269872708727187272872738727487275872768727787278872798728087281872828728387284872858728687287872888728987290872918729287293872948729587296872978729887299873008730187302873038730487305873068730787308873098731087311873128731387314873158731687317873188731987320873218732287323873248732587326873278732887329873308733187332873338733487335873368733787338873398734087341873428734387344873458734687347873488734987350873518735287353873548735587356873578735887359873608736187362873638736487365873668736787368873698737087371873728737387374873758737687377873788737987380873818738287383873848738587386873878738887389873908739187392873938739487395873968739787398873998740087401874028740387404874058740687407874088740987410874118741287413874148741587416874178741887419874208742187422874238742487425874268742787428874298743087431874328743387434874358743687437874388743987440874418744287443874448744587446874478744887449874508745187452874538745487455874568745787458874598746087461874628746387464874658746687467874688746987470874718747287473874748747587476874778747887479874808748187482874838748487485874868748787488874898749087491874928749387494874958749687497874988749987500875018750287503875048750587506875078750887509875108751187512875138751487515875168751787518875198752087521875228752387524875258752687527875288752987530875318753287533875348753587536875378753887539875408754187542875438754487545875468754787548875498755087551875528755387554875558755687557875588755987560875618756287563875648756587566875678756887569875708757187572875738757487575875768757787578875798758087581875828758387584875858758687587875888758987590875918759287593875948759587596875978759887599876008760187602876038760487605876068760787608876098761087611876128761387614876158761687617876188761987620876218762287623876248762587626876278762887629876308763187632876338763487635876368763787638876398764087641876428764387644876458764687647876488764987650876518765287653876548765587656876578765887659876608766187662876638766487665876668766787668876698767087671876728767387674876758767687677876788767987680876818768287683876848768587686876878768887689876908769187692876938769487695876968769787698876998770087701877028770387704877058770687707877088770987710877118771287713877148771587716877178771887719877208772187722877238772487725877268772787728877298773087731877328773387734877358773687737877388773987740877418774287743877448774587746877478774887749877508775187752877538775487755877568775787758877598776087761877628776387764877658776687767877688776987770877718777287773877748777587776877778777887779877808778187782877838778487785877868778787788877898779087791877928779387794877958779687797877988779987800878018780287803878048780587806878078780887809878108781187812878138781487815878168781787818878198782087821878228782387824878258782687827878288782987830878318783287833878348783587836878378783887839878408784187842878438784487845878468784787848878498785087851878528785387854878558785687857878588785987860878618786287863878648786587866878678786887869878708787187872878738787487875878768787787878878798788087881878828788387884878858788687887878888788987890878918789287893878948789587896878978789887899879008790187902879038790487905879068790787908879098791087911879128791387914879158791687917879188791987920879218792287923879248792587926879278792887929879308793187932879338793487935879368793787938879398794087941879428794387944879458794687947879488794987950879518795287953879548795587956879578795887959879608796187962879638796487965879668796787968879698797087971879728797387974879758797687977879788797987980879818798287983879848798587986879878798887989879908799187992879938799487995879968799787998879998800088001880028800388004880058800688007880088800988010880118801288013880148801588016880178801888019880208802188022880238802488025880268802788028880298803088031880328803388034880358803688037880388803988040880418804288043880448804588046880478804888049880508805188052880538805488055880568805788058880598806088061880628806388064880658806688067880688806988070880718807288073880748807588076880778807888079880808808188082880838808488085880868808788088880898809088091880928809388094880958809688097880988809988100881018810288103881048810588106881078810888109881108811188112881138811488115881168811788118881198812088121881228812388124881258812688127881288812988130881318813288133881348813588136881378813888139881408814188142881438814488145881468814788148881498815088151881528815388154881558815688157881588815988160881618816288163881648816588166881678816888169881708817188172881738817488175881768817788178881798818088181881828818388184881858818688187881888818988190881918819288193881948819588196881978819888199882008820188202882038820488205882068820788208882098821088211882128821388214882158821688217882188821988220882218822288223882248822588226882278822888229882308823188232882338823488235882368823788238882398824088241882428824388244882458824688247882488824988250882518825288253882548825588256882578825888259882608826188262882638826488265882668826788268882698827088271882728827388274882758827688277882788827988280882818828288283882848828588286882878828888289882908829188292882938829488295882968829788298882998830088301883028830388304883058830688307883088830988310883118831288313883148831588316883178831888319883208832188322883238832488325883268832788328883298833088331883328833388334883358833688337883388833988340883418834288343883448834588346883478834888349883508835188352883538835488355883568835788358883598836088361883628836388364883658836688367883688836988370883718837288373883748837588376883778837888379883808838188382883838838488385883868838788388883898839088391883928839388394883958839688397883988839988400884018840288403884048840588406884078840888409884108841188412884138841488415884168841788418884198842088421884228842388424884258842688427884288842988430884318843288433884348843588436884378843888439884408844188442884438844488445884468844788448884498845088451884528845388454884558845688457884588845988460884618846288463884648846588466884678846888469884708847188472884738847488475884768847788478884798848088481884828848388484884858848688487884888848988490884918849288493884948849588496884978849888499885008850188502885038850488505885068850788508885098851088511885128851388514885158851688517885188851988520885218852288523885248852588526885278852888529885308853188532885338853488535885368853788538885398854088541885428854388544885458854688547885488854988550885518855288553885548855588556885578855888559885608856188562885638856488565885668856788568885698857088571885728857388574885758857688577885788857988580885818858288583885848858588586885878858888589885908859188592885938859488595885968859788598885998860088601886028860388604886058860688607886088860988610886118861288613886148861588616886178861888619886208862188622886238862488625886268862788628886298863088631886328863388634886358863688637886388863988640886418864288643886448864588646886478864888649886508865188652886538865488655886568865788658886598866088661886628866388664886658866688667886688866988670886718867288673886748867588676886778867888679886808868188682886838868488685886868868788688886898869088691886928869388694886958869688697886988869988700887018870288703887048870588706887078870888709887108871188712887138871488715887168871788718887198872088721887228872388724887258872688727887288872988730887318873288733887348873588736887378873888739887408874188742887438874488745887468874788748887498875088751887528875388754887558875688757887588875988760887618876288763887648876588766887678876888769887708877188772887738877488775887768877788778887798878088781887828878388784887858878688787887888878988790887918879288793887948879588796887978879888799888008880188802888038880488805888068880788808888098881088811888128881388814888158881688817888188881988820888218882288823888248882588826888278882888829888308883188832888338883488835888368883788838888398884088841888428884388844888458884688847888488884988850888518885288853888548885588856888578885888859888608886188862888638886488865888668886788868888698887088871888728887388874888758887688877888788887988880888818888288883888848888588886888878888888889888908889188892888938889488895888968889788898888998890088901889028890388904889058890688907889088890988910889118891288913889148891588916889178891888919889208892188922889238892488925889268892788928889298893088931889328893388934889358893688937889388893988940889418894288943889448894588946889478894888949889508895188952889538895488955889568895788958889598896088961889628896388964889658896688967889688896988970889718897288973889748897588976889778897888979889808898188982889838898488985889868898788988889898899088991889928899388994889958899688997889988899989000890018900289003890048900589006890078900889009890108901189012890138901489015890168901789018890198902089021890228902389024890258902689027890288902989030890318903289033890348903589036890378903889039890408904189042890438904489045890468904789048890498905089051890528905389054890558905689057890588905989060890618906289063890648906589066890678906889069890708907189072890738907489075890768907789078890798908089081890828908389084890858908689087890888908989090890918909289093890948909589096890978909889099891008910189102891038910489105891068910789108891098911089111891128911389114891158911689117891188911989120891218912289123891248912589126891278912889129891308913189132891338913489135891368913789138891398914089141891428914389144891458914689147891488914989150891518915289153891548915589156891578915889159891608916189162891638916489165891668916789168891698917089171891728917389174891758917689177891788917989180891818918289183891848918589186891878918889189891908919189192891938919489195891968919789198891998920089201892028920389204892058920689207892088920989210892118921289213892148921589216892178921889219892208922189222892238922489225892268922789228892298923089231892328923389234892358923689237892388923989240892418924289243892448924589246892478924889249892508925189252892538925489255892568925789258892598926089261892628926389264892658926689267892688926989270892718927289273892748927589276892778927889279892808928189282892838928489285892868928789288892898929089291892928929389294892958929689297892988929989300893018930289303893048930589306893078930889309893108931189312893138931489315893168931789318893198932089321893228932389324893258932689327893288932989330893318933289333893348933589336893378933889339893408934189342893438934489345893468934789348893498935089351893528935389354893558935689357893588935989360893618936289363893648936589366893678936889369893708937189372893738937489375893768937789378893798938089381893828938389384893858938689387893888938989390893918939289393893948939589396893978939889399894008940189402894038940489405894068940789408894098941089411894128941389414894158941689417894188941989420894218942289423894248942589426894278942889429894308943189432894338943489435894368943789438894398944089441894428944389444894458944689447894488944989450894518945289453894548945589456894578945889459894608946189462894638946489465894668946789468894698947089471894728947389474894758947689477894788947989480894818948289483894848948589486894878948889489894908949189492894938949489495894968949789498894998950089501895028950389504895058950689507895088950989510895118951289513895148951589516895178951889519895208952189522895238952489525895268952789528895298953089531895328953389534895358953689537895388953989540895418954289543895448954589546895478954889549895508955189552895538955489555895568955789558895598956089561895628956389564895658956689567895688956989570895718957289573895748957589576895778957889579895808958189582895838958489585895868958789588895898959089591895928959389594895958959689597895988959989600896018960289603896048960589606896078960889609896108961189612896138961489615896168961789618896198962089621896228962389624896258962689627896288962989630896318963289633896348963589636896378963889639896408964189642896438964489645896468964789648896498965089651896528965389654896558965689657896588965989660896618966289663896648966589666896678966889669896708967189672896738967489675896768967789678896798968089681896828968389684896858968689687896888968989690896918969289693896948969589696896978969889699897008970189702897038970489705897068970789708897098971089711897128971389714897158971689717897188971989720897218972289723897248972589726897278972889729897308973189732897338973489735897368973789738897398974089741897428974389744897458974689747897488974989750897518975289753897548975589756897578975889759897608976189762897638976489765897668976789768897698977089771897728977389774897758977689777897788977989780897818978289783897848978589786897878978889789897908979189792897938979489795897968979789798897998980089801898028980389804898058980689807898088980989810898118981289813898148981589816898178981889819898208982189822898238982489825898268982789828898298983089831898328983389834898358983689837898388983989840898418984289843898448984589846898478984889849898508985189852898538985489855898568985789858898598986089861898628986389864898658986689867898688986989870898718987289873898748987589876898778987889879898808988189882898838988489885898868988789888898898989089891898928989389894898958989689897898988989989900899018990289903899048990589906899078990889909899108991189912899138991489915899168991789918899198992089921899228992389924899258992689927899288992989930899318993289933899348993589936899378993889939899408994189942899438994489945899468994789948899498995089951899528995389954899558995689957899588995989960899618996289963899648996589966899678996889969899708997189972899738997489975899768997789978899798998089981899828998389984899858998689987899888998989990899918999289993899948999589996899978999889999900009000190002900039000490005900069000790008900099001090011900129001390014900159001690017900189001990020900219002290023900249002590026900279002890029900309003190032900339003490035900369003790038900399004090041900429004390044900459004690047900489004990050900519005290053900549005590056900579005890059900609006190062900639006490065900669006790068900699007090071900729007390074900759007690077900789007990080900819008290083900849008590086900879008890089900909009190092900939009490095900969009790098900999010090101901029010390104901059010690107901089010990110901119011290113901149011590116901179011890119901209012190122901239012490125901269012790128901299013090131901329013390134901359013690137901389013990140901419014290143901449014590146901479014890149901509015190152901539015490155901569015790158901599016090161901629016390164901659016690167901689016990170901719017290173901749017590176901779017890179901809018190182901839018490185901869018790188901899019090191901929019390194901959019690197901989019990200902019020290203902049020590206902079020890209902109021190212902139021490215902169021790218902199022090221902229022390224902259022690227902289022990230902319023290233902349023590236902379023890239902409024190242902439024490245902469024790248902499025090251902529025390254902559025690257902589025990260902619026290263902649026590266902679026890269902709027190272902739027490275902769027790278902799028090281902829028390284902859028690287902889028990290902919029290293902949029590296902979029890299903009030190302903039030490305903069030790308903099031090311903129031390314903159031690317903189031990320903219032290323903249032590326903279032890329903309033190332903339033490335903369033790338903399034090341903429034390344903459034690347903489034990350903519035290353903549035590356903579035890359903609036190362903639036490365903669036790368903699037090371903729037390374903759037690377903789037990380903819038290383903849038590386903879038890389903909039190392903939039490395903969039790398903999040090401904029040390404904059040690407904089040990410904119041290413904149041590416904179041890419904209042190422904239042490425904269042790428904299043090431904329043390434904359043690437904389043990440904419044290443904449044590446904479044890449904509045190452904539045490455904569045790458904599046090461904629046390464904659046690467904689046990470904719047290473904749047590476904779047890479904809048190482904839048490485904869048790488904899049090491904929049390494904959049690497904989049990500905019050290503905049050590506905079050890509905109051190512905139051490515905169051790518905199052090521905229052390524905259052690527905289052990530905319053290533905349053590536905379053890539905409054190542905439054490545905469054790548905499055090551905529055390554905559055690557905589055990560905619056290563905649056590566905679056890569905709057190572905739057490575905769057790578905799058090581905829058390584905859058690587905889058990590905919059290593905949059590596905979059890599906009060190602906039060490605906069060790608906099061090611906129061390614906159061690617906189061990620906219062290623906249062590626906279062890629906309063190632906339063490635906369063790638906399064090641906429064390644906459064690647906489064990650906519065290653906549065590656906579065890659906609066190662906639066490665906669066790668906699067090671906729067390674906759067690677906789067990680906819068290683906849068590686906879068890689906909069190692906939069490695906969069790698906999070090701907029070390704907059070690707907089070990710907119071290713907149071590716907179071890719907209072190722907239072490725907269072790728907299073090731907329073390734907359073690737907389073990740907419074290743907449074590746907479074890749907509075190752907539075490755907569075790758907599076090761907629076390764907659076690767907689076990770907719077290773907749077590776907779077890779907809078190782907839078490785907869078790788907899079090791907929079390794907959079690797907989079990800908019080290803908049080590806908079080890809908109081190812908139081490815908169081790818908199082090821908229082390824908259082690827908289082990830908319083290833908349083590836908379083890839908409084190842908439084490845908469084790848908499085090851908529085390854908559085690857908589085990860908619086290863908649086590866908679086890869908709087190872908739087490875908769087790878908799088090881908829088390884908859088690887908889088990890908919089290893908949089590896908979089890899909009090190902909039090490905909069090790908909099091090911909129091390914909159091690917909189091990920909219092290923909249092590926909279092890929909309093190932909339093490935909369093790938909399094090941909429094390944909459094690947909489094990950909519095290953909549095590956909579095890959909609096190962909639096490965909669096790968909699097090971909729097390974909759097690977909789097990980909819098290983909849098590986909879098890989909909099190992909939099490995909969099790998909999100091001910029100391004910059100691007910089100991010910119101291013910149101591016910179101891019910209102191022910239102491025910269102791028910299103091031910329103391034910359103691037910389103991040910419104291043910449104591046910479104891049910509105191052910539105491055910569105791058910599106091061910629106391064910659106691067910689106991070910719107291073910749107591076910779107891079910809108191082910839108491085910869108791088910899109091091910929109391094910959109691097910989109991100911019110291103911049110591106911079110891109911109111191112911139111491115911169111791118911199112091121911229112391124911259112691127911289112991130911319113291133911349113591136911379113891139911409114191142911439114491145911469114791148911499115091151911529115391154911559115691157911589115991160911619116291163911649116591166911679116891169911709117191172911739117491175911769117791178911799118091181911829118391184911859118691187911889118991190911919119291193911949119591196911979119891199912009120191202912039120491205912069120791208912099121091211912129121391214912159121691217912189121991220912219122291223912249122591226912279122891229912309123191232912339123491235912369123791238912399124091241912429124391244912459124691247912489124991250912519125291253912549125591256912579125891259912609126191262912639126491265912669126791268912699127091271912729127391274912759127691277912789127991280912819128291283912849128591286912879128891289912909129191292912939129491295912969129791298912999130091301913029130391304913059130691307913089130991310913119131291313913149131591316913179131891319913209132191322913239132491325913269132791328913299133091331913329133391334913359133691337913389133991340913419134291343913449134591346913479134891349913509135191352913539135491355913569135791358913599136091361913629136391364913659136691367913689136991370913719137291373913749137591376913779137891379913809138191382913839138491385913869138791388913899139091391913929139391394913959139691397913989139991400914019140291403914049140591406914079140891409914109141191412914139141491415914169141791418914199142091421914229142391424914259142691427914289142991430914319143291433914349143591436914379143891439914409144191442914439144491445914469144791448914499145091451914529145391454914559145691457914589145991460914619146291463914649146591466914679146891469914709147191472914739147491475914769147791478914799148091481914829148391484914859148691487914889148991490914919149291493914949149591496914979149891499915009150191502915039150491505915069150791508915099151091511915129151391514915159151691517915189151991520915219152291523915249152591526915279152891529915309153191532915339153491535915369153791538915399154091541915429154391544915459154691547915489154991550915519155291553915549155591556915579155891559915609156191562915639156491565915669156791568915699157091571915729157391574915759157691577915789157991580915819158291583915849158591586915879158891589915909159191592915939159491595915969159791598915999160091601916029160391604916059160691607916089160991610916119161291613916149161591616916179161891619916209162191622916239162491625916269162791628916299163091631916329163391634916359163691637916389163991640916419164291643916449164591646916479164891649916509165191652916539165491655916569165791658916599166091661916629166391664916659166691667916689166991670916719167291673916749167591676916779167891679916809168191682916839168491685916869168791688916899169091691916929169391694916959169691697916989169991700917019170291703917049170591706917079170891709917109171191712917139171491715917169171791718917199172091721917229172391724917259172691727917289172991730917319173291733917349173591736917379173891739917409174191742917439174491745917469174791748917499175091751917529175391754917559175691757917589175991760917619176291763917649176591766917679176891769917709177191772917739177491775917769177791778917799178091781917829178391784917859178691787917889178991790917919179291793917949179591796917979179891799918009180191802918039180491805918069180791808918099181091811918129181391814918159181691817918189181991820918219182291823918249182591826918279182891829918309183191832918339183491835918369183791838918399184091841918429184391844918459184691847918489184991850918519185291853918549185591856918579185891859918609186191862918639186491865918669186791868918699187091871918729187391874918759187691877918789187991880918819188291883918849188591886918879188891889918909189191892918939189491895918969189791898918999190091901919029190391904919059190691907919089190991910919119191291913919149191591916919179191891919919209192191922919239192491925919269192791928919299193091931919329193391934919359193691937919389193991940919419194291943919449194591946919479194891949919509195191952919539195491955919569195791958919599196091961919629196391964919659196691967919689196991970919719197291973919749197591976919779197891979919809198191982919839198491985919869198791988919899199091991919929199391994919959199691997919989199992000920019200292003920049200592006920079200892009920109201192012920139201492015920169201792018920199202092021920229202392024920259202692027920289202992030920319203292033920349203592036920379203892039920409204192042920439204492045920469204792048920499205092051920529205392054920559205692057920589205992060920619206292063920649206592066920679206892069920709207192072920739207492075920769207792078920799208092081920829208392084920859208692087920889208992090920919209292093920949209592096920979209892099921009210192102921039210492105921069210792108921099211092111921129211392114921159211692117921189211992120921219212292123921249212592126921279212892129921309213192132921339213492135921369213792138921399214092141921429214392144921459214692147921489214992150921519215292153921549215592156921579215892159921609216192162921639216492165921669216792168921699217092171921729217392174921759217692177921789217992180921819218292183921849218592186921879218892189921909219192192921939219492195921969219792198921999220092201922029220392204922059220692207922089220992210922119221292213922149221592216922179221892219922209222192222922239222492225922269222792228922299223092231922329223392234922359223692237922389223992240922419224292243922449224592246922479224892249922509225192252922539225492255922569225792258922599226092261922629226392264922659226692267922689226992270922719227292273922749227592276922779227892279922809228192282922839228492285922869228792288922899229092291922929229392294922959229692297922989229992300923019230292303923049230592306923079230892309923109231192312923139231492315923169231792318923199232092321923229232392324923259232692327923289232992330923319233292333923349233592336923379233892339923409234192342923439234492345923469234792348923499235092351923529235392354923559235692357923589235992360923619236292363923649236592366923679236892369923709237192372923739237492375923769237792378923799238092381923829238392384923859238692387923889238992390923919239292393923949239592396923979239892399924009240192402924039240492405924069240792408924099241092411924129241392414924159241692417924189241992420924219242292423924249242592426924279242892429924309243192432924339243492435924369243792438924399244092441924429244392444924459244692447924489244992450924519245292453924549245592456924579245892459924609246192462924639246492465924669246792468924699247092471924729247392474924759247692477924789247992480924819248292483924849248592486924879248892489924909249192492924939249492495924969249792498924999250092501925029250392504925059250692507925089250992510925119251292513925149251592516925179251892519925209252192522925239252492525925269252792528925299253092531925329253392534925359253692537925389253992540925419254292543925449254592546925479254892549925509255192552925539255492555925569255792558925599256092561925629256392564925659256692567925689256992570925719257292573925749257592576925779257892579925809258192582925839258492585925869258792588925899259092591925929259392594925959259692597925989259992600926019260292603926049260592606926079260892609926109261192612926139261492615926169261792618926199262092621926229262392624926259262692627926289262992630926319263292633926349263592636926379263892639926409264192642926439264492645926469264792648926499265092651926529265392654926559265692657926589265992660926619266292663926649266592666926679266892669926709267192672926739267492675926769267792678926799268092681926829268392684926859268692687926889268992690926919269292693926949269592696926979269892699927009270192702927039270492705927069270792708927099271092711927129271392714927159271692717927189271992720927219272292723927249272592726927279272892729927309273192732927339273492735927369273792738927399274092741927429274392744927459274692747927489274992750927519275292753927549275592756927579275892759927609276192762927639276492765927669276792768927699277092771927729277392774927759277692777927789277992780927819278292783927849278592786927879278892789927909279192792927939279492795927969279792798927999280092801928029280392804928059280692807928089280992810928119281292813928149281592816928179281892819928209282192822928239282492825928269282792828928299283092831928329283392834928359283692837928389283992840928419284292843928449284592846928479284892849928509285192852928539285492855928569285792858928599286092861928629286392864928659286692867928689286992870928719287292873928749287592876928779287892879928809288192882928839288492885928869288792888928899289092891928929289392894928959289692897928989289992900929019290292903929049290592906929079290892909929109291192912929139291492915929169291792918929199292092921929229292392924929259292692927929289292992930929319293292933929349293592936929379293892939929409294192942929439294492945929469294792948929499295092951929529295392954929559295692957929589295992960929619296292963929649296592966929679296892969929709297192972929739297492975929769297792978929799298092981929829298392984929859298692987929889298992990929919299292993929949299592996929979299892999930009300193002930039300493005930069300793008930099301093011930129301393014930159301693017930189301993020930219302293023930249302593026930279302893029930309303193032930339303493035930369303793038930399304093041930429304393044930459304693047930489304993050930519305293053930549305593056930579305893059930609306193062930639306493065930669306793068930699307093071930729307393074930759307693077930789307993080930819308293083930849308593086930879308893089930909309193092930939309493095930969309793098930999310093101931029310393104931059310693107931089310993110931119311293113931149311593116931179311893119931209312193122931239312493125931269312793128931299313093131931329313393134931359313693137931389313993140931419314293143931449314593146931479314893149931509315193152931539315493155931569315793158931599316093161931629316393164931659316693167931689316993170931719317293173931749317593176931779317893179931809318193182931839318493185931869318793188931899319093191931929319393194931959319693197931989319993200932019320293203932049320593206932079320893209932109321193212932139321493215932169321793218932199322093221932229322393224932259322693227932289322993230932319323293233932349323593236932379323893239932409324193242932439324493245932469324793248932499325093251932529325393254932559325693257932589325993260932619326293263932649326593266932679326893269932709327193272932739327493275932769327793278932799328093281932829328393284932859328693287932889328993290932919329293293932949329593296932979329893299933009330193302933039330493305933069330793308933099331093311933129331393314933159331693317933189331993320933219332293323933249332593326933279332893329933309333193332933339333493335933369333793338933399334093341933429334393344933459334693347933489334993350933519335293353933549335593356933579335893359933609336193362933639336493365933669336793368933699337093371933729337393374933759337693377933789337993380933819338293383933849338593386933879338893389933909339193392933939339493395933969339793398933999340093401934029340393404934059340693407934089340993410934119341293413934149341593416934179341893419934209342193422934239342493425934269342793428934299343093431934329343393434934359343693437934389343993440934419344293443934449344593446934479344893449934509345193452934539345493455934569345793458934599346093461934629346393464934659346693467934689346993470934719347293473934749347593476934779347893479934809348193482934839348493485934869348793488934899349093491934929349393494934959349693497934989349993500935019350293503935049350593506935079350893509935109351193512935139351493515935169351793518935199352093521935229352393524935259352693527935289352993530935319353293533935349353593536935379353893539935409354193542935439354493545935469354793548935499355093551935529355393554935559355693557935589355993560935619356293563935649356593566935679356893569935709357193572935739357493575935769357793578935799358093581935829358393584935859358693587935889358993590935919359293593935949359593596935979359893599936009360193602936039360493605936069360793608936099361093611936129361393614936159361693617936189361993620936219362293623936249362593626936279362893629936309363193632936339363493635936369363793638936399364093641936429364393644936459364693647936489364993650936519365293653936549365593656936579365893659936609366193662936639366493665936669366793668936699367093671936729367393674936759367693677936789367993680936819368293683936849368593686936879368893689936909369193692936939369493695936969369793698936999370093701937029370393704937059370693707937089370993710937119371293713937149371593716937179371893719937209372193722937239372493725937269372793728937299373093731937329373393734937359373693737937389373993740937419374293743937449374593746937479374893749937509375193752937539375493755937569375793758937599376093761937629376393764937659376693767937689376993770937719377293773937749377593776937779377893779937809378193782937839378493785937869378793788937899379093791937929379393794937959379693797937989379993800938019380293803938049380593806938079380893809938109381193812938139381493815938169381793818938199382093821938229382393824938259382693827938289382993830938319383293833938349383593836938379383893839938409384193842938439384493845938469384793848938499385093851938529385393854938559385693857938589385993860938619386293863938649386593866938679386893869938709387193872938739387493875938769387793878938799388093881938829388393884938859388693887938889388993890938919389293893938949389593896938979389893899939009390193902939039390493905939069390793908939099391093911939129391393914939159391693917939189391993920939219392293923939249392593926939279392893929939309393193932939339393493935939369393793938939399394093941939429394393944939459394693947939489394993950939519395293953939549395593956939579395893959939609396193962939639396493965939669396793968939699397093971939729397393974939759397693977939789397993980939819398293983939849398593986939879398893989939909399193992939939399493995939969399793998939999400094001940029400394004940059400694007940089400994010940119401294013940149401594016940179401894019940209402194022940239402494025940269402794028940299403094031940329403394034940359403694037940389403994040940419404294043940449404594046940479404894049940509405194052940539405494055940569405794058940599406094061940629406394064940659406694067940689406994070940719407294073940749407594076940779407894079940809408194082940839408494085940869408794088940899409094091940929409394094940959409694097940989409994100941019410294103941049410594106941079410894109941109411194112941139411494115941169411794118941199412094121941229412394124941259412694127941289412994130941319413294133941349413594136941379413894139941409414194142941439414494145941469414794148941499415094151941529415394154941559415694157941589415994160941619416294163941649416594166941679416894169941709417194172941739417494175941769417794178941799418094181941829418394184941859418694187941889418994190941919419294193941949419594196941979419894199942009420194202942039420494205942069420794208942099421094211942129421394214942159421694217942189421994220942219422294223942249422594226942279422894229942309423194232942339423494235942369423794238942399424094241942429424394244942459424694247942489424994250942519425294253942549425594256942579425894259942609426194262942639426494265942669426794268942699427094271942729427394274942759427694277942789427994280942819428294283942849428594286942879428894289942909429194292942939429494295942969429794298942999430094301943029430394304943059430694307943089430994310943119431294313943149431594316943179431894319943209432194322943239432494325943269432794328943299433094331943329433394334943359433694337943389433994340943419434294343943449434594346943479434894349943509435194352943539435494355943569435794358943599436094361943629436394364943659436694367943689436994370943719437294373943749437594376943779437894379943809438194382943839438494385943869438794388943899439094391943929439394394943959439694397943989439994400944019440294403944049440594406944079440894409944109441194412944139441494415944169441794418944199442094421944229442394424944259442694427944289442994430944319443294433944349443594436944379443894439944409444194442944439444494445944469444794448944499445094451944529445394454944559445694457944589445994460944619446294463944649446594466944679446894469944709447194472944739447494475944769447794478944799448094481944829448394484944859448694487944889448994490944919449294493944949449594496944979449894499945009450194502945039450494505945069450794508945099451094511945129451394514945159451694517945189451994520945219452294523945249452594526945279452894529945309453194532945339453494535945369453794538945399454094541945429454394544945459454694547945489454994550945519455294553945549455594556945579455894559945609456194562945639456494565945669456794568945699457094571945729457394574945759457694577945789457994580945819458294583945849458594586945879458894589945909459194592945939459494595945969459794598945999460094601946029460394604946059460694607946089460994610946119461294613946149461594616946179461894619946209462194622946239462494625946269462794628946299463094631946329463394634946359463694637946389463994640946419464294643946449464594646946479464894649946509465194652946539465494655946569465794658946599466094661946629466394664946659466694667946689466994670946719467294673946749467594676946779467894679946809468194682946839468494685946869468794688946899469094691946929469394694946959469694697946989469994700947019470294703947049470594706947079470894709947109471194712947139471494715947169471794718947199472094721947229472394724947259472694727947289472994730947319473294733947349473594736947379473894739947409474194742947439474494745947469474794748947499475094751947529475394754947559475694757947589475994760947619476294763947649476594766947679476894769947709477194772947739477494775947769477794778947799478094781947829478394784947859478694787947889478994790947919479294793947949479594796947979479894799948009480194802948039480494805948069480794808948099481094811948129481394814948159481694817948189481994820948219482294823948249482594826948279482894829948309483194832948339483494835948369483794838948399484094841948429484394844948459484694847948489484994850948519485294853948549485594856948579485894859948609486194862948639486494865948669486794868948699487094871948729487394874948759487694877948789487994880948819488294883948849488594886948879488894889948909489194892948939489494895948969489794898948999490094901949029490394904949059490694907949089490994910949119491294913949149491594916949179491894919949209492194922949239492494925949269492794928949299493094931949329493394934949359493694937949389493994940949419494294943949449494594946949479494894949949509495194952949539495494955949569495794958949599496094961949629496394964949659496694967949689496994970949719497294973949749497594976949779497894979949809498194982949839498494985949869498794988949899499094991949929499394994949959499694997949989499995000950019500295003950049500595006950079500895009950109501195012950139501495015950169501795018950199502095021950229502395024950259502695027950289502995030950319503295033950349503595036950379503895039950409504195042950439504495045950469504795048950499505095051950529505395054950559505695057950589505995060950619506295063950649506595066950679506895069950709507195072950739507495075950769507795078950799508095081950829508395084950859508695087950889508995090950919509295093950949509595096950979509895099951009510195102951039510495105951069510795108951099511095111951129511395114951159511695117951189511995120951219512295123951249512595126951279512895129951309513195132951339513495135951369513795138951399514095141951429514395144951459514695147951489514995150951519515295153951549515595156951579515895159951609516195162951639516495165951669516795168951699517095171951729517395174951759517695177951789517995180951819518295183951849518595186951879518895189951909519195192951939519495195951969519795198951999520095201952029520395204952059520695207952089520995210952119521295213952149521595216952179521895219952209522195222952239522495225952269522795228952299523095231952329523395234952359523695237952389523995240952419524295243952449524595246952479524895249952509525195252952539525495255952569525795258952599526095261952629526395264952659526695267952689526995270952719527295273952749527595276952779527895279952809528195282952839528495285952869528795288952899529095291952929529395294952959529695297952989529995300953019530295303953049530595306953079530895309953109531195312953139531495315953169531795318953199532095321953229532395324953259532695327953289532995330953319533295333953349533595336953379533895339953409534195342953439534495345953469534795348953499535095351953529535395354953559535695357953589535995360953619536295363953649536595366953679536895369953709537195372953739537495375953769537795378953799538095381953829538395384953859538695387953889538995390953919539295393953949539595396953979539895399954009540195402954039540495405954069540795408954099541095411954129541395414954159541695417954189541995420954219542295423954249542595426954279542895429954309543195432954339543495435954369543795438954399544095441954429544395444954459544695447954489544995450954519545295453954549545595456954579545895459954609546195462954639546495465954669546795468954699547095471954729547395474954759547695477954789547995480954819548295483954849548595486954879548895489954909549195492954939549495495954969549795498954999550095501955029550395504955059550695507955089550995510955119551295513955149551595516955179551895519955209552195522955239552495525955269552795528955299553095531955329553395534955359553695537955389553995540955419554295543955449554595546955479554895549955509555195552955539555495555955569555795558955599556095561955629556395564955659556695567955689556995570955719557295573955749557595576955779557895579955809558195582955839558495585955869558795588955899559095591955929559395594955959559695597955989559995600956019560295603956049560595606956079560895609956109561195612956139561495615956169561795618956199562095621956229562395624956259562695627956289562995630956319563295633956349563595636956379563895639956409564195642956439564495645956469564795648956499565095651956529565395654956559565695657956589565995660956619566295663956649566595666956679566895669956709567195672956739567495675956769567795678956799568095681956829568395684956859568695687956889568995690956919569295693956949569595696956979569895699957009570195702957039570495705957069570795708957099571095711957129571395714957159571695717957189571995720957219572295723957249572595726957279572895729957309573195732957339573495735957369573795738957399574095741957429574395744957459574695747957489574995750957519575295753957549575595756957579575895759957609576195762957639576495765957669576795768957699577095771957729577395774957759577695777957789577995780957819578295783957849578595786957879578895789957909579195792957939579495795957969579795798957999580095801958029580395804958059580695807958089580995810958119581295813958149581595816958179581895819958209582195822958239582495825958269582795828958299583095831958329583395834958359583695837958389583995840958419584295843958449584595846958479584895849958509585195852958539585495855958569585795858958599586095861958629586395864958659586695867958689586995870958719587295873958749587595876958779587895879958809588195882958839588495885958869588795888958899589095891958929589395894958959589695897958989589995900959019590295903959049590595906959079590895909959109591195912959139591495915959169591795918959199592095921959229592395924959259592695927959289592995930959319593295933959349593595936959379593895939959409594195942959439594495945959469594795948959499595095951959529595395954959559595695957959589595995960959619596295963959649596595966959679596895969959709597195972959739597495975959769597795978959799598095981959829598395984959859598695987959889598995990959919599295993959949599595996959979599895999960009600196002960039600496005960069600796008960099601096011960129601396014960159601696017960189601996020960219602296023960249602596026960279602896029960309603196032960339603496035960369603796038960399604096041960429604396044960459604696047960489604996050960519605296053960549605596056960579605896059960609606196062960639606496065960669606796068960699607096071960729607396074960759607696077960789607996080960819608296083960849608596086960879608896089960909609196092960939609496095960969609796098960999610096101961029610396104961059610696107961089610996110961119611296113961149611596116961179611896119961209612196122961239612496125961269612796128961299613096131961329613396134961359613696137961389613996140961419614296143961449614596146961479614896149961509615196152961539615496155961569615796158961599616096161961629616396164961659616696167961689616996170961719617296173961749617596176961779617896179961809618196182961839618496185961869618796188961899619096191961929619396194961959619696197961989619996200962019620296203962049620596206962079620896209962109621196212962139621496215962169621796218962199622096221962229622396224962259622696227962289622996230962319623296233962349623596236962379623896239962409624196242962439624496245962469624796248962499625096251962529625396254962559625696257962589625996260962619626296263962649626596266962679626896269962709627196272962739627496275962769627796278962799628096281962829628396284962859628696287962889628996290962919629296293962949629596296962979629896299963009630196302963039630496305963069630796308963099631096311963129631396314963159631696317963189631996320963219632296323963249632596326963279632896329963309633196332963339633496335963369633796338963399634096341963429634396344963459634696347963489634996350963519635296353963549635596356963579635896359963609636196362963639636496365963669636796368963699637096371963729637396374963759637696377963789637996380963819638296383963849638596386963879638896389963909639196392963939639496395963969639796398963999640096401964029640396404964059640696407964089640996410964119641296413964149641596416964179641896419964209642196422964239642496425964269642796428964299643096431964329643396434964359643696437964389643996440964419644296443964449644596446964479644896449964509645196452964539645496455964569645796458964599646096461964629646396464964659646696467964689646996470964719647296473964749647596476964779647896479964809648196482964839648496485964869648796488964899649096491964929649396494964959649696497964989649996500965019650296503965049650596506965079650896509965109651196512965139651496515965169651796518965199652096521965229652396524965259652696527965289652996530965319653296533965349653596536965379653896539965409654196542965439654496545965469654796548965499655096551965529655396554965559655696557965589655996560965619656296563965649656596566965679656896569965709657196572965739657496575965769657796578965799658096581965829658396584965859658696587965889658996590965919659296593965949659596596965979659896599966009660196602966039660496605966069660796608966099661096611966129661396614966159661696617966189661996620966219662296623966249662596626966279662896629966309663196632966339663496635966369663796638966399664096641966429664396644966459664696647966489664996650966519665296653966549665596656966579665896659966609666196662966639666496665966669666796668966699667096671966729667396674966759667696677966789667996680966819668296683966849668596686966879668896689966909669196692966939669496695966969669796698966999670096701967029670396704967059670696707967089670996710967119671296713967149671596716967179671896719967209672196722967239672496725967269672796728967299673096731967329673396734967359673696737967389673996740967419674296743967449674596746967479674896749967509675196752967539675496755967569675796758967599676096761967629676396764967659676696767967689676996770967719677296773967749677596776967779677896779967809678196782967839678496785967869678796788967899679096791967929679396794967959679696797967989679996800968019680296803968049680596806968079680896809968109681196812968139681496815968169681796818968199682096821968229682396824968259682696827968289682996830968319683296833968349683596836968379683896839968409684196842968439684496845968469684796848968499685096851968529685396854968559685696857968589685996860968619686296863968649686596866968679686896869968709687196872968739687496875968769687796878968799688096881968829688396884968859688696887968889688996890968919689296893968949689596896968979689896899969009690196902969039690496905969069690796908969099691096911969129691396914969159691696917969189691996920969219692296923969249692596926969279692896929969309693196932969339693496935969369693796938969399694096941969429694396944969459694696947969489694996950969519695296953969549695596956969579695896959969609696196962969639696496965969669696796968969699697096971969729697396974969759697696977969789697996980969819698296983969849698596986969879698896989969909699196992969939699496995969969699796998969999700097001970029700397004970059700697007970089700997010970119701297013970149701597016970179701897019970209702197022970239702497025970269702797028970299703097031970329703397034970359703697037970389703997040970419704297043970449704597046970479704897049970509705197052970539705497055970569705797058970599706097061970629706397064970659706697067970689706997070970719707297073970749707597076970779707897079970809708197082970839708497085970869708797088970899709097091970929709397094970959709697097970989709997100971019710297103971049710597106971079710897109971109711197112971139711497115971169711797118971199712097121971229712397124971259712697127971289712997130971319713297133971349713597136971379713897139971409714197142971439714497145971469714797148971499715097151971529715397154971559715697157971589715997160971619716297163971649716597166971679716897169971709717197172971739717497175971769717797178971799718097181971829718397184971859718697187971889718997190971919719297193971949719597196971979719897199972009720197202972039720497205972069720797208972099721097211972129721397214972159721697217972189721997220972219722297223972249722597226972279722897229972309723197232972339723497235972369723797238972399724097241972429724397244972459724697247972489724997250972519725297253972549725597256972579725897259972609726197262972639726497265972669726797268972699727097271972729727397274972759727697277972789727997280972819728297283972849728597286972879728897289972909729197292972939729497295972969729797298972999730097301973029730397304973059730697307973089730997310973119731297313973149731597316973179731897319973209732197322973239732497325973269732797328973299733097331973329733397334973359733697337973389733997340973419734297343973449734597346973479734897349973509735197352973539735497355973569735797358973599736097361973629736397364973659736697367973689736997370973719737297373973749737597376973779737897379973809738197382
  1. /*!
  2. *
  3. * iclient-mapboxgl.(https://iclient.supermap.io)
  4. * Copyright© 2000 - 2021 SuperMap Software Co.Ltd
  5. * license: Apache-2.0
  6. * version: v10.1.1
  7. *
  8. */
  9. /******/ (function() { // webpackBootstrap
  10. /******/ var __webpack_modules__ = ({
  11. /***/ 937:
  12. /***/ (function(module) {
  13. (function (self) {
  14. 'use strict'; // if __disableNativeFetch is set to true, the it will always polyfill fetch
  15. // with Ajax.
  16. if (!self.__disableNativeFetch && self.fetch) {
  17. return;
  18. }
  19. function normalizeName(name) {
  20. if (typeof name !== 'string') {
  21. name = String(name);
  22. }
  23. if (/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(name)) {
  24. throw new TypeError('Invalid character in header field name');
  25. }
  26. return name.toLowerCase();
  27. }
  28. function normalizeValue(value) {
  29. if (typeof value !== 'string') {
  30. value = String(value);
  31. }
  32. return value;
  33. }
  34. function Headers(headers) {
  35. this.map = {};
  36. if (headers instanceof Headers) {
  37. headers.forEach(function (value, name) {
  38. this.append(name, value);
  39. }, this);
  40. } else if (headers) {
  41. Object.getOwnPropertyNames(headers).forEach(function (name) {
  42. this.append(name, headers[name]);
  43. }, this);
  44. }
  45. }
  46. Headers.prototype.append = function (name, value) {
  47. name = normalizeName(name);
  48. value = normalizeValue(value);
  49. var list = this.map[name];
  50. if (!list) {
  51. list = [];
  52. this.map[name] = list;
  53. }
  54. list.push(value);
  55. };
  56. Headers.prototype['delete'] = function (name) {
  57. delete this.map[normalizeName(name)];
  58. };
  59. Headers.prototype.get = function (name) {
  60. var values = this.map[normalizeName(name)];
  61. return values ? values[0] : null;
  62. };
  63. Headers.prototype.getAll = function (name) {
  64. return this.map[normalizeName(name)] || [];
  65. };
  66. Headers.prototype.has = function (name) {
  67. return this.map.hasOwnProperty(normalizeName(name));
  68. };
  69. Headers.prototype.set = function (name, value) {
  70. this.map[normalizeName(name)] = [normalizeValue(value)];
  71. };
  72. Headers.prototype.forEach = function (callback, thisArg) {
  73. Object.getOwnPropertyNames(this.map).forEach(function (name) {
  74. this.map[name].forEach(function (value) {
  75. callback.call(thisArg, value, name, this);
  76. }, this);
  77. }, this);
  78. };
  79. function consumed(body) {
  80. if (body.bodyUsed) {
  81. return Promise.reject(new TypeError('Already read'));
  82. }
  83. body.bodyUsed = true;
  84. }
  85. function fileReaderReady(reader) {
  86. return new Promise(function (resolve, reject) {
  87. reader.onload = function () {
  88. resolve(reader.result);
  89. };
  90. reader.onerror = function () {
  91. reject(reader.error);
  92. };
  93. });
  94. }
  95. function readBlobAsArrayBuffer(blob) {
  96. var reader = new FileReader();
  97. reader.readAsArrayBuffer(blob);
  98. return fileReaderReady(reader);
  99. }
  100. function readBlobAsText(blob, options) {
  101. var reader = new FileReader();
  102. var contentType = options.headers.map['content-type'] ? options.headers.map['content-type'].toString() : '';
  103. var regex = /charset\=[0-9a-zA-Z\-\_]*;?/;
  104. var _charset = blob.type.match(regex) || contentType.match(regex);
  105. var args = [blob];
  106. if (_charset) {
  107. args.push(_charset[0].replace(/^charset\=/, '').replace(/;$/, ''));
  108. }
  109. reader.readAsText.apply(reader, args);
  110. return fileReaderReady(reader);
  111. }
  112. var support = {
  113. blob: 'FileReader' in self && 'Blob' in self && function () {
  114. try {
  115. new Blob();
  116. return true;
  117. } catch (e) {
  118. return false;
  119. }
  120. }(),
  121. formData: 'FormData' in self,
  122. arrayBuffer: 'ArrayBuffer' in self
  123. };
  124. function Body() {
  125. this.bodyUsed = false;
  126. this._initBody = function (body, options) {
  127. this._bodyInit = body;
  128. if (typeof body === 'string') {
  129. this._bodyText = body;
  130. } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
  131. this._bodyBlob = body;
  132. this._options = options;
  133. } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
  134. this._bodyFormData = body;
  135. } else if (!body) {
  136. this._bodyText = '';
  137. } else if (support.arrayBuffer && ArrayBuffer.prototype.isPrototypeOf(body)) {// Only support ArrayBuffers for POST method.
  138. // Receiving ArrayBuffers happens via Blobs, instead.
  139. } else {
  140. throw new Error('unsupported BodyInit type');
  141. }
  142. };
  143. if (support.blob) {
  144. this.blob = function () {
  145. var rejected = consumed(this);
  146. if (rejected) {
  147. return rejected;
  148. }
  149. if (this._bodyBlob) {
  150. return Promise.resolve(this._bodyBlob);
  151. } else if (this._bodyFormData) {
  152. throw new Error('could not read FormData body as blob');
  153. } else {
  154. return Promise.resolve(new Blob([this._bodyText]));
  155. }
  156. };
  157. this.arrayBuffer = function () {
  158. return this.blob().then(readBlobAsArrayBuffer);
  159. };
  160. this.text = function () {
  161. var rejected = consumed(this);
  162. if (rejected) {
  163. return rejected;
  164. }
  165. if (this._bodyBlob) {
  166. return readBlobAsText(this._bodyBlob, this._options);
  167. } else if (this._bodyFormData) {
  168. throw new Error('could not read FormData body as text');
  169. } else {
  170. return Promise.resolve(this._bodyText);
  171. }
  172. };
  173. } else {
  174. this.text = function () {
  175. var rejected = consumed(this);
  176. return rejected ? rejected : Promise.resolve(this._bodyText);
  177. };
  178. }
  179. if (support.formData) {
  180. this.formData = function () {
  181. return this.text().then(decode);
  182. };
  183. }
  184. this.json = function () {
  185. return this.text().then(JSON.parse);
  186. };
  187. return this;
  188. } // HTTP methods whose capitalization should be normalized
  189. var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
  190. function normalizeMethod(method) {
  191. var upcased = method.toUpperCase();
  192. return methods.indexOf(upcased) > -1 ? upcased : method;
  193. }
  194. function Request(input, options) {
  195. options = options || {};
  196. var body = options.body;
  197. if (Request.prototype.isPrototypeOf(input)) {
  198. if (input.bodyUsed) {
  199. throw new TypeError('Already read');
  200. }
  201. this.url = input.url;
  202. this.credentials = input.credentials;
  203. if (!options.headers) {
  204. this.headers = new Headers(input.headers);
  205. }
  206. this.method = input.method;
  207. this.mode = input.mode;
  208. if (!body) {
  209. body = input._bodyInit;
  210. input.bodyUsed = true;
  211. }
  212. } else {
  213. this.url = input;
  214. }
  215. this.credentials = options.credentials || this.credentials || 'omit';
  216. if (options.headers || !this.headers) {
  217. this.headers = new Headers(options.headers);
  218. }
  219. this.method = normalizeMethod(options.method || this.method || 'GET');
  220. this.mode = options.mode || this.mode || null;
  221. this.referrer = null;
  222. if ((this.method === 'GET' || this.method === 'HEAD') && body) {
  223. throw new TypeError('Body not allowed for GET or HEAD requests');
  224. }
  225. this._initBody(body, options);
  226. }
  227. Request.prototype.clone = function () {
  228. return new Request(this);
  229. };
  230. function decode(body) {
  231. var form = new FormData();
  232. body.trim().split('&').forEach(function (bytes) {
  233. if (bytes) {
  234. var split = bytes.split('=');
  235. var name = split.shift().replace(/\+/g, ' ');
  236. var value = split.join('=').replace(/\+/g, ' ');
  237. form.append(decodeURIComponent(name), decodeURIComponent(value));
  238. }
  239. });
  240. return form;
  241. }
  242. function headers(xhr) {
  243. var head = new Headers();
  244. var pairs = xhr.getAllResponseHeaders().trim().split('\n');
  245. pairs.forEach(function (header) {
  246. var split = header.trim().split(':');
  247. var key = split.shift().trim();
  248. var value = split.join(':').trim();
  249. head.append(key, value);
  250. });
  251. return head;
  252. }
  253. Body.call(Request.prototype);
  254. function Response(bodyInit, options) {
  255. if (!options) {
  256. options = {};
  257. }
  258. this._initBody(bodyInit, options);
  259. this.type = 'default';
  260. this.status = options.status;
  261. this.ok = this.status >= 200 && this.status < 300;
  262. this.statusText = options.statusText;
  263. this.headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
  264. this.url = options.url || '';
  265. }
  266. Body.call(Response.prototype);
  267. Response.prototype.clone = function () {
  268. return new Response(this._bodyInit, {
  269. status: this.status,
  270. statusText: this.statusText,
  271. headers: new Headers(this.headers),
  272. url: this.url
  273. });
  274. };
  275. Response.error = function () {
  276. var response = new Response(null, {
  277. status: 0,
  278. statusText: ''
  279. });
  280. response.type = 'error';
  281. return response;
  282. };
  283. var redirectStatuses = [301, 302, 303, 307, 308];
  284. Response.redirect = function (url, status) {
  285. if (redirectStatuses.indexOf(status) === -1) {
  286. throw new RangeError('Invalid status code');
  287. }
  288. return new Response(null, {
  289. status: status,
  290. headers: {
  291. location: url
  292. }
  293. });
  294. };
  295. self.Headers = Headers;
  296. self.Request = Request;
  297. self.Response = Response;
  298. self.fetch = function (input, init) {
  299. return new Promise(function (resolve, reject) {
  300. var request;
  301. if (Request.prototype.isPrototypeOf(input) && !init) {
  302. request = input;
  303. } else {
  304. request = new Request(input, init);
  305. }
  306. var xhr = new XMLHttpRequest();
  307. function responseURL() {
  308. if ('responseURL' in xhr) {
  309. return xhr.responseURL;
  310. } // Avoid security warnings on getResponseHeader when not allowed by CORS
  311. if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
  312. return xhr.getResponseHeader('X-Request-URL');
  313. }
  314. return;
  315. }
  316. var __onLoadHandled = false;
  317. function onload() {
  318. if (xhr.readyState !== 4) {
  319. return;
  320. }
  321. var status = xhr.status === 1223 ? 204 : xhr.status;
  322. if (status < 100 || status > 599) {
  323. if (__onLoadHandled) {
  324. return;
  325. } else {
  326. __onLoadHandled = true;
  327. }
  328. reject(new TypeError('Network request failed'));
  329. return;
  330. }
  331. var options = {
  332. status: status,
  333. statusText: xhr.statusText,
  334. headers: headers(xhr),
  335. url: responseURL()
  336. };
  337. var body = 'response' in xhr ? xhr.response : xhr.responseText;
  338. if (__onLoadHandled) {
  339. return;
  340. } else {
  341. __onLoadHandled = true;
  342. }
  343. resolve(new Response(body, options));
  344. }
  345. xhr.onreadystatechange = onload;
  346. xhr.onload = onload;
  347. xhr.onerror = function () {
  348. if (__onLoadHandled) {
  349. return;
  350. } else {
  351. __onLoadHandled = true;
  352. }
  353. reject(new TypeError('Network request failed'));
  354. };
  355. xhr.open(request.method, request.url, true); // `withCredentials` should be setted after calling `.open` in IE10
  356. // http://stackoverflow.com/a/19667959/1219343
  357. try {
  358. if (request.credentials === 'include') {
  359. if ('withCredentials' in xhr) {
  360. xhr.withCredentials = true;
  361. } else {
  362. console && console.warn && console.warn('withCredentials is not supported, you can ignore this warning');
  363. }
  364. }
  365. } catch (e) {
  366. console && console.warn && console.warn('set withCredentials error:' + e);
  367. }
  368. if ('responseType' in xhr && support.blob) {
  369. xhr.responseType = 'blob';
  370. }
  371. request.headers.forEach(function (value, name) {
  372. xhr.setRequestHeader(name, value);
  373. });
  374. xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
  375. });
  376. };
  377. self.fetch.polyfill = true; // Support CommonJS
  378. if ( true && module.exports) {
  379. module.exports = self.fetch;
  380. }
  381. })(typeof self !== 'undefined' ? self : this);
  382. /***/ }),
  383. /***/ 238:
  384. /***/ (function(module, exports) {
  385. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  386. if (true) {
  387. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, module], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  388. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  389. (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  390. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  391. } else { var mod; }
  392. })(this, function (exports, module) {
  393. 'use strict';
  394. var defaultOptions = {
  395. timeout: 5000,
  396. jsonpCallback: 'callback',
  397. jsonpCallbackFunction: null
  398. };
  399. function generateCallbackFunction() {
  400. return 'jsonp_' + Date.now() + '_' + Math.ceil(Math.random() * 100000);
  401. }
  402. function clearFunction(functionName) {
  403. // IE8 throws an exception when you try to delete a property on window
  404. // http://stackoverflow.com/a/1824228/751089
  405. try {
  406. delete window[functionName];
  407. } catch (e) {
  408. window[functionName] = undefined;
  409. }
  410. }
  411. function removeScript(scriptId) {
  412. var script = document.getElementById(scriptId);
  413. if (script) {
  414. document.getElementsByTagName('head')[0].removeChild(script);
  415. }
  416. }
  417. function fetchJsonp(_url) {
  418. var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; // to avoid param reassign
  419. var url = _url;
  420. var timeout = options.timeout || defaultOptions.timeout;
  421. var jsonpCallback = options.jsonpCallback || defaultOptions.jsonpCallback;
  422. var timeoutId = undefined;
  423. return new Promise(function (resolve, reject) {
  424. var callbackFunction = options.jsonpCallbackFunction || generateCallbackFunction();
  425. var scriptId = jsonpCallback + '_' + callbackFunction;
  426. window[callbackFunction] = function (response) {
  427. resolve({
  428. ok: true,
  429. // keep consistent with fetch API
  430. json: function json() {
  431. return Promise.resolve(response);
  432. }
  433. });
  434. if (timeoutId) clearTimeout(timeoutId);
  435. removeScript(scriptId);
  436. clearFunction(callbackFunction);
  437. }; // Check if the user set their own params, and if not add a ? to start a list of params
  438. url += url.indexOf('?') === -1 ? '?' : '&';
  439. var jsonpScript = document.createElement('script');
  440. jsonpScript.setAttribute('src', '' + url + jsonpCallback + '=' + callbackFunction);
  441. if (options.charset) {
  442. jsonpScript.setAttribute('charset', options.charset);
  443. }
  444. jsonpScript.id = scriptId;
  445. document.getElementsByTagName('head')[0].appendChild(jsonpScript);
  446. timeoutId = setTimeout(function () {
  447. reject(new Error('JSONP request to ' + _url + ' timed out'));
  448. clearFunction(callbackFunction);
  449. removeScript(scriptId);
  450. window[callbackFunction] = function () {
  451. clearFunction(callbackFunction);
  452. };
  453. }, timeout); // Caught if got 404/500
  454. jsonpScript.onerror = function () {
  455. reject(new Error('JSONP request to ' + _url + ' failed'));
  456. clearFunction(callbackFunction);
  457. removeScript(scriptId);
  458. if (timeoutId) clearTimeout(timeoutId);
  459. };
  460. });
  461. } // export as global function
  462. /*
  463. let local;
  464. if (typeof global !== 'undefined') {
  465. local = global;
  466. } else if (typeof self !== 'undefined') {
  467. local = self;
  468. } else {
  469. try {
  470. local = Function('return this')();
  471. } catch (e) {
  472. throw new Error('polyfill failed because global object is unavailable in this environment');
  473. }
  474. }
  475. local.fetchJsonp = fetchJsonp;
  476. */
  477. module.exports = fetchJsonp;
  478. });
  479. /***/ }),
  480. /***/ 820:
  481. /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
  482. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  483. /**
  484. * lodash (Custom Build) <https://lodash.com/>
  485. * Build: `lodash modularize exports="npm" -o ./`
  486. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  487. * Released under MIT license <https://lodash.com/license>
  488. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  489. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  490. */
  491. /** Used as references for various `Number` constants. */
  492. var MAX_SAFE_INTEGER = 9007199254740991;
  493. /** `Object#toString` result references. */
  494. var argsTag = '[object Arguments]',
  495. funcTag = '[object Function]',
  496. genTag = '[object GeneratorFunction]',
  497. mapTag = '[object Map]',
  498. objectTag = '[object Object]',
  499. promiseTag = '[object Promise]',
  500. setTag = '[object Set]',
  501. weakMapTag = '[object WeakMap]';
  502. var dataViewTag = '[object DataView]';
  503. /**
  504. * Used to match `RegExp`
  505. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  506. */
  507. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  508. /** Used to detect host constructors (Safari). */
  509. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  510. /** Used to detect unsigned integer values. */
  511. var reIsUint = /^(?:0|[1-9]\d*)$/;
  512. /** Detect free variable `global` from Node.js. */
  513. var freeGlobal = (typeof __webpack_require__.g === "undefined" ? "undefined" : _typeof(__webpack_require__.g)) == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  514. /** Detect free variable `self`. */
  515. var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
  516. /** Used as a reference to the global object. */
  517. var root = freeGlobal || freeSelf || Function('return this')();
  518. /**
  519. * A specialized version of `_.map` for arrays without support for iteratee
  520. * shorthands.
  521. *
  522. * @private
  523. * @param {Array} [array] The array to iterate over.
  524. * @param {Function} iteratee The function invoked per iteration.
  525. * @returns {Array} Returns the new mapped array.
  526. */
  527. function arrayMap(array, iteratee) {
  528. var index = -1,
  529. length = array ? array.length : 0,
  530. result = Array(length);
  531. while (++index < length) {
  532. result[index] = iteratee(array[index], index, array);
  533. }
  534. return result;
  535. }
  536. /**
  537. * The base implementation of `_.times` without support for iteratee shorthands
  538. * or max array length checks.
  539. *
  540. * @private
  541. * @param {number} n The number of times to invoke `iteratee`.
  542. * @param {Function} iteratee The function invoked per iteration.
  543. * @returns {Array} Returns the array of results.
  544. */
  545. function baseTimes(n, iteratee) {
  546. var index = -1,
  547. result = Array(n);
  548. while (++index < n) {
  549. result[index] = iteratee(index);
  550. }
  551. return result;
  552. }
  553. /**
  554. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  555. * of key-value pairs for `object` corresponding to the property names of `props`.
  556. *
  557. * @private
  558. * @param {Object} object The object to query.
  559. * @param {Array} props The property names to get values for.
  560. * @returns {Object} Returns the key-value pairs.
  561. */
  562. function baseToPairs(object, props) {
  563. return arrayMap(props, function (key) {
  564. return [key, object[key]];
  565. });
  566. }
  567. /**
  568. * Gets the value at `key` of `object`.
  569. *
  570. * @private
  571. * @param {Object} [object] The object to query.
  572. * @param {string} key The key of the property to get.
  573. * @returns {*} Returns the property value.
  574. */
  575. function getValue(object, key) {
  576. return object == null ? undefined : object[key];
  577. }
  578. /**
  579. * Checks if `value` is a host object in IE < 9.
  580. *
  581. * @private
  582. * @param {*} value The value to check.
  583. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  584. */
  585. function isHostObject(value) {
  586. // Many host objects are `Object` objects that can coerce to strings
  587. // despite having improperly defined `toString` methods.
  588. var result = false;
  589. if (value != null && typeof value.toString != 'function') {
  590. try {
  591. result = !!(value + '');
  592. } catch (e) {}
  593. }
  594. return result;
  595. }
  596. /**
  597. * Converts `map` to its key-value pairs.
  598. *
  599. * @private
  600. * @param {Object} map The map to convert.
  601. * @returns {Array} Returns the key-value pairs.
  602. */
  603. function mapToArray(map) {
  604. var index = -1,
  605. result = Array(map.size);
  606. map.forEach(function (value, key) {
  607. result[++index] = [key, value];
  608. });
  609. return result;
  610. }
  611. /**
  612. * Creates a unary function that invokes `func` with its argument transformed.
  613. *
  614. * @private
  615. * @param {Function} func The function to wrap.
  616. * @param {Function} transform The argument transform.
  617. * @returns {Function} Returns the new function.
  618. */
  619. function overArg(func, transform) {
  620. return function (arg) {
  621. return func(transform(arg));
  622. };
  623. }
  624. /**
  625. * Converts `set` to its value-value pairs.
  626. *
  627. * @private
  628. * @param {Object} set The set to convert.
  629. * @returns {Array} Returns the value-value pairs.
  630. */
  631. function setToPairs(set) {
  632. var index = -1,
  633. result = Array(set.size);
  634. set.forEach(function (value) {
  635. result[++index] = [value, value];
  636. });
  637. return result;
  638. }
  639. /** Used for built-in method references. */
  640. var funcProto = Function.prototype,
  641. objectProto = Object.prototype;
  642. /** Used to detect overreaching core-js shims. */
  643. var coreJsData = root['__core-js_shared__'];
  644. /** Used to detect methods masquerading as native. */
  645. var maskSrcKey = function () {
  646. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  647. return uid ? 'Symbol(src)_1.' + uid : '';
  648. }();
  649. /** Used to resolve the decompiled source of functions. */
  650. var funcToString = funcProto.toString;
  651. /** Used to check objects for own properties. */
  652. var hasOwnProperty = objectProto.hasOwnProperty;
  653. /**
  654. * Used to resolve the
  655. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  656. * of values.
  657. */
  658. var objectToString = objectProto.toString;
  659. /** Used to detect if a method is native. */
  660. var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
  661. /** Built-in value references. */
  662. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  663. /* Built-in method references for those with the same name as other `lodash` methods. */
  664. var nativeKeys = overArg(Object.keys, Object);
  665. /* Built-in method references that are verified to be native. */
  666. var DataView = getNative(root, 'DataView'),
  667. Map = getNative(root, 'Map'),
  668. Promise = getNative(root, 'Promise'),
  669. Set = getNative(root, 'Set'),
  670. WeakMap = getNative(root, 'WeakMap');
  671. /** Used to detect maps, sets, and weakmaps. */
  672. var dataViewCtorString = toSource(DataView),
  673. mapCtorString = toSource(Map),
  674. promiseCtorString = toSource(Promise),
  675. setCtorString = toSource(Set),
  676. weakMapCtorString = toSource(WeakMap);
  677. /**
  678. * Creates an array of the enumerable property names of the array-like `value`.
  679. *
  680. * @private
  681. * @param {*} value The value to query.
  682. * @param {boolean} inherited Specify returning inherited property names.
  683. * @returns {Array} Returns the array of property names.
  684. */
  685. function arrayLikeKeys(value, inherited) {
  686. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  687. // Safari 9 makes `arguments.length` enumerable in strict mode.
  688. var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
  689. var length = result.length,
  690. skipIndexes = !!length;
  691. for (var key in value) {
  692. if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
  693. result.push(key);
  694. }
  695. }
  696. return result;
  697. }
  698. /**
  699. * The base implementation of `getTag`.
  700. *
  701. * @private
  702. * @param {*} value The value to query.
  703. * @returns {string} Returns the `toStringTag`.
  704. */
  705. function baseGetTag(value) {
  706. return objectToString.call(value);
  707. }
  708. /**
  709. * The base implementation of `_.isNative` without bad shim checks.
  710. *
  711. * @private
  712. * @param {*} value The value to check.
  713. * @returns {boolean} Returns `true` if `value` is a native function,
  714. * else `false`.
  715. */
  716. function baseIsNative(value) {
  717. if (!isObject(value) || isMasked(value)) {
  718. return false;
  719. }
  720. var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
  721. return pattern.test(toSource(value));
  722. }
  723. /**
  724. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  725. *
  726. * @private
  727. * @param {Object} object The object to query.
  728. * @returns {Array} Returns the array of property names.
  729. */
  730. function baseKeys(object) {
  731. if (!isPrototype(object)) {
  732. return nativeKeys(object);
  733. }
  734. var result = [];
  735. for (var key in Object(object)) {
  736. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  737. result.push(key);
  738. }
  739. }
  740. return result;
  741. }
  742. /**
  743. * Creates a `_.toPairs` or `_.toPairsIn` function.
  744. *
  745. * @private
  746. * @param {Function} keysFunc The function to get the keys of a given object.
  747. * @returns {Function} Returns the new pairs function.
  748. */
  749. function createToPairs(keysFunc) {
  750. return function (object) {
  751. var tag = getTag(object);
  752. if (tag == mapTag) {
  753. return mapToArray(object);
  754. }
  755. if (tag == setTag) {
  756. return setToPairs(object);
  757. }
  758. return baseToPairs(object, keysFunc(object));
  759. };
  760. }
  761. /**
  762. * Gets the native function at `key` of `object`.
  763. *
  764. * @private
  765. * @param {Object} object The object to query.
  766. * @param {string} key The key of the method to get.
  767. * @returns {*} Returns the function if it's native, else `undefined`.
  768. */
  769. function getNative(object, key) {
  770. var value = getValue(object, key);
  771. return baseIsNative(value) ? value : undefined;
  772. }
  773. /**
  774. * Gets the `toStringTag` of `value`.
  775. *
  776. * @private
  777. * @param {*} value The value to query.
  778. * @returns {string} Returns the `toStringTag`.
  779. */
  780. var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11,
  781. // for data views in Edge < 14, and promises in Node.js.
  782. 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) {
  783. getTag = function getTag(value) {
  784. var result = objectToString.call(value),
  785. Ctor = result == objectTag ? value.constructor : undefined,
  786. ctorString = Ctor ? toSource(Ctor) : undefined;
  787. if (ctorString) {
  788. switch (ctorString) {
  789. case dataViewCtorString:
  790. return dataViewTag;
  791. case mapCtorString:
  792. return mapTag;
  793. case promiseCtorString:
  794. return promiseTag;
  795. case setCtorString:
  796. return setTag;
  797. case weakMapCtorString:
  798. return weakMapTag;
  799. }
  800. }
  801. return result;
  802. };
  803. }
  804. /**
  805. * Checks if `value` is a valid array-like index.
  806. *
  807. * @private
  808. * @param {*} value The value to check.
  809. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  810. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  811. */
  812. function isIndex(value, length) {
  813. length = length == null ? MAX_SAFE_INTEGER : length;
  814. return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  815. }
  816. /**
  817. * Checks if `func` has its source masked.
  818. *
  819. * @private
  820. * @param {Function} func The function to check.
  821. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  822. */
  823. function isMasked(func) {
  824. return !!maskSrcKey && maskSrcKey in func;
  825. }
  826. /**
  827. * Checks if `value` is likely a prototype object.
  828. *
  829. * @private
  830. * @param {*} value The value to check.
  831. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  832. */
  833. function isPrototype(value) {
  834. var Ctor = value && value.constructor,
  835. proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
  836. return value === proto;
  837. }
  838. /**
  839. * Converts `func` to its source code.
  840. *
  841. * @private
  842. * @param {Function} func The function to process.
  843. * @returns {string} Returns the source code.
  844. */
  845. function toSource(func) {
  846. if (func != null) {
  847. try {
  848. return funcToString.call(func);
  849. } catch (e) {}
  850. try {
  851. return func + '';
  852. } catch (e) {}
  853. }
  854. return '';
  855. }
  856. /**
  857. * Checks if `value` is likely an `arguments` object.
  858. *
  859. * @static
  860. * @memberOf _
  861. * @since 0.1.0
  862. * @category Lang
  863. * @param {*} value The value to check.
  864. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  865. * else `false`.
  866. * @example
  867. *
  868. * _.isArguments(function() { return arguments; }());
  869. * // => true
  870. *
  871. * _.isArguments([1, 2, 3]);
  872. * // => false
  873. */
  874. function isArguments(value) {
  875. // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
  876. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
  877. }
  878. /**
  879. * Checks if `value` is classified as an `Array` object.
  880. *
  881. * @static
  882. * @memberOf _
  883. * @since 0.1.0
  884. * @category Lang
  885. * @param {*} value The value to check.
  886. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  887. * @example
  888. *
  889. * _.isArray([1, 2, 3]);
  890. * // => true
  891. *
  892. * _.isArray(document.body.children);
  893. * // => false
  894. *
  895. * _.isArray('abc');
  896. * // => false
  897. *
  898. * _.isArray(_.noop);
  899. * // => false
  900. */
  901. var isArray = Array.isArray;
  902. /**
  903. * Checks if `value` is array-like. A value is considered array-like if it's
  904. * not a function and has a `value.length` that's an integer greater than or
  905. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  906. *
  907. * @static
  908. * @memberOf _
  909. * @since 4.0.0
  910. * @category Lang
  911. * @param {*} value The value to check.
  912. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  913. * @example
  914. *
  915. * _.isArrayLike([1, 2, 3]);
  916. * // => true
  917. *
  918. * _.isArrayLike(document.body.children);
  919. * // => true
  920. *
  921. * _.isArrayLike('abc');
  922. * // => true
  923. *
  924. * _.isArrayLike(_.noop);
  925. * // => false
  926. */
  927. function isArrayLike(value) {
  928. return value != null && isLength(value.length) && !isFunction(value);
  929. }
  930. /**
  931. * This method is like `_.isArrayLike` except that it also checks if `value`
  932. * is an object.
  933. *
  934. * @static
  935. * @memberOf _
  936. * @since 4.0.0
  937. * @category Lang
  938. * @param {*} value The value to check.
  939. * @returns {boolean} Returns `true` if `value` is an array-like object,
  940. * else `false`.
  941. * @example
  942. *
  943. * _.isArrayLikeObject([1, 2, 3]);
  944. * // => true
  945. *
  946. * _.isArrayLikeObject(document.body.children);
  947. * // => true
  948. *
  949. * _.isArrayLikeObject('abc');
  950. * // => false
  951. *
  952. * _.isArrayLikeObject(_.noop);
  953. * // => false
  954. */
  955. function isArrayLikeObject(value) {
  956. return isObjectLike(value) && isArrayLike(value);
  957. }
  958. /**
  959. * Checks if `value` is classified as a `Function` object.
  960. *
  961. * @static
  962. * @memberOf _
  963. * @since 0.1.0
  964. * @category Lang
  965. * @param {*} value The value to check.
  966. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  967. * @example
  968. *
  969. * _.isFunction(_);
  970. * // => true
  971. *
  972. * _.isFunction(/abc/);
  973. * // => false
  974. */
  975. function isFunction(value) {
  976. // The use of `Object#toString` avoids issues with the `typeof` operator
  977. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  978. var tag = isObject(value) ? objectToString.call(value) : '';
  979. return tag == funcTag || tag == genTag;
  980. }
  981. /**
  982. * Checks if `value` is a valid array-like length.
  983. *
  984. * **Note:** This method is loosely based on
  985. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  986. *
  987. * @static
  988. * @memberOf _
  989. * @since 4.0.0
  990. * @category Lang
  991. * @param {*} value The value to check.
  992. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  993. * @example
  994. *
  995. * _.isLength(3);
  996. * // => true
  997. *
  998. * _.isLength(Number.MIN_VALUE);
  999. * // => false
  1000. *
  1001. * _.isLength(Infinity);
  1002. * // => false
  1003. *
  1004. * _.isLength('3');
  1005. * // => false
  1006. */
  1007. function isLength(value) {
  1008. return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  1009. }
  1010. /**
  1011. * Checks if `value` is the
  1012. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1013. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1014. *
  1015. * @static
  1016. * @memberOf _
  1017. * @since 0.1.0
  1018. * @category Lang
  1019. * @param {*} value The value to check.
  1020. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1021. * @example
  1022. *
  1023. * _.isObject({});
  1024. * // => true
  1025. *
  1026. * _.isObject([1, 2, 3]);
  1027. * // => true
  1028. *
  1029. * _.isObject(_.noop);
  1030. * // => true
  1031. *
  1032. * _.isObject(null);
  1033. * // => false
  1034. */
  1035. function isObject(value) {
  1036. var type = _typeof(value);
  1037. return !!value && (type == 'object' || type == 'function');
  1038. }
  1039. /**
  1040. * Checks if `value` is object-like. A value is object-like if it's not `null`
  1041. * and has a `typeof` result of "object".
  1042. *
  1043. * @static
  1044. * @memberOf _
  1045. * @since 4.0.0
  1046. * @category Lang
  1047. * @param {*} value The value to check.
  1048. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  1049. * @example
  1050. *
  1051. * _.isObjectLike({});
  1052. * // => true
  1053. *
  1054. * _.isObjectLike([1, 2, 3]);
  1055. * // => true
  1056. *
  1057. * _.isObjectLike(_.noop);
  1058. * // => false
  1059. *
  1060. * _.isObjectLike(null);
  1061. * // => false
  1062. */
  1063. function isObjectLike(value) {
  1064. return !!value && _typeof(value) == 'object';
  1065. }
  1066. /**
  1067. * Creates an array of the own enumerable property names of `object`.
  1068. *
  1069. * **Note:** Non-object values are coerced to objects. See the
  1070. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  1071. * for more details.
  1072. *
  1073. * @static
  1074. * @since 0.1.0
  1075. * @memberOf _
  1076. * @category Object
  1077. * @param {Object} object The object to query.
  1078. * @returns {Array} Returns the array of property names.
  1079. * @example
  1080. *
  1081. * function Foo() {
  1082. * this.a = 1;
  1083. * this.b = 2;
  1084. * }
  1085. *
  1086. * Foo.prototype.c = 3;
  1087. *
  1088. * _.keys(new Foo);
  1089. * // => ['a', 'b'] (iteration order is not guaranteed)
  1090. *
  1091. * _.keys('hi');
  1092. * // => ['0', '1']
  1093. */
  1094. function keys(object) {
  1095. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  1096. }
  1097. /**
  1098. * Creates an array of own enumerable string keyed-value pairs for `object`
  1099. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  1100. * entries are returned.
  1101. *
  1102. * @static
  1103. * @memberOf _
  1104. * @since 4.0.0
  1105. * @alias entries
  1106. * @category Object
  1107. * @param {Object} object The object to query.
  1108. * @returns {Array} Returns the key-value pairs.
  1109. * @example
  1110. *
  1111. * function Foo() {
  1112. * this.a = 1;
  1113. * this.b = 2;
  1114. * }
  1115. *
  1116. * Foo.prototype.c = 3;
  1117. *
  1118. * _.toPairs(new Foo);
  1119. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  1120. */
  1121. var toPairs = createToPairs(keys);
  1122. module.exports = toPairs;
  1123. /***/ }),
  1124. /***/ 957:
  1125. /***/ (function(module, exports, __webpack_require__) {
  1126. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  1127. (function (global, factory) {
  1128. ( false ? 0 : _typeof(exports)) === 'object' && "object" !== 'undefined' ? factory() : true ? !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  1129. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  1130. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  1131. __WEBPACK_AMD_DEFINE_FACTORY__),
  1132. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : 0;
  1133. })(this, function () {
  1134. 'use strict';
  1135. /**
  1136. * @this {Promise}
  1137. */
  1138. function finallyConstructor(callback) {
  1139. var constructor = this.constructor;
  1140. return this.then(function (value) {
  1141. // @ts-ignore
  1142. return constructor.resolve(callback()).then(function () {
  1143. return value;
  1144. });
  1145. }, function (reason) {
  1146. // @ts-ignore
  1147. return constructor.resolve(callback()).then(function () {
  1148. // @ts-ignore
  1149. return constructor.reject(reason);
  1150. });
  1151. });
  1152. } // Store setTimeout reference so promise-polyfill will be unaffected by
  1153. // other code modifying setTimeout (like sinon.useFakeTimers())
  1154. var setTimeoutFunc = setTimeout;
  1155. function isArray(x) {
  1156. return Boolean(x && typeof x.length !== 'undefined');
  1157. }
  1158. function noop() {} // Polyfill for Function.prototype.bind
  1159. function bind(fn, thisArg) {
  1160. return function () {
  1161. fn.apply(thisArg, arguments);
  1162. };
  1163. }
  1164. /**
  1165. * @constructor
  1166. * @param {Function} fn
  1167. */
  1168. function Promise(fn) {
  1169. if (!(this instanceof Promise)) throw new TypeError('Promises must be constructed via new');
  1170. if (typeof fn !== 'function') throw new TypeError('not a function');
  1171. /** @type {!number} */
  1172. this._state = 0;
  1173. /** @type {!boolean} */
  1174. this._handled = false;
  1175. /** @type {Promise|undefined} */
  1176. this._value = undefined;
  1177. /** @type {!Array<!Function>} */
  1178. this._deferreds = [];
  1179. doResolve(fn, this);
  1180. }
  1181. function handle(self, deferred) {
  1182. while (self._state === 3) {
  1183. self = self._value;
  1184. }
  1185. if (self._state === 0) {
  1186. self._deferreds.push(deferred);
  1187. return;
  1188. }
  1189. self._handled = true;
  1190. Promise._immediateFn(function () {
  1191. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  1192. if (cb === null) {
  1193. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  1194. return;
  1195. }
  1196. var ret;
  1197. try {
  1198. ret = cb(self._value);
  1199. } catch (e) {
  1200. reject(deferred.promise, e);
  1201. return;
  1202. }
  1203. resolve(deferred.promise, ret);
  1204. });
  1205. }
  1206. function resolve(self, newValue) {
  1207. try {
  1208. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  1209. if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
  1210. if (newValue && (_typeof(newValue) === 'object' || typeof newValue === 'function')) {
  1211. var then = newValue.then;
  1212. if (newValue instanceof Promise) {
  1213. self._state = 3;
  1214. self._value = newValue;
  1215. finale(self);
  1216. return;
  1217. } else if (typeof then === 'function') {
  1218. doResolve(bind(then, newValue), self);
  1219. return;
  1220. }
  1221. }
  1222. self._state = 1;
  1223. self._value = newValue;
  1224. finale(self);
  1225. } catch (e) {
  1226. reject(self, e);
  1227. }
  1228. }
  1229. function reject(self, newValue) {
  1230. self._state = 2;
  1231. self._value = newValue;
  1232. finale(self);
  1233. }
  1234. function finale(self) {
  1235. if (self._state === 2 && self._deferreds.length === 0) {
  1236. Promise._immediateFn(function () {
  1237. if (!self._handled) {
  1238. Promise._unhandledRejectionFn(self._value);
  1239. }
  1240. });
  1241. }
  1242. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  1243. handle(self, self._deferreds[i]);
  1244. }
  1245. self._deferreds = null;
  1246. }
  1247. /**
  1248. * @constructor
  1249. */
  1250. function Handler(onFulfilled, onRejected, promise) {
  1251. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  1252. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  1253. this.promise = promise;
  1254. }
  1255. /**
  1256. * Take a potentially misbehaving resolver function and make sure
  1257. * onFulfilled and onRejected are only called once.
  1258. *
  1259. * Makes no guarantees about asynchrony.
  1260. */
  1261. function doResolve(fn, self) {
  1262. var done = false;
  1263. try {
  1264. fn(function (value) {
  1265. if (done) return;
  1266. done = true;
  1267. resolve(self, value);
  1268. }, function (reason) {
  1269. if (done) return;
  1270. done = true;
  1271. reject(self, reason);
  1272. });
  1273. } catch (ex) {
  1274. if (done) return;
  1275. done = true;
  1276. reject(self, ex);
  1277. }
  1278. }
  1279. Promise.prototype['catch'] = function (onRejected) {
  1280. return this.then(null, onRejected);
  1281. };
  1282. Promise.prototype.then = function (onFulfilled, onRejected) {
  1283. // @ts-ignore
  1284. var prom = new this.constructor(noop);
  1285. handle(this, new Handler(onFulfilled, onRejected, prom));
  1286. return prom;
  1287. };
  1288. Promise.prototype['finally'] = finallyConstructor;
  1289. Promise.all = function (arr) {
  1290. return new Promise(function (resolve, reject) {
  1291. if (!isArray(arr)) {
  1292. return reject(new TypeError('Promise.all accepts an array'));
  1293. }
  1294. var args = Array.prototype.slice.call(arr);
  1295. if (args.length === 0) return resolve([]);
  1296. var remaining = args.length;
  1297. function res(i, val) {
  1298. try {
  1299. if (val && (_typeof(val) === 'object' || typeof val === 'function')) {
  1300. var then = val.then;
  1301. if (typeof then === 'function') {
  1302. then.call(val, function (val) {
  1303. res(i, val);
  1304. }, reject);
  1305. return;
  1306. }
  1307. }
  1308. args[i] = val;
  1309. if (--remaining === 0) {
  1310. resolve(args);
  1311. }
  1312. } catch (ex) {
  1313. reject(ex);
  1314. }
  1315. }
  1316. for (var i = 0; i < args.length; i++) {
  1317. res(i, args[i]);
  1318. }
  1319. });
  1320. };
  1321. Promise.resolve = function (value) {
  1322. if (value && _typeof(value) === 'object' && value.constructor === Promise) {
  1323. return value;
  1324. }
  1325. return new Promise(function (resolve) {
  1326. resolve(value);
  1327. });
  1328. };
  1329. Promise.reject = function (value) {
  1330. return new Promise(function (resolve, reject) {
  1331. reject(value);
  1332. });
  1333. };
  1334. Promise.race = function (arr) {
  1335. return new Promise(function (resolve, reject) {
  1336. if (!isArray(arr)) {
  1337. return reject(new TypeError('Promise.race accepts an array'));
  1338. }
  1339. for (var i = 0, len = arr.length; i < len; i++) {
  1340. Promise.resolve(arr[i]).then(resolve, reject);
  1341. }
  1342. });
  1343. }; // Use polyfill for setImmediate for performance gains
  1344. Promise._immediateFn = // @ts-ignore
  1345. typeof setImmediate === 'function' && function (fn) {
  1346. // @ts-ignore
  1347. setImmediate(fn);
  1348. } || function (fn) {
  1349. setTimeoutFunc(fn, 0);
  1350. };
  1351. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  1352. if (typeof console !== 'undefined' && console) {
  1353. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  1354. }
  1355. };
  1356. /** @suppress {undefinedVars} */
  1357. var globalNS = function () {
  1358. // the only reliable means to get the global object is
  1359. // `Function('return this')()`
  1360. // However, this causes CSP violations in Chrome apps.
  1361. if (typeof self !== 'undefined') {
  1362. return self;
  1363. }
  1364. if (typeof window !== 'undefined') {
  1365. return window;
  1366. }
  1367. if (typeof __webpack_require__.g !== 'undefined') {
  1368. return __webpack_require__.g;
  1369. }
  1370. throw new Error('unable to locate global object');
  1371. }();
  1372. if (!('Promise' in globalNS)) {
  1373. globalNS['Promise'] = Promise;
  1374. } else if (!globalNS.Promise.prototype['finally']) {
  1375. globalNS.Promise.prototype['finally'] = finallyConstructor;
  1376. }
  1377. });
  1378. /***/ })
  1379. /******/ });
  1380. /************************************************************************/
  1381. /******/ // The module cache
  1382. /******/ var __webpack_module_cache__ = {};
  1383. /******/
  1384. /******/ // The require function
  1385. /******/ function __webpack_require__(moduleId) {
  1386. /******/ // Check if module is in cache
  1387. /******/ if(__webpack_module_cache__[moduleId]) {
  1388. /******/ return __webpack_module_cache__[moduleId].exports;
  1389. /******/ }
  1390. /******/ // Create a new module (and put it into the cache)
  1391. /******/ var module = __webpack_module_cache__[moduleId] = {
  1392. /******/ // no module.id needed
  1393. /******/ // no module.loaded needed
  1394. /******/ exports: {}
  1395. /******/ };
  1396. /******/
  1397. /******/ // Execute the module function
  1398. /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  1399. /******/
  1400. /******/ // Return the exports of the module
  1401. /******/ return module.exports;
  1402. /******/ }
  1403. /******/
  1404. /************************************************************************/
  1405. /******/ /* webpack/runtime/compat get default export */
  1406. /******/ !function() {
  1407. /******/ // getDefaultExport function for compatibility with non-harmony modules
  1408. /******/ __webpack_require__.n = function(module) {
  1409. /******/ var getter = module && module.__esModule ?
  1410. /******/ function() { return module['default']; } :
  1411. /******/ function() { return module; };
  1412. /******/ __webpack_require__.d(getter, { a: getter });
  1413. /******/ return getter;
  1414. /******/ };
  1415. /******/ }();
  1416. /******/
  1417. /******/ /* webpack/runtime/define property getters */
  1418. /******/ !function() {
  1419. /******/ // define getter functions for harmony exports
  1420. /******/ __webpack_require__.d = function(exports, definition) {
  1421. /******/ for(var key in definition) {
  1422. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  1423. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1424. /******/ }
  1425. /******/ }
  1426. /******/ };
  1427. /******/ }();
  1428. /******/
  1429. /******/ /* webpack/runtime/global */
  1430. /******/ !function() {
  1431. /******/ __webpack_require__.g = (function() {
  1432. /******/ if (typeof globalThis === 'object') return globalThis;
  1433. /******/ try {
  1434. /******/ return this || new Function('return this')();
  1435. /******/ } catch (e) {
  1436. /******/ if (typeof window === 'object') return window;
  1437. /******/ }
  1438. /******/ })();
  1439. /******/ }();
  1440. /******/
  1441. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  1442. /******/ !function() {
  1443. /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
  1444. /******/ }();
  1445. /******/
  1446. /************************************************************************/
  1447. !function() {
  1448. "use strict";
  1449. // UNUSED EXPORTS: AddressMatchService, AggQueryBuilderParameter, AggregationParameter, AggregationQueryBuilderType, AggregationType, AlongLineDirection, AnalystAreaUnit, AnalystSizeUnit, AreaSolarRadiationParameters, ArrayStatistic, AttributesPopContainer, BufferAnalystParameters, BufferDistance, BufferEndType, BufferRadiusUnit, BufferSetting, BuffersAnalystJobsParameter, BurstPipelineAnalystParameters, ChartQueryFilterParameter, ChartQueryParameters, ChartService, ChartType, ChartView, ChartViewModel, CityTabsPage, ClientType, ClipAnalystMode, ClipParameter, ColorDictionary, ColorGradientType, ColorSpaceType, ColorsPickerUtil, CommonContainer, ComponentsUtil, ComputeWeightMatrixParameters, DataFlowService, DataFormat, DataItemOrderBy, DataItemType, DataReturnMode, DataReturnOption, DatasetBufferAnalystParameters, DatasetInfo, DatasetOverlayAnalystParameters, DatasetSurfaceAnalystParameters, DatasetThiessenAnalystParameters, DatasourceConnectionInfo, DeckglLayer, DensityKernelAnalystParameters, DirectionType, DropDownBox, EditFeaturesParameters, EditType, ElasticSearch, EngineType, Exponent, FacilityAnalyst3DParameters, FacilityAnalystSinks3DParameters, FacilityAnalystSources3DParameters, FacilityAnalystStreamParameters, FacilityAnalystTracedown3DParameters, FacilityAnalystTraceup3DParameters, FacilityAnalystUpstream3DParameters, FeatureService, FetchRequest, FieldParameters, FieldService, FieldStatisticsParameters, FileConfig, FileModel, FileReaderUtil, FileTypes, FillGradientMode, FilterAggParameter, FilterField, FilterParameter, FindClosestFacilitiesParameters, FindLocationParameters, FindMTSPPathsParameters, FindPathParameters, FindServiceAreasParameters, FindTSPPathsParameters, GenerateSpatialDataParameters, GeoBoundingBoxQueryBuilderParameter, GeoCodingParameter, GeoDecodingParameter, GeoFeature, GeoHashGridAggParameter, GeoRelationAnalystParameters, GeometryBufferAnalystParameters, GeometryOverlayAnalystParameters, GeometrySurfaceAnalystParameters, GeometryThiessenAnalystParameters, GeometryType, GeoprocessingService, GetFeatureMode, GetFeaturesByBoundsParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, GetFeaturesByIDsParameters, GetFeaturesBySQLParameters, GetGridCellInfosParameters, GraduatedMode, Graph, GraphAxesTextDisplayMode, Graphic, GraphicLayer, GraticuleLayer, Grid, GridCellInfosService, GridType, HeatMapLayer, IManager, IManagerCreateNodeParam, IManagerServiceBase, IPortal, IPortalAddDataParam, IPortalAddResourceParam, IPortalDataConnectionInfoParam, IPortalDataMetaInfoParam, IPortalDataStoreInfoParam, IPortalQueryParam, IPortalQueryResult, IPortalRegisterServiceParam, IPortalResource, IPortalServiceBase, IPortalShareEntity, IPortalShareParam, IPortalUser, Image, IndexTabsPageContainer, InterpolationAlgorithmType, InterpolationAnalystParameters, InterpolationIDWAnalystParameters, InterpolationKrigingAnalystParameters, InterpolationRBFAnalystParameters, JoinItem, JoinType, KernelDensityJobParameter, KeyServiceParameter, Label, LabelBackShape, LabelImageCell, LabelMatrixCell, LabelMixedTextStyle, LabelOverLengthMode, LabelSymbolCell, LabelThemeCell, LayerInfoService, LayerStatus, LayerType, LinkItem, Logo, MapExtend, MapService, MappingParameters, MapvDataSet, MapvLayer, MapvRenderer, MathExpressionAnalysisParameters, MeasureMode, MeasureParameters, MeasureService, MessageBox, NavTabsPage, NetworkAnalyst3DService, NetworkAnalystService, Online, OnlineData, OnlineQueryDatasParameter, OnlineServiceBase, OutputSetting, OutputType, OverlapDisplayedOptions, OverlayAnalystParameters, OverlayGeoJobParameter, OverlayOperationType, PaginationContainer, PixelFormat, PointWithMeasure, PopContainer, ProcessingService, QueryByBoundsParameters, QueryByDistanceParameters, QueryByGeometryParameters, QueryBySQLParameters, QueryOption, QueryParameters, QueryService, Range, RangeMode, RangeTheme3DLayer, RankSymbol, Route, RouteCalculateMeasureParameters, RouteLocatorParameters, SearchMode, SecurityManager, Select, ServerColor, ServerFeature, ServerGeometry, ServerInfo, ServerStyle, ServerTextStyle, ServerTheme, ServerType, ServiceBase, ServiceStatus, SetLayerInfoParameters, SetLayerStatusParameters, SetLayersInfoParameters, SideType, SingleObjectQueryJobsParameter, SmoothMethod, SpatialAnalystService, SpatialQueryMode, SpatialRelationType, StatisticAnalystMode, StatisticMode, StopQueryParameters, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SummaryType, SuperMap, SupplyCenter, SupplyCenterType, SurfaceAnalystMethod, SurfaceAnalystParameters, SurfaceAnalystParametersSetting, TerrainCurvatureCalculationParameters, TextAlignment, Theme, Theme3DLayer, ThemeDotDensity, ThemeFeature, ThemeFlow, ThemeGraduatedSymbol, ThemeGraduatedSymbolStyle, ThemeGraph, ThemeGraphAxes, ThemeGraphItem, ThemeGraphSize, ThemeGraphText, ThemeGraphTextFormat, ThemeGraphType, ThemeGridRange, ThemeGridRangeItem, ThemeGridUnique, ThemeGridUniqueItem, ThemeLabel, ThemeLabelAlongLine, ThemeLabelBackground, ThemeLabelItem, ThemeLabelText, ThemeLabelUniqueItem, ThemeLayer, ThemeMemoryData, ThemeOffset, ThemeParameters, ThemeRange, ThemeRangeItem, ThemeService, ThemeType, ThemeUnique, ThemeUniqueItem, ThiessenAnalystParameters, ThreeLayer, ThreeLayerRenderer, TimeFlowControl, TokenServiceParameter, TopologyValidatorJobsParameter, TopologyValidatorRule, TrafficTransferAnalystService, TransferLine, TransferPathParameters, TransferPreference, TransferSolutionParameters, TransferTactic, Transform, TransportationAnalystParameter, TransportationAnalystResultSetting, TurnType, UGCLayer, UGCLayerType, UGCMapLayer, UGCSubLayer, Unique, UniqueTheme3DLayer, Unit, UpdateEdgeWeightParameters, UpdateTurnNodeWeightParameters, Util, VariogramMode, Vector, VectorClipJobsParameter, WebMap, WebPrintingJobContent, WebPrintingJobCustomItems, WebPrintingJobExportOptions, WebPrintingJobImage, WebPrintingJobLayers, WebPrintingJobLayoutOptions, WebPrintingJobLegendOptions, WebPrintingJobLittleMapOptions, WebPrintingJobNorthArrowOptions, WebPrintingJobParameters, WebPrintingJobScaleBarOptions, WebPrintingJobService, WebPrintingService, getDefaultVectorTileStyle, setBackground, setPaintProperty
  1450. ;// CONCATENATED MODULE: ./src/common/SuperMap.js
  1451. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  1452. * This program are made available under the terms of the Apache License, Version 2.0
  1453. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1454. var SuperMap = window.SuperMap = window.SuperMap || {};
  1455. SuperMap.Components = window.SuperMap.Components || {};
  1456. ;// CONCATENATED MODULE: ./src/common/REST.js
  1457. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  1458. * This program are made available under the terms of the Apache License, Version 2.0
  1459. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  1460. /**
  1461. * @enum DataFormat
  1462. * @memberOf SuperMap
  1463. * @description 服务请求返回结果数据类型
  1464. * @type {string}
  1465. */
  1466. var DataFormat = SuperMap.DataFormat = {
  1467. /** GEOJSON */
  1468. GEOJSON: "GEOJSON",
  1469. /** ISERVER */
  1470. ISERVER: "ISERVER"
  1471. };
  1472. /**
  1473. * @enum ServerType
  1474. * @memberOf SuperMap
  1475. * @description 服务器类型
  1476. * @type {string}
  1477. */
  1478. var ServerType = SuperMap.ServerType = {
  1479. /** ISERVER */
  1480. ISERVER: "ISERVER",
  1481. /** IPORTAL */
  1482. IPORTAL: "IPORTAL",
  1483. /** ONLINE */
  1484. ONLINE: "ONLINE"
  1485. };
  1486. /**
  1487. * @enum GeometryType
  1488. * @memberOf SuperMap
  1489. * @description 几何对象枚举,定义了一系列几何对象类型。
  1490. * @type {string}
  1491. */
  1492. var GeometryType = SuperMap.GeometryType = {
  1493. /** LINE */
  1494. LINE: "LINE",
  1495. /** LINEM */
  1496. LINEM: "LINEM",
  1497. /** POINT */
  1498. POINT: "POINT",
  1499. /** REGION */
  1500. REGION: "REGION",
  1501. /** POINTEPS */
  1502. POINTEPS: "POINTEPS",
  1503. /** LINEEPS */
  1504. LINEEPS: "LINEEPS",
  1505. /** REGIONEPS */
  1506. REGIONEPS: "REGIONEPS",
  1507. /** ELLIPSE */
  1508. ELLIPSE: "ELLIPSE",
  1509. /** CIRCLE */
  1510. CIRCLE: "CIRCLE",
  1511. /** TEXT */
  1512. TEXT: "TEXT",
  1513. /** RECTANGLE */
  1514. RECTANGLE: "RECTANGLE",
  1515. /** UNKNOWN */
  1516. UNKNOWN: "UNKNOWN",
  1517. /** GEOCOMPOUND */
  1518. GEOCOMPOUND: "GEOCOMPOUND"
  1519. };
  1520. /**
  1521. * @enum QueryOption
  1522. * @memberOf SuperMap
  1523. * @description 查询结果类型枚举,描述查询结果返回类型,包括只返回属性、只返回几何实体以及返回属性和几何实体。
  1524. * @type {string}
  1525. */
  1526. var QueryOption = SuperMap.QueryOption = {
  1527. /** 属性 */
  1528. ATTRIBUTE: "ATTRIBUTE",
  1529. /** 属性和几何对象 */
  1530. ATTRIBUTEANDGEOMETRY: "ATTRIBUTEANDGEOMETRY",
  1531. /** 几何对象 */
  1532. GEOMETRY: "GEOMETRY"
  1533. };
  1534. /**
  1535. * @enum JoinType
  1536. * @memberOf SuperMap
  1537. * @description 关联查询时的关联类型常量。
  1538. * 该类定义了两个表之间的连接类型常量,决定了对两个表之间进行连接查询时,查询结果中得到的记录的情况。
  1539. * @type {string}
  1540. */
  1541. var JoinType = SuperMap.JoinType = {
  1542. /** INNERJOIN */
  1543. INNERJOIN: "INNERJOIN",
  1544. /** LEFTJOIN */
  1545. LEFTJOIN: "LEFTJOIN"
  1546. };
  1547. /**
  1548. * @enum SpatialQueryMode
  1549. * @memberOf SuperMap
  1550. * @description 空间查询模式枚举。该类定义了空间查询操作模式常量。
  1551. * @type {string}
  1552. */
  1553. var SpatialQueryMode = SuperMap.SpatialQueryMode = {
  1554. /** 包含空间查询模式 */
  1555. CONTAIN: "CONTAIN",
  1556. /** 交叉空间查询模式 */
  1557. CROSS: "CROSS",
  1558. /** 分离空间查询模式 */
  1559. DISJOINT: "DISJOINT",
  1560. /** 重合空间查询模式 */
  1561. IDENTITY: "IDENTITY",
  1562. /** 相交空间查询模式 */
  1563. INTERSECT: "INTERSECT",
  1564. /** 无空间查询 */
  1565. NONE: "NONE",
  1566. /** 叠加空间查询模式 */
  1567. OVERLAP: "OVERLAP",
  1568. /** 邻接空间查询模式 */
  1569. TOUCH: "TOUCH",
  1570. /** 被包含空间查询模式 */
  1571. WITHIN: "WITHIN"
  1572. };
  1573. /**
  1574. * @enum SpatialRelationType
  1575. * @memberOf SuperMap
  1576. * @description 数据集对象间的空间关系枚举。
  1577. * 该类定义了数据集对象间的空间关系类型常量。
  1578. * @type {string}
  1579. */
  1580. var SpatialRelationType = SuperMap.SpatialRelationType = {
  1581. /** 包含关系 */
  1582. CONTAIN: "CONTAIN",
  1583. /** 相交关系 */
  1584. INTERSECT: "INTERSECT",
  1585. /** 被包含关系 */
  1586. WITHIN: "WITHIN"
  1587. };
  1588. /**
  1589. * @enum MeasureMode
  1590. * @memberOf SuperMap
  1591. * @type {string}
  1592. * @description 量算模式枚举。
  1593. * 该类定义了两种测量模式:距离测量和面积测量。
  1594. */
  1595. var MeasureMode = SuperMap.MeasureMode = {
  1596. /** 距离测量 */
  1597. DISTANCE: "DISTANCE",
  1598. /** 面积测量 */
  1599. AREA: "AREA"
  1600. };
  1601. /**
  1602. * @enum Unit
  1603. * @memberOf SuperMap
  1604. * @description 距离单位枚举。
  1605. * 该类定义了一系列距离单位类型。
  1606. * @type {string}
  1607. */
  1608. var Unit = SuperMap.Unit = {
  1609. /** 米 */
  1610. METER: "METER",
  1611. /** 千米 */
  1612. KILOMETER: "KILOMETER",
  1613. /** 英里 */
  1614. MILE: "MILE",
  1615. /** 码 */
  1616. YARD: "YARD",
  1617. /** 度 */
  1618. DEGREE: "DEGREE",
  1619. /** 毫米 */
  1620. MILLIMETER: "MILLIMETER",
  1621. /** 厘米 */
  1622. CENTIMETER: "CENTIMETER",
  1623. /** 英寸 */
  1624. INCH: "INCH",
  1625. /** 分米 */
  1626. DECIMETER: "DECIMETER",
  1627. /** 英尺 */
  1628. FOOT: "FOOT",
  1629. /** 秒 */
  1630. SECOND: "SECOND",
  1631. /** 分 */
  1632. MINUTE: "MINUTE",
  1633. /** 弧度 */
  1634. RADIAN: "RADIAN"
  1635. };
  1636. /**
  1637. * @enum BufferRadiusUnit
  1638. * @memberOf SuperMap
  1639. * @description 缓冲区距离单位枚举。
  1640. * 该类定义了一系列缓冲距离单位类型。
  1641. * @type {string}
  1642. */
  1643. var BufferRadiusUnit = SuperMap.BufferRadiusUnit = {
  1644. /** 厘米 */
  1645. CENTIMETER: "CENTIMETER",
  1646. /** 分米 */
  1647. DECIMETER: "DECIMETER",
  1648. /** 英尺 */
  1649. FOOT: "FOOT",
  1650. /** 英寸 */
  1651. INCH: "INCH",
  1652. /** 千米 */
  1653. KILOMETER: "KILOMETER",
  1654. /** 米 */
  1655. METER: "METER",
  1656. /** 英里 */
  1657. MILE: "MILE",
  1658. /** 毫米 */
  1659. MILLIMETER: "MILLIMETER",
  1660. /** 码 */
  1661. YARD: "YARD"
  1662. };
  1663. /**
  1664. * @enum EngineType
  1665. * @memberOf SuperMap
  1666. * @description 数据源引擎类型枚举。
  1667. * @type {string}
  1668. */
  1669. var EngineType = SuperMap.EngineType = {
  1670. /** 影像只读引擎类型,文件引擎,针对通用影像格式如 BMP,JPG,TIFF 以及超图自定义影像格式 SIT 等。 */
  1671. IMAGEPLUGINS: "IMAGEPLUGINS",
  1672. /** OGC 引擎类型,针对于 Web 数据源,Web 引擎,目前支持的类型有 WMS,WFS,WCS。 */
  1673. OGC: "OGC",
  1674. /** Oracle 引擎类型,针对 Oracle 数据源,数据库引擎。 */
  1675. ORACLEPLUS: "ORACLEPLUS",
  1676. /** SDB 引擎类型,文件引擎,即 SDB 数据源。 */
  1677. SDBPLUS: "SDBPLUS",
  1678. /** SQL Server 引擎类型,针对 SQL Server 数据源,数据库引擎 */
  1679. SQLPLUS: "SQLPLUS",
  1680. /** UDB 引擎类型,文件引擎。 */
  1681. UDB: "UDB"
  1682. };
  1683. /**
  1684. * @enum ThemeGraphTextFormat
  1685. * @memberOf SuperMap
  1686. * @description 统计专题图文本显示格式枚举。
  1687. * @type {string}
  1688. */
  1689. var ThemeGraphTextFormat = SuperMap.ThemeGraphTextFormat = {
  1690. /** 标题。以各子项的标题来进行标注。 */
  1691. CAPTION: "CAPTION",
  1692. /** 标题 + 百分数。以各子项的标题和所占的百分比来进行标注。 */
  1693. CAPTION_PERCENT: "CAPTION_PERCENT",
  1694. /** 标题 + 实际数值。以各子项的标题和真实数值来进行标注。 */
  1695. CAPTION_VALUE: "CAPTION_VALUE",
  1696. /** 百分数。以各子项所占的百分比来进行标注。 */
  1697. PERCENT: "PERCENT",
  1698. /** 实际数值。以各子项的真实数值来进行标注。 */
  1699. VALUE: "VALUE"
  1700. };
  1701. /**
  1702. * @enum ThemeGraphType
  1703. * @memberOf SuperMap
  1704. * @description 统计专题图类型枚举。
  1705. * @type {string}
  1706. */
  1707. var ThemeGraphType = SuperMap.ThemeGraphType = {
  1708. /** 面积图。 */
  1709. AREA: "AREA",
  1710. /** 柱状图。 */
  1711. BAR: "BAR",
  1712. /** 三维柱状图。 */
  1713. BAR3D: "BAR3D",
  1714. /** 折线图。 */
  1715. LINE: "LINE",
  1716. /** 饼图。 */
  1717. PIE: "PIE",
  1718. /** 三维饼图。 */
  1719. PIE3D: "PIE3D",
  1720. /** 点状图。 */
  1721. POINT: "POINT",
  1722. /** 环状图。 */
  1723. RING: "RING",
  1724. /** 玫瑰图。 */
  1725. ROSE: "ROSE",
  1726. /** 三维玫瑰图。 */
  1727. ROSE3D: "ROSE3D",
  1728. /** 堆叠柱状图。 */
  1729. STACK_BAR: "STACK_BAR",
  1730. /** 三维堆叠柱状图。 */
  1731. STACK_BAR3D: "STACK_BAR3D",
  1732. /** 阶梯图。 */
  1733. STEP: "STEP"
  1734. };
  1735. /**
  1736. * @enum GraphAxesTextDisplayMode
  1737. * @memberOf SuperMap
  1738. * @description 统计专题图坐标轴文本显示模式。
  1739. * @type {string}
  1740. */
  1741. var GraphAxesTextDisplayMode = SuperMap.GraphAxesTextDisplayMode = {
  1742. /** 显示全部文本。 */
  1743. ALL: "ALL",
  1744. /** 不显示。 */
  1745. NONE: "NONE",
  1746. /** 显示Y轴的文本。 */
  1747. YAXES: "YAXES"
  1748. };
  1749. /**
  1750. * @enum GraduatedMode
  1751. * @memberOf SuperMap
  1752. * @description 专题图分级模式枚举。
  1753. *
  1754. * @type {string}
  1755. */
  1756. var GraduatedMode = SuperMap.GraduatedMode = {
  1757. /** 常量分级模式。 */
  1758. CONSTANT: "CONSTANT",
  1759. /** 对数分级模式。 */
  1760. LOGARITHM: "LOGARITHM",
  1761. /** 平方根分级模式。 */
  1762. SQUAREROOT: "SQUAREROOT"
  1763. };
  1764. /**
  1765. * @enum RangeMode
  1766. * @memberOf SuperMap
  1767. * @description 范围分段专题图分段方式枚举。
  1768. * @type {string}
  1769. */
  1770. var RangeMode = SuperMap.RangeMode = {
  1771. /** 自定义分段法。 */
  1772. CUSTOMINTERVAL: "CUSTOMINTERVAL",
  1773. /** 等距离分段法。 */
  1774. EQUALINTERVAL: "EQUALINTERVAL",
  1775. /** 对数分段法。 */
  1776. LOGARITHM: "LOGARITHM",
  1777. /** 等计数分段法。 */
  1778. QUANTILE: "QUANTILE",
  1779. /** 平方根分段法。 */
  1780. SQUAREROOT: "SQUAREROOT",
  1781. /** 标准差分段法。 */
  1782. STDDEVIATION: "STDDEVIATION"
  1783. };
  1784. /**
  1785. * @enum ThemeType
  1786. * @memberOf SuperMap
  1787. * @description 专题图类型枚举。
  1788. * @type {string}
  1789. */
  1790. var ThemeType = SuperMap.ThemeType = {
  1791. /** 点密度专题图。 */
  1792. DOTDENSITY: "DOTDENSITY",
  1793. /** 等级符号专题图。 */
  1794. GRADUATEDSYMBOL: "GRADUATEDSYMBOL",
  1795. /** 统计专题图。 */
  1796. GRAPH: "GRAPH",
  1797. /** 标签专题图。 */
  1798. LABEL: "LABEL",
  1799. /** 分段专题图。 */
  1800. RANGE: "RANGE",
  1801. /** 単值专题图。 */
  1802. UNIQUE: "UNIQUE"
  1803. };
  1804. /**
  1805. * @enum ColorGradientType
  1806. * @memberOf SuperMap
  1807. * @description 渐变颜色枚举。
  1808. * @type {string}
  1809. */
  1810. var ColorGradientType = SuperMap.ColorGradientType = {
  1811. /** 黑白渐变色。 */
  1812. BLACK_WHITE: "BLACKWHITE",
  1813. /** 蓝黑渐变色。 */
  1814. BLUE_BLACK: "BLUEBLACK",
  1815. /** 蓝红渐变色。 */
  1816. BLUE_RED: "BLUERED",
  1817. /** 蓝白渐变色。 */
  1818. BLUE_WHITE: "BLUEWHITE",
  1819. /** 青黑渐变色。 */
  1820. CYAN_BLACK: "CYANBLACK",
  1821. /** 青蓝渐变色。 */
  1822. CYAN_BLUE: "CYANBLUE",
  1823. /** 青绿渐变色。 */
  1824. CYAN_GREEN: "CYANGREEN",
  1825. /** 青白渐变色。 */
  1826. CYAN_WHITE: "CYANWHITE",
  1827. /** 绿黑渐变色。 */
  1828. GREEN_BLACK: "GREENBLACK",
  1829. /** 绿蓝渐变色。 */
  1830. GREEN_BLUE: "GREENBLUE",
  1831. /** 绿橙紫渐变色。 */
  1832. GREEN_ORANGE_VIOLET: "GREENORANGEVIOLET",
  1833. /** 绿红渐变色。 */
  1834. GREEN_RED: "GREENRED",
  1835. /** 蓝红渐变色。 */
  1836. GREEN_WHITE: "GREENWHITE",
  1837. /** 粉黑渐变色。 */
  1838. PINK_BLACK: "PINKBLACK",
  1839. /** 粉蓝渐变色。 */
  1840. PINK_BLUE: "PINKBLUE",
  1841. /** 粉红渐变色。 */
  1842. PINK_RED: "PINKRED",
  1843. /** 粉白渐变色。 */
  1844. PINK_WHITE: "PINKWHITE",
  1845. /** 彩虹色。 */
  1846. RAIN_BOW: "RAINBOW",
  1847. /** 红黑渐变色。 */
  1848. RED_BLACK: "REDBLACK",
  1849. /** 红白渐变色。 */
  1850. RED_WHITE: "REDWHITE",
  1851. /** 光谱渐变。 */
  1852. SPECTRUM: "SPECTRUM",
  1853. /** 地形渐变,用于三维显示效果较好。 */
  1854. TERRAIN: "TERRAIN",
  1855. /** 黄黑渐变色。 */
  1856. YELLOW_BLACK: "YELLOWBLACK",
  1857. /** 黄蓝渐变色。 */
  1858. YELLOW_BLUE: "YELLOWBLUE",
  1859. /** 黄绿渐变色。 */
  1860. YELLOW_GREEN: "YELLOWGREEN",
  1861. /** 黄红渐变色。 */
  1862. YELLOW_RED: "YELLOWRED",
  1863. /** 黄白渐变色。 */
  1864. YELLOW_WHITE: "YELLOWWHITE"
  1865. };
  1866. /**
  1867. * @enum TextAlignment
  1868. * @memberOf SuperMap
  1869. * @description 文本对齐枚举。
  1870. * @type {string}
  1871. */
  1872. var TextAlignment = SuperMap.TextAlignment = {
  1873. /** 左上角对齐。 */
  1874. TOPLEFT: "TOPLEFT",
  1875. /** 顶部居中对齐。 */
  1876. TOPCENTER: "TOPCENTER",
  1877. /** 右上角对齐。 */
  1878. TOPRIGHT: "TOPRIGHT",
  1879. /** 基准线左对齐。 */
  1880. BASELINELEFT: "BASELINELEFT",
  1881. /** 基准线居中对齐。 */
  1882. BASELINECENTER: "BASELINECENTER",
  1883. /** 基准线右对齐。 */
  1884. BASELINERIGHT: "BASELINERIGHT",
  1885. /** 左下角对齐。 */
  1886. BOTTOMLEFT: "BOTTOMLEFT",
  1887. /** 底部居中对齐。 */
  1888. BOTTOMCENTER: "BOTTOMCENTER",
  1889. /** 右下角对齐。 */
  1890. BOTTOMRIGHT: "BOTTOMRIGHT",
  1891. /** 左中对齐。 */
  1892. MIDDLELEFT: "MIDDLELEFT",
  1893. /** 中心对齐。 */
  1894. MIDDLECENTER: "MIDDLECENTER",
  1895. /** 右中对齐。 */
  1896. MIDDLERIGHT: "MIDDLERIGHT"
  1897. };
  1898. /**
  1899. * @enum FillGradientMode
  1900. * @memberOf SuperMap
  1901. * @description 渐变填充风格的渐变类型枚举。
  1902. * @type {string}
  1903. */
  1904. var FillGradientMode = SuperMap.FillGradientMode = {
  1905. /** 无渐变。 */
  1906. NONE: "NONE",
  1907. /** 线性渐变填充。 */
  1908. LINEAR: "LINEAR",
  1909. /** 辐射渐变填充。 */
  1910. RADIAL: "RADIAL",
  1911. /** 圆锥渐变填充。 */
  1912. CONICAL: "CONICAL",
  1913. /** 四角渐变填充。 */
  1914. SQUARE: "SQUARE"
  1915. };
  1916. /**
  1917. * @enum AlongLineDirection
  1918. * @memberOf SuperMap
  1919. * @description 标签沿线标注方向枚举。
  1920. * @type {string}
  1921. */
  1922. var AlongLineDirection = SuperMap.AlongLineDirection = {
  1923. /** 沿线的法线方向放置标签。 */
  1924. NORMAL: "ALONG_LINE_NORMAL",
  1925. /** 从下到上,从左到右放置。 */
  1926. LB_TO_RT: "LEFT_BOTTOM_TO_RIGHT_TOP",
  1927. /** 从上到下,从左到右放置。 */
  1928. LT_TO_RB: "LEFT_TOP_TO_RIGHT_BOTTOM",
  1929. /** 从下到上,从右到左放置。 */
  1930. RB_TO_LT: "RIGHT_BOTTOM_TO_LEFT_TOP",
  1931. /** 从上到下,从右到左放置。 */
  1932. RT_TO_LB: "RIGHT_TOP_TO_LEFT_BOTTOM"
  1933. };
  1934. /**
  1935. * @enum LabelBackShape
  1936. * @memberOf SuperMap
  1937. * @description 标签专题图中标签背景的形状枚举。
  1938. * @type {string}
  1939. */
  1940. var LabelBackShape = SuperMap.LabelBackShape = {
  1941. /** 菱形背景,即标签背景的形状为菱形。 */
  1942. DIAMOND: "DIAMOND",
  1943. /** 椭圆形背景,即标签背景的行状为椭圆形。 */
  1944. ELLIPSE: "ELLIPSE",
  1945. /** 符号背景,即标签背景的形状为设定的符号。 */
  1946. MARKER: "MARKER",
  1947. /** 空背景,即不使用任何形状作为标签的背景。 */
  1948. NONE: "NONE",
  1949. /** 矩形背景,即标签背景的形状为矩形。 */
  1950. RECT: "RECT",
  1951. /** 圆角矩形背景,即标签背景的形状为圆角矩形。 */
  1952. ROUNDRECT: "ROUNDRECT",
  1953. /** 三角形背景,即标签背景的形状为三角形。 */
  1954. TRIANGLE: "TRIANGLE"
  1955. };
  1956. /**
  1957. * @enum LabelOverLengthMode
  1958. * @memberOf SuperMap
  1959. * @description 标签专题图中超长标签的处理模式枚举。
  1960. * @type {string}
  1961. */
  1962. var LabelOverLengthMode = SuperMap.LabelOverLengthMode = {
  1963. /** 换行显示。 */
  1964. NEWLINE: "NEWLINE",
  1965. /** 对超长标签不进行处理。 */
  1966. NONE: "NONE",
  1967. /** 省略超出部分。 */
  1968. OMIT: "OMIT"
  1969. };
  1970. /**
  1971. * @enum DirectionType
  1972. * @memberOf SuperMap
  1973. * @description 网络分析中方向枚举。
  1974. * 在行驶引导子项中使用。
  1975. * @type {string}
  1976. */
  1977. var DirectionType = SuperMap.DirectionType = {
  1978. /** 东。 */
  1979. EAST: "EAST",
  1980. /** 无方向。 */
  1981. NONE: "NONE",
  1982. /** 北。 */
  1983. NORTH: "NORTH",
  1984. /** 南。 */
  1985. SOURTH: "SOURTH",
  1986. /** 西。 */
  1987. WEST: "WEST"
  1988. };
  1989. /**
  1990. * @enum SideType
  1991. * @memberOf SuperMap
  1992. * @description 行驶位置枚举。
  1993. * 表示在行驶在路的左边、右边或者路上的枚举,该类用在行驶导引子项类中。
  1994. * @type {string}
  1995. */
  1996. var SideType = SuperMap.SideType = {
  1997. /** 路的左侧。 */
  1998. LEFT: "LEFT",
  1999. /** 在路上(即路的中间)。 */
  2000. MIDDLE: "MIDDLE",
  2001. /** 无效值。 */
  2002. NONE: "NONE",
  2003. /** 路的右侧。 */
  2004. RIGHT: "RIGHT"
  2005. };
  2006. /**
  2007. * @enum SupplyCenterType
  2008. * @memberOf SuperMap
  2009. * @description 资源供给中心类型枚举。
  2010. * 该枚举定义了网络分析中资源中心点的类型,主要用于资源分配和选址分区。
  2011. * 资源供给中心点的类型包括非中心,固定中心和可选中心。固定中心用于资源分配分析; 固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  2012. * @type {string}
  2013. */
  2014. var SupplyCenterType = SuperMap.SupplyCenterType = {
  2015. /** 固定中心点。 */
  2016. FIXEDCENTER: "FIXEDCENTER",
  2017. /** 非中心点。 */
  2018. NULL: "NULL",
  2019. /** 可选中心点。 */
  2020. OPTIONALCENTER: "OPTIONALCENTER"
  2021. };
  2022. /**
  2023. * @enum TurnType
  2024. * @memberOf SuperMap
  2025. * @description 转弯方向枚举。
  2026. * 用在行驶引导子项类中,表示转弯的方向。
  2027. * @type {string}
  2028. */
  2029. var TurnType = SuperMap.TurnType = {
  2030. /** 向前直行。 */
  2031. AHEAD: "AHEAD",
  2032. /** 掉头。 */
  2033. BACK: "BACK",
  2034. /** 终点,不拐弯。 */
  2035. END: "END",
  2036. /** 左转弯。 */
  2037. LEFT: "LEFT",
  2038. /** 无效值。 */
  2039. NONE: "NONE",
  2040. /** 右转弯。 */
  2041. RIGHT: "RIGHT"
  2042. };
  2043. /**
  2044. * @enum BufferEndType
  2045. * @memberOf SuperMap
  2046. * @description 缓冲区分析BufferEnd类型。
  2047. * @type {string}
  2048. */
  2049. var BufferEndType = SuperMap.BufferEndType = {
  2050. /** FLAT */
  2051. FLAT: "FLAT",
  2052. /** ROUND */
  2053. ROUND: "ROUND"
  2054. };
  2055. /**
  2056. * @enum OverlayOperationType
  2057. * @memberOf SuperMap
  2058. * @description 叠加分析类型枚举。
  2059. * @type {string}
  2060. */
  2061. var OverlayOperationType = SuperMap.OverlayOperationType = {
  2062. /** 操作数据集(几何对象)裁剪被操作数据集(几何对象)。 */
  2063. CLIP: "CLIP",
  2064. /** 在被操作数据集(几何对象)上擦除掉与操作数据集(几何对象)相重合的部分。 */
  2065. ERASE: "ERASE",
  2066. /**对被操作数据集(几何对象)进行同一操作,即操作执行后,被操作数据集(几何对象)包含来自操作数据集(几何对象)的几何形状。 */
  2067. IDENTITY: "IDENTITY",
  2068. /** 对两个数据集(几何对象)求交,返回两个数据集(几何对象)的交集。 */
  2069. INTERSECT: "INTERSECT",
  2070. /** 对两个面数据集(几何对象)进行合并操作。 */
  2071. UNION: "UNION",
  2072. /** 对两个面数据集(几何对象)进行更新操作。 */
  2073. UPDATE: "UPDATE",
  2074. /** 对两个面数据集(几何对象)进行对称差操作。 */
  2075. XOR: "XOR"
  2076. };
  2077. /**
  2078. * @enum OutputType
  2079. * @memberOf SuperMap
  2080. * @description 分布式分析输出类型枚举。
  2081. * @type {string}
  2082. */
  2083. var OutputType = SuperMap.OutputType = {
  2084. /** INDEXEDHDFS */
  2085. INDEXEDHDFS: "INDEXEDHDFS",
  2086. /** UDB */
  2087. UDB: "UDB",
  2088. /** MONGODB */
  2089. MONGODB: "MONGODB",
  2090. /** PG */
  2091. PG: "PG"
  2092. };
  2093. /**
  2094. * @enum SmoothMethod
  2095. * @memberOf SuperMap
  2096. * @description 光滑方法枚举。
  2097. * 用于从Grid 或DEM数据生成等值线或等值面时对等值线或者等值面的边界线进行平滑处理的方法。
  2098. * @type {string}
  2099. */
  2100. var SmoothMethod = SuperMap.SmoothMethod = {
  2101. /** B 样条法。 */
  2102. BSPLINE: "BSPLINE",
  2103. /** 磨角法。 */
  2104. POLISH: "POLISH"
  2105. };
  2106. /**
  2107. * @enum SurfaceAnalystMethod
  2108. * @memberOf SuperMap
  2109. * @description 表面分析方法枚举。
  2110. * 通过对数据进行表面分析,能够挖掘原始数据所包含的信息,使某些细节明显化,易于分析。
  2111. * @type {string}
  2112. */
  2113. var SurfaceAnalystMethod = SuperMap.SurfaceAnalystMethod = {
  2114. /** 等值线提取。 */
  2115. ISOLINE: "ISOLINE",
  2116. /** 等值面提取。 */
  2117. ISOREGION: "ISOREGION"
  2118. };
  2119. /**
  2120. * @enum DataReturnMode
  2121. * @memberOf SuperMap
  2122. * @description 数据返回模式枚举。
  2123. * 该枚举用于指定空间分析返回结果模式,包含返回数据集标识和记录集、只返回数据集标识(数据集名称@数据源名称)及只返回记录集三种模式。
  2124. * @type {string}
  2125. */
  2126. var DataReturnMode = SuperMap.DataReturnMode = {
  2127. /** 返回结果数据集标识(数据集名称@数据源名称)和记录集(RecordSet)。 */
  2128. DATASET_AND_RECORDSET: "DATASET_AND_RECORDSET",
  2129. /** 只返回数据集标识(数据集名称@数据源名称)。 */
  2130. DATASET_ONLY: "DATASET_ONLY",
  2131. /** 只返回记录集(RecordSet)。 */
  2132. RECORDSET_ONLY: "RECORDSET_ONLY"
  2133. };
  2134. /**
  2135. * @enum EditType
  2136. * @memberOf SuperMap
  2137. * @description 要素集更新模式枚举。
  2138. * 该枚举用于指定数据服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  2139. * @type {string}
  2140. */
  2141. var EditType = SuperMap.EditType = {
  2142. /** 增加操作。 */
  2143. ADD: "add",
  2144. /** 修改操作。 */
  2145. UPDATE: "update",
  2146. /** 删除操作。 */
  2147. DELETE: "delete"
  2148. };
  2149. /**
  2150. * @enum TransferTactic
  2151. * @memberOf SuperMap
  2152. * @description 公交换乘策略枚举。
  2153. * 该枚举用于指定公交服务中要素集更新模式,包含添加要素集、更新要素集和删除要素集。
  2154. * @type {string}
  2155. */
  2156. var TransferTactic = SuperMap.TransferTactic = {
  2157. /** 时间短。 */
  2158. LESS_TIME: "LESS_TIME",
  2159. /** 少换乘。 */
  2160. LESS_TRANSFER: "LESS_TRANSFER",
  2161. /** 少步行。 */
  2162. LESS_WALK: "LESS_WALK",
  2163. /** 距离最短。 */
  2164. MIN_DISTANCE: "MIN_DISTANCE"
  2165. };
  2166. /**
  2167. * @enum TransferPreference
  2168. * @memberOf SuperMap
  2169. * @description 公交换乘策略枚举。
  2170. * 该枚举用于指定交通换乘服务中设置地铁优先、公交优先、不乘地铁、无偏好等偏好设置。
  2171. * @type {string}
  2172. */
  2173. var TransferPreference = SuperMap.TransferPreference = {
  2174. /** 公交汽车优先。 */
  2175. BUS: "BUS",
  2176. /** 地铁优先。 */
  2177. SUBWAY: "SUBWAY",
  2178. /** 不乘坐地铁。 */
  2179. NO_SUBWAY: "NO_SUBWAY",
  2180. /** 无乘车偏好。 */
  2181. NONE: "NONE"
  2182. };
  2183. /**
  2184. * @enum GridType
  2185. * @memberOf SuperMap
  2186. * @description 地图背景格网类型枚举。
  2187. * @type {string}
  2188. */
  2189. var GridType = SuperMap.GridType = {
  2190. /** 十字叉丝。 */
  2191. CROSS: "CROSS",
  2192. /** 网格线。 */
  2193. GRID: "GRID",
  2194. /** 点。 */
  2195. POINT: "POINT"
  2196. };
  2197. /**
  2198. * @enum ColorSpaceType
  2199. * @memberOf SuperMap
  2200. * @description 色彩空间枚举。
  2201. * 由于成色原理的不同,决定了显示器、投影仪这类靠色光直接合成颜色的颜色设备和打印机、
  2202. * 印刷机这类靠使用颜料的印刷设备在生成颜色方式上的区别。
  2203. * 针对上述不同成色方式,SuperMap 提供两种色彩空间,
  2204. * 分别为 RGB 和 CMYK。RGB 主要用于显示系统中,CMYK 主要用于印刷系统中。
  2205. * @type {string}
  2206. */
  2207. var ColorSpaceType = SuperMap.ColorSpaceType = {
  2208. /** 该类型主要在印刷系统使用。 */
  2209. CMYK: "CMYK",
  2210. /** 该类型主要在显示系统中使用。 */
  2211. RGB: "RGB"
  2212. };
  2213. /**
  2214. * @enum LayerType
  2215. * @memberOf SuperMap
  2216. * @description 图层类型。
  2217. * @type {string}
  2218. */
  2219. var LayerType = SuperMap.LayerType = {
  2220. /** SuperMap UGC 类型图层。如矢量图层、栅格(Grid)图层、影像图层。 */
  2221. UGC: "UGC",
  2222. /** WMS 图层。 */
  2223. WMS: "WMS",
  2224. /** WFS 图层。 */
  2225. WFS: "WFS",
  2226. /** 自定义图层。 */
  2227. CUSTOM: "CUSTOM"
  2228. };
  2229. /**
  2230. * @enum UGCLayerType
  2231. * @memberOf SuperMap
  2232. * @description UGC图层类型。
  2233. * @type {string}
  2234. */
  2235. var UGCLayerType = SuperMap.UGCLayerType = {
  2236. /** 专题图层。 */
  2237. THEME: "THEME",
  2238. /** 矢量图层。 */
  2239. VECTOR: "VECTOR",
  2240. /** 栅格图层。。 */
  2241. GRID: "GRID",
  2242. /** 影像图层。 */
  2243. IMAGE: "IMAGE"
  2244. };
  2245. /**
  2246. * @enum StatisticMode
  2247. * @memberOf SuperMap
  2248. * @description 字段统计方法类型。
  2249. * @type {string}
  2250. */
  2251. var StatisticMode = SuperMap.StatisticMode = {
  2252. /** 统计所选字段的平均值。 */
  2253. AVERAGE: "AVERAGE",
  2254. /** 统计所选字段的最大值。 */
  2255. MAX: "MAX",
  2256. /** 统计所选字段的最小值。 */
  2257. MIN: "MIN",
  2258. /** 统计所选字段的标准差 */
  2259. STDDEVIATION: "STDDEVIATION",
  2260. /** 统计所选字段的总和。 */
  2261. SUM: "SUM",
  2262. /** 统计所选字段的方差。 */
  2263. VARIANCE: "VARIANCE"
  2264. };
  2265. /**
  2266. * @enum PixelFormat
  2267. * @memberOf SuperMap
  2268. * @description 栅格与影像数据存储的像素格式枚举。
  2269. * @type {string}
  2270. */
  2271. var PixelFormat = SuperMap.PixelFormat = {
  2272. /** 每个像元用16个比特(即2个字节)表示。 */
  2273. BIT16: "BIT16",
  2274. /** 每个像元用32个比特(即4个字节)表示。 */
  2275. BIT32: "BIT32",
  2276. /** 每个像元用64个比特(即8个字节)表示,只提供给栅格数据集使用。 */
  2277. BIT64: "BIT64",
  2278. /** 每个像元用4个字节来表示,只提供给栅格数据集使用。 */
  2279. SINGLE: "SINGLE",
  2280. /** 每个像元用8个字节来表示,只提供给栅格数据集使用。 */
  2281. DOUBLE: "DOUBLE",
  2282. /** 每个像元用1个比特表示。 */
  2283. UBIT1: "UBIT1",
  2284. /** 每个像元用4个比特来表示。 */
  2285. UBIT4: "UBIT4",
  2286. /** 每个像元用8个比特(即1个字节)来表示。 */
  2287. UBIT8: "UBIT8",
  2288. /** 每个像元用24个比特(即3个字节)来表示。 */
  2289. UBIT24: "UBIT24",
  2290. /** 每个像元用32个比特(即4个字节)来表示。 */
  2291. UBIT32: "UBIT32"
  2292. };
  2293. /**
  2294. * @enum SearchMode
  2295. * @memberOf SuperMap
  2296. * @description 内插时使用的样本点的查找方式枚举
  2297. * @type {string}
  2298. */
  2299. var SearchMode = SuperMap.SearchMode = {
  2300. /** 使用 KDTREE 的固定点数方式查找参与内插分析的点。 */
  2301. KDTREE_FIXED_COUNT: "KDTREE_FIXED_COUNT",
  2302. /** 使用 KDTREE 的定长方式查找参与内插分析的点。 */
  2303. KDTREE_FIXED_RADIUS: "KDTREE_FIXED_RADIUS",
  2304. /** 不进行查找,使用所有的输入点进行内插分析。 */
  2305. NONE: "NONE",
  2306. /** 使用 QUADTREE 方式查找参与内插分析的点,仅对样条(RBF)插值和普通克吕金(Kriging)有用。 */
  2307. QUADTREE: "QUADTREE"
  2308. };
  2309. /**
  2310. * @enum InterpolationAlgorithmType
  2311. * @memberOf SuperMap
  2312. * @description 插值分析的算法的类型
  2313. * @type {string}
  2314. */
  2315. var InterpolationAlgorithmType = SuperMap.InterpolationAlgorithmType = {
  2316. /** 普通克吕金插值法。 */
  2317. KRIGING: "KRIGING",
  2318. /** 简单克吕金插值法。 */
  2319. SimpleKriging: "SimpleKriging",
  2320. /** 泛克吕金插值法。 */
  2321. UniversalKriging: "UniversalKriging"
  2322. };
  2323. /**
  2324. * @enum VariogramMode
  2325. * @memberOf SuperMap
  2326. * @description 克吕金(Kriging)插值时的半变函数类型枚举
  2327. * @type {string}
  2328. */
  2329. var VariogramMode = SuperMap.VariogramMode = {
  2330. /** 指数函数。 */
  2331. EXPONENTIAL: "EXPONENTIAL",
  2332. /** 高斯函数。 */
  2333. GAUSSIAN: "GAUSSIAN",
  2334. /** 球型函数。 */
  2335. SPHERICAL: "SPHERICAL"
  2336. };
  2337. /**
  2338. * @enum Exponent
  2339. * @memberOf SuperMap
  2340. * @description 定义了泛克吕金(UniversalKriging)插值时样点数据中趋势面方程的阶数
  2341. * @type {string}
  2342. */
  2343. var Exponent = SuperMap.Exponent = {
  2344. /** 阶数为1。 */
  2345. EXP1: "EXP1",
  2346. /** 阶数为2。 */
  2347. EXP2: "EXP2"
  2348. };
  2349. /**
  2350. * @enum ClientType
  2351. * @memberOf SuperMap
  2352. * @description token申请的客户端标识类型
  2353. * @type {string}
  2354. */
  2355. var ClientType = SuperMap.ClientType = {
  2356. /** 指定的 IP 地址。 */
  2357. IP: "IP",
  2358. /** 指定的 URL。 */
  2359. REFERER: "Referer",
  2360. /** 发送申请令牌请求的客户端 IP。 */
  2361. REQUESTIP: "RequestIP",
  2362. /** 不做任何验证。 */
  2363. NONE: "NONE",
  2364. /** SERVER。 */
  2365. SERVER: "SERVER",
  2366. /** WEB。 */
  2367. WEB: "WEB"
  2368. };
  2369. /**
  2370. * @enum ChartType
  2371. * @memberOf SuperMap
  2372. * @description 客户端专题图图表类型
  2373. * @type {string}
  2374. */
  2375. var ChartType = SuperMap.ChartType = {
  2376. /** 柱状图。 */
  2377. BAR: "Bar",
  2378. /** 三维柱状图。 */
  2379. BAR3D: "Bar3D",
  2380. /** 圆形图。 */
  2381. CIRCLE: "Circle",
  2382. /** 饼图。 */
  2383. PIE: "Pie",
  2384. /** 散点图。 */
  2385. POINT: "Point",
  2386. /** 折线图。 */
  2387. LINE: "Line",
  2388. /** 环状图。 */
  2389. RING: "Ring"
  2390. };
  2391. /**
  2392. * @enum ClipAnalystMode
  2393. * @memberOf SuperMap
  2394. * @description 裁剪分析模式
  2395. * @type {string}
  2396. */
  2397. var ClipAnalystMode = SuperMap.ClipAnalystMode = {
  2398. /** CLIP。 */
  2399. CLIP: "clip",
  2400. /** INTERSECT。 */
  2401. INTERSECT: "intersect"
  2402. };
  2403. /**
  2404. * @enum AnalystAreaUnit
  2405. * @memberOf SuperMap
  2406. * @description 分布式分析面积单位
  2407. * @type {string}
  2408. */
  2409. var AnalystAreaUnit = SuperMap.AnalystAreaUnit = {
  2410. /** 平方米。 */
  2411. "SQUAREMETER": "SquareMeter",
  2412. /** 平方千米。 */
  2413. "SQUAREKILOMETER": "SquareKiloMeter",
  2414. /** 公顷。 */
  2415. "HECTARE": "Hectare",
  2416. /** 公亩。 */
  2417. "ARE": "Are",
  2418. /** 英亩。 */
  2419. "ACRE": "Acre",
  2420. /** 平方英尺。 */
  2421. "SQUAREFOOT": "SquareFoot",
  2422. /** 平方码。 */
  2423. "SQUAREYARD": "SquareYard",
  2424. /** 平方英里。 */
  2425. "SQUAREMILE": "SquareMile"
  2426. };
  2427. /**
  2428. * @enum AnalystSizeUnit
  2429. * @memberOf SuperMap
  2430. * @description 分布式分析单位
  2431. * @type {string}
  2432. */
  2433. var AnalystSizeUnit = SuperMap.AnalystSizeUnit = {
  2434. /** 米。 */
  2435. "METER": "Meter",
  2436. /** 千米。 */
  2437. "KILOMETER": "Kilometer",
  2438. /** 码。 */
  2439. "YARD": "Yard",
  2440. /** 英尺。 */
  2441. "FOOT": "Foot",
  2442. /** 英里。 */
  2443. "MILE": "Mile"
  2444. };
  2445. /**
  2446. * @enum StatisticAnalystMode
  2447. * @memberOf SuperMap
  2448. * @description 分布式分析统计模式
  2449. * @type {string}
  2450. */
  2451. var StatisticAnalystMode = SuperMap.StatisticAnalystMode = {
  2452. /** 统计所选字段的最大值。 */
  2453. "MAX": "max",
  2454. /** 统计所选字段的最小值。 */
  2455. "MIN": "min",
  2456. /** 统计所选字段的平均值。 */
  2457. "AVERAGE": "average",
  2458. /** 统计所选字段的总和。 */
  2459. "SUM": "sum",
  2460. /** 统计所选字段的方差。 */
  2461. "VARIANCE": "variance",
  2462. /** 统计所选字段的标准差 */
  2463. "STDDEVIATION": "stdDeviation"
  2464. };
  2465. /**
  2466. * @enum SummaryType
  2467. * @memberOf SuperMap
  2468. * @description 分布式分析聚合类型
  2469. * @type {string}
  2470. */
  2471. var SummaryType = SuperMap.SummaryType = {
  2472. /** 格网聚合。 */
  2473. "SUMMARYMESH": "SUMMARYMESH",
  2474. /** 多边形聚合。 */
  2475. "SUMMARYREGION": "SUMMARYREGION"
  2476. };
  2477. /**
  2478. * @enum TopologyValidatorRule
  2479. * @memberOf SuperMap
  2480. * @description 拓扑检查模式枚举。该类定义了拓扑检查操作模式常量。
  2481. * @type {string}
  2482. */
  2483. var TopologyValidatorRule = SuperMap.TopologyValidatorRule = {
  2484. /** 面内无重叠,用于对面数据进行拓扑检查。 */
  2485. REGIONNOOVERLAP: "REGIONNOOVERLAP",
  2486. /** 面与面无重叠,用于对面数据进行拓扑检查。 */
  2487. REGIONNOOVERLAPWITH: "REGIONNOOVERLAPWITH",
  2488. /** 面被面包含,用于对面数据进行拓扑检查。 */
  2489. REGIONCONTAINEDBYREGION: "REGIONCONTAINEDBYREGION",
  2490. /** 面被面覆盖,用于对面数据进行拓扑检查。 */
  2491. REGIONCOVEREDBYREGION: "REGIONCOVEREDBYREGION",
  2492. /** 线与线无重叠,用于对线数据进行拓扑检查。 */
  2493. LINENOOVERLAP: "LINENOOVERLAP",
  2494. /** 线内无重叠,用于对线数据进行拓扑检查。 */
  2495. LINENOOVERLAPWITH: "LINENOOVERLAPWITH",
  2496. /** 点不相同,用于对点数据进行拓扑检查。 */
  2497. POINTNOIDENTICAL: "POINTNOIDENTICAL"
  2498. };
  2499. /**
  2500. * @enum AggregationType
  2501. * @memberOf SuperMap
  2502. * @description 聚合查询枚举类,该类定义了Es数据服务中聚合查询模式常量
  2503. * @type {string}
  2504. */
  2505. var AggregationType = SuperMap.AggregationType = {
  2506. /** 格网聚合类型。 */
  2507. GEOHASH_GRID: "geohash_grid",
  2508. /** 过滤聚合类型。 */
  2509. FILTER: "filter"
  2510. };
  2511. /**
  2512. * @enum AggregationType
  2513. * @memberOf SuperMap
  2514. * @description 聚合查询中filter查询枚举类
  2515. * @type {string}
  2516. */
  2517. var AggregationQueryBuilderType = SuperMap.AggregationQueryBuilderType = {
  2518. /** 范围查询。 */
  2519. GEO_BOUNDING_BOX: "geo_bounding_box"
  2520. };
  2521. /**
  2522. * @enum GetFeatureMode
  2523. * @memberOf SuperMap
  2524. * @description feature 查询方式。
  2525. * @type {string}
  2526. */
  2527. var GetFeatureMode = SuperMap.GetFeatureMode = {
  2528. /** 通过范围查询来获取要素。 */
  2529. BOUNDS: "BOUNDS",
  2530. /** 通过几何对象的缓冲区来获取要素。 */
  2531. BUFFER: "BUFFER",
  2532. /** 通过 ID 来获取要素。 */
  2533. ID: "ID",
  2534. /** 通过空间查询模式来获取要素。 */
  2535. SPATIAL: "SPATIAL",
  2536. /** 通过 SQL 查询来获取要素。 */
  2537. SQL: 'SQL'
  2538. };
  2539. /**
  2540. * @enum RasterFunctionType
  2541. * @memberOf SuperMap
  2542. * @description 栅格分析方法。
  2543. * @type {string}
  2544. */
  2545. var RasterFunctionType = SuperMap.RasterFunctionType = {
  2546. /** 归一化植被指数。 */
  2547. NDVI: "NDVI",
  2548. /** 阴影面分析。 */
  2549. HILLSHADE: "HILLSHADE"
  2550. };
  2551. /**
  2552. * @enum ResourceType
  2553. * @memberOf SuperMap
  2554. * @description iportal资源类型。
  2555. * @version 10.0.1
  2556. * @type {string}
  2557. */
  2558. var ResourceType = SuperMap.ResourceType = {
  2559. /** 地图。 */
  2560. MAP: "MAP",
  2561. /** 服务。 */
  2562. SERVICE: "SERVICE",
  2563. /** 场景。 */
  2564. SCENE: "SCENE",
  2565. /** 数据。 */
  2566. DATA: "DATA",
  2567. /** 洞察。 */
  2568. INSIGHTS_WORKSPACE: "INSIGHTS_WORKSPACE",
  2569. /** 大屏。 */
  2570. MAP_DASHBOARD: "MAP_DASHBOARD"
  2571. };
  2572. /**
  2573. * @enum OrderBy
  2574. * @memberOf SuperMap
  2575. * @description iportal资源排序字段。
  2576. * @version 10.0.1
  2577. * @type {string}
  2578. */
  2579. var OrderBy = SuperMap.OrderBy = {
  2580. /** 按更新时间排序 */
  2581. UPDATETIME: "UPDATETIME",
  2582. /** 按热度(可能是访问量、下载量)排序 */
  2583. HEATLEVEL: "HEATLEVEL",
  2584. /** 按相关性排序 */
  2585. RELEVANCE: "RELEVANCE"
  2586. };
  2587. /**
  2588. * @enum OrderType
  2589. * @memberOf SuperMap
  2590. * @description iportal资源升序还是降序过滤
  2591. * @version 10.0.1
  2592. * @type {string}
  2593. */
  2594. var OrderType = SuperMap.OrderType = {
  2595. /** 升序 */
  2596. ASC: "ASC",
  2597. /** 降序 */
  2598. DESC: "DESC"
  2599. };
  2600. /**
  2601. * @enum SearchType
  2602. * @memberOf SuperMap
  2603. * @description iportal资源查询的范围进行过滤
  2604. * @version 10.0.1
  2605. * @type {string}
  2606. */
  2607. var SearchType = SuperMap.SearchType = {
  2608. /** 公开资源。 */
  2609. PUBLIC: "PUBLIC",
  2610. /** 我的资源。 */
  2611. MY_RES: "MY_RES",
  2612. /** 我的群组资源。 */
  2613. MYGROUP_RES: "MYGROUP_RES",
  2614. /** 我的部门资源。 */
  2615. MYDEPARTMENT_RES: "MYDEPARTMENT_RES",
  2616. /** 分享给我的资源。 */
  2617. SHARETOME_RES: "SHARETOME_RES"
  2618. };
  2619. /**
  2620. * @enum AggregationTypes
  2621. * @memberOf SuperMap
  2622. * @description iportal资源聚合查询的类型
  2623. * @version 10.0.1
  2624. * @type {string}
  2625. */
  2626. var AggregationTypes = SuperMap.AggregationTypes = {
  2627. /** 标签 */
  2628. TAG: "TAG",
  2629. /** 资源类型 */
  2630. TYPE: "TYPE"
  2631. };
  2632. /**
  2633. * @enum PermissionType
  2634. * @memberOf SuperMap
  2635. * @description iportal资源权限类型。
  2636. * @version 10.0.1
  2637. * @type {string}
  2638. */
  2639. var PermissionType = SuperMap.PermissionType = {
  2640. /** 可检索 */
  2641. SEARCH: "SEARCH",
  2642. /** 可查看 */
  2643. READ: "READ",
  2644. /** 可编辑 */
  2645. READWRITE: "READWRITE",
  2646. /** 可删除 */
  2647. DELETE: "DELETE",
  2648. /** 可下载,包括可读、可检索 */
  2649. DOWNLOAD: "DOWNLOAD"
  2650. };
  2651. /**
  2652. * @enum EntityType
  2653. * @memberOf SuperMap
  2654. * @description iportal资源实体类型。
  2655. * @version 10.0.1
  2656. * @type {string}
  2657. */
  2658. var EntityType = SuperMap.EntityType = {
  2659. /** 部门 */
  2660. DEPARTMENT: "DEPARTMENT",
  2661. /** 用户组 */
  2662. GROUP: "GROUP",
  2663. /** 群组 */
  2664. IPORTALGROUP: "IPORTALGROUP",
  2665. /** 角色 */
  2666. ROLE: "ROLE",
  2667. /** 用户 */
  2668. USER: "USER"
  2669. };
  2670. /**
  2671. * @enum DataItemType
  2672. * @memberOf SuperMap
  2673. * @description iportal数据类型。
  2674. * @version 10.0.1
  2675. * @type {string}
  2676. */
  2677. var DataItemType = SuperMap.DataItemType = {
  2678. /** 工作空间 sxwu, smwu, sxw, smw */
  2679. WORKSPACE: "WORKSPACE",
  2680. /** udb 数据源 */
  2681. UDB: "UDB",
  2682. /** shp空间数据 */
  2683. SHP: "SHP",
  2684. /** excel数据 */
  2685. EXCEL: "EXCEL",
  2686. /** csv数据 */
  2687. CSV: "CSV",
  2688. /** geojson数据。 */
  2689. GEOJSON: "GEOJSON",
  2690. /** smtiles */
  2691. SMTILES: "SMTILES",
  2692. /** svtiles */
  2693. SVTILES: "SVTILES",
  2694. /** mbtiles */
  2695. MBTILES: "MBTILES",
  2696. /** tpk */
  2697. TPK: "TPK",
  2698. /** ugc v5 */
  2699. UGCV5: "UGCV5",
  2700. /** UGCV5_MVT */
  2701. UGCV5_MVT: "UGCV5_MVT",
  2702. /** json数据 */
  2703. JSON: "JSON"
  2704. };
  2705. /**
  2706. * @enum WebExportFormatType
  2707. * @memberOf SuperMap
  2708. * @description Web 打印输出的格式。
  2709. * @version 10.0.1
  2710. * @type {string}
  2711. */
  2712. var WebExportFormatType = SuperMap.WebExportFormatType = {
  2713. /** png */
  2714. PNG: "PNG",
  2715. /** pdf */
  2716. PDF: "PDF"
  2717. };
  2718. /**
  2719. * @enum WebScaleOrientationType
  2720. * @memberOf SuperMap
  2721. * @description Web 比例尺的方位样式。
  2722. * @version 10.0.1
  2723. * @type {string}
  2724. */
  2725. var WebScaleOrientationType = SuperMap.WebScaleOrientationType = {
  2726. /** horizontal labels below */
  2727. HORIZONTALLABELSBELOW: "HORIZONTALLABELSBELOW",
  2728. /** horizontal labels above */
  2729. HORIZONTALLABELSABOVE: "HORIZONTALLABELSABOVE",
  2730. /** vertical labels left */
  2731. VERTICALLABELSLEFT: "VERTICALLABELSLEFT",
  2732. /** vertical labels right */
  2733. VERTICALLABELSRIGHT: "VERTICALLABELSRIGHT"
  2734. };
  2735. /**
  2736. * @enum WebScaleType
  2737. * @memberOf SuperMap
  2738. * @description Web 比例尺的样式。
  2739. * @version 10.0.1
  2740. * @type {string}
  2741. */
  2742. var WebScaleType = SuperMap.WebScaleType = {
  2743. /** line */
  2744. LINE: "LINE",
  2745. /** bar */
  2746. BAR: "BAR",
  2747. /** bar sub */
  2748. BAR_SUB: "BAR_SUB"
  2749. };
  2750. /**
  2751. * @enum WebScaleUnit
  2752. * @memberOf SuperMap
  2753. * @description Web 比例尺的单位制。
  2754. * @version 10.0.1
  2755. * @type {string}
  2756. */
  2757. var WebScaleUnit = SuperMap.WebScaleUnit = {
  2758. /** meter */
  2759. METER: "METER",
  2760. /** foot */
  2761. FOOT: "FOOT",
  2762. /** degrees */
  2763. DEGREES: "DEGREES"
  2764. };
  2765. ;// CONCATENATED MODULE: ./src/common/commontypes/Size.js
  2766. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2767. 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); } }
  2768. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  2769. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  2770. * This program are made available under the terms of the Apache License, Version 2.0
  2771. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2772. /**
  2773. * @class SuperMap.Size
  2774. * @category BaseTypes Style
  2775. * @classdesc 此类描绘一对高宽值的实例。
  2776. * @param {number} [w=0.0] - 宽度。
  2777. * @param {number} [h=0.0] - 高度。
  2778. *
  2779. * @example
  2780. * var size = new SuperMap.Size(31,46);
  2781. */
  2782. var Size = /*#__PURE__*/function () {
  2783. function Size(w, h) {
  2784. _classCallCheck(this, Size);
  2785. /**
  2786. * @member {number} [SuperMap.Size.prototype.w=0.0]
  2787. * @description 宽度。
  2788. */
  2789. this.w = w ? parseFloat(w) : 0.0;
  2790. /**
  2791. * @member {number} [SuperMap.Size.prototype.h=0.0]
  2792. * @description 高度。
  2793. */
  2794. this.h = w ? parseFloat(h) : 0.0;
  2795. this.CLASS_NAME = "SuperMap.Size";
  2796. }
  2797. /**
  2798. * @function SuperMap.Size.prototype.toString
  2799. * @description 返回此对象的字符串形式。
  2800. * @example
  2801. * var size = new SuperMap.Size(10,5);
  2802. * var str = size.toString();
  2803. * @returns {string} 例如:"w=10,h=5"。
  2804. */
  2805. _createClass(Size, [{
  2806. key: "toString",
  2807. value: function toString() {
  2808. return "w=" + this.w + ",h=" + this.h;
  2809. }
  2810. /**
  2811. * @function SuperMap.Size.prototype.clone
  2812. * @description 克隆当前size对象。
  2813. * @example
  2814. * var size = new SuperMap.Size(31,46);
  2815. * var size2 = size.clone();
  2816. * @returns {SuperMap.Size} 返回一个新的与当前 size 对象有相同宽、高的 Size 对象。
  2817. */
  2818. }, {
  2819. key: "clone",
  2820. value: function clone() {
  2821. return new Size(this.w, this.h);
  2822. }
  2823. /**
  2824. *
  2825. * @function SuperMap.Size.prototype.equals
  2826. * @description 比较两个 size 对象是否相等。
  2827. * @example
  2828. * var size = new SuperMap.Size(31,46);
  2829. * var size2 = new SuperMap.Size(31,46);
  2830. * var isEquals = size.equals(size2);
  2831. *
  2832. * @param {SuperMap.Size} sz - 用于比较相等的 Size 对象。
  2833. * @returns {boolean} 传入的 size 和当前 size 高宽相等,注意:如果传入的 size 为空则返回 false。
  2834. *
  2835. */
  2836. }, {
  2837. key: "equals",
  2838. value: function equals(sz) {
  2839. var equals = false;
  2840. if (sz != null) {
  2841. equals = this.w === sz.w && this.h === sz.h || isNaN(this.w) && isNaN(this.h) && isNaN(sz.w) && isNaN(sz.h);
  2842. }
  2843. return equals;
  2844. }
  2845. /**
  2846. *
  2847. * @function SuperMap.Size.prototype.destroy
  2848. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  2849. * @example
  2850. * var size = new SuperMap.Size(31,46);
  2851. * size.destroy();
  2852. */
  2853. }, {
  2854. key: "destroy",
  2855. value: function destroy() {
  2856. this.w = null;
  2857. this.h = null;
  2858. }
  2859. }]);
  2860. return Size;
  2861. }();
  2862. SuperMap.Size = Size;
  2863. ;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
  2864. function Pixel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  2865. 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); } }
  2866. function Pixel_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pixel_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pixel_defineProperties(Constructor, staticProps); return Constructor; }
  2867. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  2868. * This program are made available under the terms of the Apache License, Version 2.0
  2869. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  2870. /**
  2871. * @class SuperMap.Pixel
  2872. * @category BaseTypes Geometry
  2873. * @classdesc 此类用 x,y 坐标描绘屏幕坐标(像素点)。
  2874. * @param {number} [x=0.0] - x 坐标。
  2875. * @param {number} [y=0.0] - y 坐标。
  2876. * @param {SuperMap.Pixel.Mode} [mode=SuperMap.Pixel.Mode.LeftTop] - 坐标模式。
  2877. *
  2878. * @example
  2879. * //单独创建一个对象
  2880. * var pixcel = new SuperMap.Pixel(100,50);
  2881. *
  2882. * //依据 size 创建
  2883. * var size = new SuperMap.Size(21,25);
  2884. * var offset = new SuperMap.Pixel(-(size.w/2), -size.h);
  2885. */
  2886. var Pixel = /*#__PURE__*/function () {
  2887. function Pixel(x, y, mode) {
  2888. Pixel_classCallCheck(this, Pixel);
  2889. /**
  2890. * @member {number} [SuperMap.Pixel.prototype.x=0.0]
  2891. * @description x 坐标。
  2892. */
  2893. this.x = x ? parseFloat(x) : 0.0;
  2894. /**
  2895. * @member {number} [SuperMap.Pixel.prototype.y=0.0]
  2896. * @description y 坐标。
  2897. */
  2898. this.y = y ? parseFloat(y) : 0.0;
  2899. /**
  2900. * @member {SuperMap.Pixel.Mode} [SuperMap.Pixel.prototype.mode=SuperMap.Pixel.Mode.LeftTop]
  2901. * @description 坐标模式,有左上、右上、右下、左下这几种模式,分别表示相对于左上角、右上角、右下角、左下角的坐标。
  2902. */
  2903. this.mode = mode;
  2904. this.CLASS_NAME = "SuperMap.Pixel";
  2905. /**
  2906. * @enum SuperMap.Pixel.Mode
  2907. * @readonly
  2908. * @description 模式。
  2909. * @type {string}
  2910. */
  2911. SuperMap.Pixel.Mode = {
  2912. /** 左上模式。*/
  2913. LeftTop: "lefttop",
  2914. /** 右上模式。 */
  2915. RightTop: "righttop",
  2916. /** 右下模式。 */
  2917. RightBottom: "rightbottom",
  2918. /** 左下模式。 */
  2919. LeftBottom: "leftbottom"
  2920. };
  2921. }
  2922. /**
  2923. * @function SuperMap.Pixel.prototype.toString
  2924. * @description 返回此对象的字符串形式。
  2925. * @example
  2926. *
  2927. * var pixcel = new SuperMap.Pixel(100,50);
  2928. * var str = pixcel.toString();
  2929. *
  2930. * @returns {string} 例如: "x=200.4,y=242.2"
  2931. */
  2932. Pixel_createClass(Pixel, [{
  2933. key: "toString",
  2934. value: function toString() {
  2935. return "x=" + this.x + ",y=" + this.y;
  2936. }
  2937. /**
  2938. * @function SuperMap.Pixel.prototype.clone
  2939. * @description 克隆当前的 pixel 对象。
  2940. * @example
  2941. * var pixcel = new SuperMap.Pixel(100,50);
  2942. * var pixcel2 = pixcel.clone();
  2943. * @returns {SuperMap.Pixel} 返回一个新的与当前 pixel 对象有相同 x、y 坐标的 pixel 对象。
  2944. */
  2945. }, {
  2946. key: "clone",
  2947. value: function clone() {
  2948. return new Pixel(this.x, this.y, this.mode);
  2949. }
  2950. /**
  2951. * @function SuperMap.Pixel.prototype.equals
  2952. * @description 比较两 pixel 是否相等。
  2953. * @example
  2954. * var pixcel = new SuperMap.Pixel(100,50);
  2955. * var pixcel2 = new SuperMap.Pixel(100,50);
  2956. * var isEquals = pixcel.equals(pixcel2);
  2957. *
  2958. * @param {SuperMap.Pixel} px - 用于比较相等的 pixel 对象。
  2959. * @returns {boolean} 如果传入的像素点和当前像素点相同返回 true,如果不同或传入参数为 NULL 则返回 false。
  2960. */
  2961. }, {
  2962. key: "equals",
  2963. value: function equals(px) {
  2964. var equals = false;
  2965. if (px != null) {
  2966. equals = this.x == px.x && this.y == px.y || isNaN(this.x) && isNaN(this.y) && isNaN(px.x) && isNaN(px.y);
  2967. }
  2968. return equals;
  2969. }
  2970. /**
  2971. * @function SuperMap.Pixel.prototype.distanceTo
  2972. * @description 返回两个 pixel 的距离。
  2973. * @example
  2974. * var pixcel = new SuperMap.Pixel(100,50);
  2975. * var pixcel2 = new SuperMap.Pixel(110,30);
  2976. * var distance = pixcel.distanceTo(pixcel2);
  2977. *
  2978. * @param {SuperMap.Pixel} px - 用于计算的一个 pixel。
  2979. * @returns {float} 作为参数传入的像素与当前像素点的距离。
  2980. */
  2981. }, {
  2982. key: "distanceTo",
  2983. value: function distanceTo(px) {
  2984. return Math.sqrt(Math.pow(this.x - px.x, 2) + Math.pow(this.y - px.y, 2));
  2985. }
  2986. /**
  2987. * @function SuperMap.Pixel.prototype.add
  2988. * @description 在原来像素坐标基础上,x 值加上传入的 x 参数,y 值加上传入的 y 参数。
  2989. * @example
  2990. * var pixcel = new SuperMap.Pixel(100,50);
  2991. * //pixcel2是新的对象
  2992. * var pixcel2 = pixcel.add(20,30);
  2993. *
  2994. * @param {number} x - 传入的 x 值。
  2995. * @param {number} y - 传入的 y 值。
  2996. * @returns {SuperMap.Pixel} 返回一个新的 pixel 对象,该 pixel 是由当前的 pixel 与传入的 x,y 相加得到。
  2997. */
  2998. }, {
  2999. key: "add",
  3000. value: function add(x, y) {
  3001. if (x == null || y == null) {
  3002. throw new TypeError('Pixel.add cannot receive null values');
  3003. }
  3004. return new Pixel(this.x + x, this.y + y);
  3005. }
  3006. /**
  3007. * @function SuperMap.Pixel.prototype.offset
  3008. * @description 通过传入的 {@link SuperMap.Pixel} 参数对原屏幕坐标进行偏移。
  3009. * @example
  3010. * var pixcel = new SuperMap.Pixel(100,50);
  3011. * var pixcel2 = new SuperMap.Pixel(130,20);
  3012. * //pixcel3 是新的对象
  3013. * var pixcel3 = pixcel.offset(pixcel2);
  3014. *
  3015. * @param {SuperMap.Pixel} px - 传入的 <SuperMap.Pixel> 对象。
  3016. * @returns {SuperMap.Pixel} 返回一个新的 pixel,该 pixel 是由当前的 pixel 对象的 x,y 值与传入的 Pixel 对象的 x,y 值相加得到。
  3017. */
  3018. }, {
  3019. key: "offset",
  3020. value: function offset(px) {
  3021. var newPx = this.clone();
  3022. if (px) {
  3023. newPx = this.add(px.x, px.y);
  3024. }
  3025. return newPx;
  3026. }
  3027. /**
  3028. *
  3029. * @function SuperMap.Pixel.prototype.destroy
  3030. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  3031. * @example
  3032. * var pixcel = new SuperMap.Pixel(100,50);
  3033. * pixcel.destroy();
  3034. */
  3035. }, {
  3036. key: "destroy",
  3037. value: function destroy() {
  3038. this.x = null;
  3039. this.y = null;
  3040. this.mode = null;
  3041. }
  3042. }]);
  3043. return Pixel;
  3044. }();
  3045. SuperMap.Pixel = Pixel;
  3046. ;// CONCATENATED MODULE: ./src/common/commontypes/BaseTypes.js
  3047. function BaseTypes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  3048. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3049. * This program are made available under the terms of the Apache License, Version 2.0
  3050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3051. /**
  3052. *@namespace SuperMap
  3053. *@category BaseTypes Namespace
  3054. */
  3055. /**
  3056. * @function SuperMap.inherit
  3057. * @description 除了 C 和 P 两个必要参数外,可以传递任意数量的对象,这些对象都将继承C。
  3058. * @memberOf SuperMap
  3059. * @param {Object} C - 继承的类。
  3060. * @param {Object} P - 被继承的父类。
  3061. */
  3062. SuperMap.inherit = function (C, P) {
  3063. var F = function F() {};
  3064. F.prototype = P.prototype;
  3065. C.prototype = new F();
  3066. var i, l, o;
  3067. for (i = 2, l = arguments.length; i < l; i++) {
  3068. o = arguments[i];
  3069. if (typeof o === "function") {
  3070. o = o.prototype;
  3071. }
  3072. SuperMap.Util.extend(C.prototype, o);
  3073. }
  3074. };
  3075. /**
  3076. * @function SuperMap.mixin
  3077. * @description 实现多重继承。
  3078. * @memberOf SuperMap
  3079. * @param {Class|Object} ...mixins - 继承的类。
  3080. */
  3081. SuperMap.mixin = function () {
  3082. for (var _len = arguments.length, mixins = new Array(_len), _key = 0; _key < _len; _key++) {
  3083. mixins[_key] = arguments[_key];
  3084. }
  3085. var Mix = function Mix(options) {
  3086. BaseTypes_classCallCheck(this, Mix);
  3087. for (var index = 0; index < mixins.length; index++) {
  3088. copyProperties(this, new mixins[index](options));
  3089. }
  3090. };
  3091. for (var index = 0; index < mixins.length; index++) {
  3092. var mixin = mixins[index];
  3093. copyProperties(Mix, mixin);
  3094. copyProperties(Mix.prototype, mixin.prototype);
  3095. copyProperties(Mix.prototype, new mixin());
  3096. }
  3097. return Mix;
  3098. function copyProperties(target, source) {
  3099. var ownKeys = Object.getOwnPropertyNames(source);
  3100. if (Object.getOwnPropertySymbols) {
  3101. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source));
  3102. }
  3103. for (var index = 0; index < ownKeys.length; index++) {
  3104. var key = ownKeys[index];
  3105. if (key !== "constructor" && key !== "prototype" && key !== "name" && key !== "length") {
  3106. var desc = Object.getOwnPropertyDescriptor(source, key);
  3107. if (window["ActiveXObject"]) {
  3108. Object.defineProperty(target, key, desc || {});
  3109. } else {
  3110. Object.defineProperty(target, key, desc);
  3111. }
  3112. }
  3113. }
  3114. }
  3115. };
  3116. /**
  3117. * @name String
  3118. * @namespace
  3119. * @memberOf SuperMap
  3120. * @category BaseTypes Util
  3121. * @description 字符串操作的一系列常用扩展函数。
  3122. */
  3123. var StringExt = SuperMap.String = {
  3124. /**
  3125. * @function SuperMap.String.startsWith
  3126. * @description 判断目标字符串是否以指定的子字符串开头。
  3127. * @param {string} str - 目标字符串。
  3128. * @param {string} sub - 查找的子字符串。
  3129. * @returns {boolean} 目标字符串以指定的子字符串开头,则返回 true;否则返回 false。
  3130. */
  3131. startsWith: function startsWith(str, sub) {
  3132. return str.indexOf(sub) == 0;
  3133. },
  3134. /**
  3135. * @function SuperMap.String.contains
  3136. * @description 判断目标字符串是否包含指定的子字符串。
  3137. * @param {string} str - 目标字符串。
  3138. * @param {string} sub - 查找的子字符串。
  3139. * @returns {boolean} 目标字符串中包含指定的子字符串,则返回 true;否则返回 false。
  3140. */
  3141. contains: function contains(str, sub) {
  3142. return str.indexOf(sub) != -1;
  3143. },
  3144. /**
  3145. * @function SuperMap.String.trim
  3146. * @description 删除一个字符串的开头和结尾处的所有空白字符。
  3147. * @param {string} str - (可能)存在空白字符填塞的字符串。
  3148. * @returns {string} 删除开头和结尾处空白字符后的字符串。
  3149. */
  3150. trim: function trim(str) {
  3151. return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
  3152. },
  3153. /**
  3154. * @function SuperMap.String.camelize
  3155. * @description 骆驼式("-")连字符的字符串处理。
  3156. * 例如:"chicken-head" becomes "chickenHead",
  3157. * "-chicken-head" becomes "ChickenHead"。
  3158. * @param {string} str - 要处理的字符串,原始内容不应被修改。
  3159. * @returns {string}
  3160. */
  3161. camelize: function camelize(str) {
  3162. var oStringList = str.split('-');
  3163. var camelizedString = oStringList[0];
  3164. for (var i = 1, len = oStringList.length; i < len; i++) {
  3165. var s = oStringList[i];
  3166. camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
  3167. }
  3168. return camelizedString;
  3169. },
  3170. /**
  3171. * @function SuperMap.String.format
  3172. * @description 提供带 ${token} 标记的字符串, 返回 context 对象属性中指定标记的属性值。
  3173. * @example
  3174. * 示例:
  3175. * (code)
  3176. * 1、template = "${value,getValue}";
  3177. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  3178. * args = [2,23,12,36,21];
  3179. * 返回值:36
  3180. * (end)
  3181. * 示例:
  3182. * (code)
  3183. * 2、template = "$${{value,getValue}}";
  3184. * context = {value: {getValue:function(){return Math.max.apply(null,argument);}}};
  3185. * args = [2,23,12,36,21];
  3186. * 返回值:"${36}"
  3187. * (end)
  3188. * 示例:
  3189. * (code)
  3190. * 3、template = "${a,b}";
  3191. * context = {a: {b:"format"}};
  3192. * args = null;
  3193. * 返回值:"format"
  3194. * (end)
  3195. * 示例:
  3196. * (code)
  3197. * 3、template = "${a,b}";
  3198. * context = null;
  3199. * args = null;
  3200. * 返回值:"${a.b}"
  3201. * (end)
  3202. * @param {string} template - 带标记的字符串将要被替换。参数 template 格式为"${token}",此处的 token 标记会替换为 context["token"] 属性的值。
  3203. * @param {Object} [context=window] - 带有属性的可选对象的属性用于匹配格式化字符串中的标记。如果该参数为空,将使用 window 对象。
  3204. * @param {Array} [args] - 可选参数传递给在 context 对象上找到的函数。
  3205. * @returns {string} 从 context 对象属性中替换字符串标记位的字符串。
  3206. */
  3207. format: function format(template, context, args) {
  3208. if (!context) {
  3209. context = window;
  3210. } // Example matching:
  3211. // str = ${foo.bar}
  3212. // match = foo.bar
  3213. var replacer = function replacer(str, match) {
  3214. var replacement; // Loop through all subs. Example: ${a.b.c}
  3215. // 0 -> replacement = context[a];
  3216. // 1 -> replacement = context[a][b];
  3217. // 2 -> replacement = context[a][b][c];
  3218. var subs = match.split(/\.+/);
  3219. for (var i = 0; i < subs.length; i++) {
  3220. if (i == 0) {
  3221. replacement = context;
  3222. }
  3223. replacement = replacement[subs[i]];
  3224. }
  3225. if (typeof replacement === "function") {
  3226. replacement = args ? replacement.apply(null, args) : replacement();
  3227. } // If replacement is undefined, return the string 'undefined'.
  3228. // This is a workaround for a bugs in browsers not properly
  3229. // dealing with non-participating groups in regular expressions:
  3230. // http://blog.stevenlevithan.com/archives/npcg-javascript
  3231. if (typeof replacement == 'undefined') {
  3232. return 'undefined';
  3233. } else {
  3234. return replacement;
  3235. }
  3236. };
  3237. return template.replace(SuperMap.String.tokenRegEx, replacer);
  3238. },
  3239. /**
  3240. * @member {RegExp} [SuperMap.String.tokenRegEx]
  3241. * @description 寻找带 token 的字符串,默认为 tokenRegEx=/\$\{([\w.]+?)\}/g。
  3242. * @example
  3243. * Examples: ${a}, ${a.b.c}, ${a-b}, ${5}
  3244. */
  3245. tokenRegEx: /\$\{([\w.]+?)\}/g,
  3246. /**
  3247. * @member {RegExp} [SuperMap.String.numberRegEx]
  3248. * @description 判断一个字符串是否只包含一个数值,默认为 numberRegEx=/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/。
  3249. */
  3250. numberRegEx: /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,
  3251. /**
  3252. * @function SuperMap.String.isNumeric
  3253. * @description 判断一个字符串是否只包含一个数值。
  3254. * @example
  3255. * (code)
  3256. * SuperMap.String.isNumeric("6.02e23") // true
  3257. * SuperMap.String.isNumeric("12 dozen") // false
  3258. * SuperMap.String.isNumeric("4") // true
  3259. * SuperMap.String.isNumeric(" 4 ") // false
  3260. * (end)
  3261. * @returns {boolean} 字符串包含唯一的数值,返回 true;否则返回 false。
  3262. */
  3263. isNumeric: function isNumeric(value) {
  3264. return SuperMap.String.numberRegEx.test(value);
  3265. },
  3266. /**
  3267. * @function SuperMap.String.numericIf
  3268. * @description 把一个看似数值型的字符串转化为一个数值。
  3269. * @returns {(number|string)} 如果能转换为数值则返回数值,否则返回字符串本身。
  3270. */
  3271. numericIf: function numericIf(value) {
  3272. return SuperMap.String.isNumeric(value) ? parseFloat(value) : value;
  3273. }
  3274. };
  3275. /**
  3276. * @name Number
  3277. * @memberOf SuperMap
  3278. * @namespace
  3279. * @category BaseTypes Util
  3280. * @description 数值操作的一系列常用扩展函数。
  3281. */
  3282. var NumberExt = SuperMap.Number = {
  3283. /**
  3284. * @member {string} [SuperMap.Number.decimalSeparator='.']
  3285. * @description 格式化数字时默认的小数点分隔符。
  3286. * @constant
  3287. */
  3288. decimalSeparator: ".",
  3289. /**
  3290. * @member {string} [SuperMap.Number.thousandsSeparator=',']
  3291. * @description 格式化数字时默认的千位分隔符。
  3292. * @constant
  3293. */
  3294. thousandsSeparator: ",",
  3295. /**
  3296. * @function SuperMap.Number.limitSigDigs
  3297. * @description 限制浮点数的有效数字位数。
  3298. * @param {number} num - 浮点数。
  3299. * @param {integer} sig - 有效位数。
  3300. * @returns {number} 将数字四舍五入到指定数量的有效位数。
  3301. */
  3302. limitSigDigs: function limitSigDigs(num, sig) {
  3303. var fig = 0;
  3304. if (sig > 0) {
  3305. fig = parseFloat(num.toPrecision(sig));
  3306. }
  3307. return fig;
  3308. },
  3309. /**
  3310. * @function SuperMap.Number.format
  3311. * @description 数字格式化输出。
  3312. * @param {number} num - 数字。
  3313. * @param {integer} [dec=0] - 数字的小数部分四舍五入到指定的位数。设置为 null 值时小数部分不变。
  3314. * @param {string} [tsep=','] - 千位分隔符。
  3315. * @param {string} [dsep='.'] - 小数点分隔符。
  3316. * @returns {string} 数字格式化后的字符串。
  3317. */
  3318. format: function format(num, dec, tsep, dsep) {
  3319. dec = typeof dec != "undefined" ? dec : 0;
  3320. tsep = typeof tsep != "undefined" ? tsep : SuperMap.Number.thousandsSeparator;
  3321. dsep = typeof dsep != "undefined" ? dsep : SuperMap.Number.decimalSeparator;
  3322. if (dec != null) {
  3323. num = parseFloat(num.toFixed(dec));
  3324. }
  3325. var parts = num.toString().split(".");
  3326. if (parts.length === 1 && dec == null) {
  3327. // integer where we do not want to touch the decimals
  3328. dec = 0;
  3329. }
  3330. var integer = parts[0];
  3331. if (tsep) {
  3332. var thousands = /(-?[0-9]+)([0-9]{3})/;
  3333. while (thousands.test(integer)) {
  3334. integer = integer.replace(thousands, "$1" + tsep + "$2");
  3335. }
  3336. }
  3337. var str;
  3338. if (dec == 0) {
  3339. str = integer;
  3340. } else {
  3341. var rem = parts.length > 1 ? parts[1] : "0";
  3342. if (dec != null) {
  3343. rem = rem + new Array(dec - rem.length + 1).join("0");
  3344. }
  3345. str = integer + dsep + rem;
  3346. }
  3347. return str;
  3348. }
  3349. };
  3350. if (!Number.prototype.limitSigDigs) {
  3351. /**
  3352. * APIMethod: Number.limitSigDigs
  3353. * 限制浮点数的有效数字位数.
  3354. * @param {integer} sig -有效位数。
  3355. * @returns {integer} 将数字四舍五入到指定数量的有效位数。
  3356. * 如果传入值 为 null、0、或者是负数, 返回值 0。
  3357. */
  3358. Number.prototype.limitSigDigs = function (sig) {
  3359. return NumberExt.limitSigDigs(this, sig);
  3360. };
  3361. }
  3362. /**
  3363. * @name Function
  3364. * @memberOf SuperMap
  3365. * @namespace
  3366. * @category BaseTypes Util
  3367. * @description 函数操作的一系列常用扩展函数。
  3368. */
  3369. var FunctionExt = SuperMap.Function = {
  3370. /**
  3371. * @function SuperMap.Function.bind
  3372. * @description 绑定函数到对象。方便创建 this 的作用域。
  3373. * @param {function} func - 输入函数。
  3374. * @param {Object} object - 对象绑定到输入函数(作为输入函数的 this 对象)。
  3375. * @returns {function} object 参数作为 func 函数的 this 对象。
  3376. */
  3377. bind: function bind(func, object) {
  3378. // create a reference to all arguments past the second one
  3379. var args = Array.prototype.slice.apply(arguments, [2]);
  3380. return function () {
  3381. // Push on any additional arguments from the actual function call.
  3382. // These will come after those sent to the bind call.
  3383. var newArgs = args.concat(Array.prototype.slice.apply(arguments, [0]));
  3384. return func.apply(object, newArgs);
  3385. };
  3386. },
  3387. /**
  3388. * @function SuperMap.Function.bindAsEventListener
  3389. * @description 绑定函数到对象,在调用该函数时配置并使用事件对象作为第一个参数。
  3390. * @param {function} func - 用于监听事件的函数。
  3391. * @param {Object} object - this 对象的引用。
  3392. * @returns {function}
  3393. */
  3394. bindAsEventListener: function bindAsEventListener(func, object) {
  3395. return function (event) {
  3396. return func.call(object, event || window.event);
  3397. };
  3398. },
  3399. /**
  3400. * @function SuperMap.Function.False
  3401. * @description 该函数仅仅返回 false。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  3402. * @example
  3403. * document.onclick = SuperMap.Function.False;
  3404. * @returns {boolean}
  3405. */
  3406. False: function False() {
  3407. return false;
  3408. },
  3409. /**
  3410. * @function SuperMap.Function.True
  3411. * @description 该函数仅仅返回 true。该函数主要是避免在 IE8 以下浏览中 DOM 事件句柄的匿名函数问题。
  3412. * @example
  3413. * document.onclick = SuperMap.Function.True;
  3414. * @returns {boolean}
  3415. */
  3416. True: function True() {
  3417. return true;
  3418. },
  3419. /**
  3420. * @function SuperMap.Function.Void
  3421. * @description 可重用函数,仅仅返回 "undefined"。
  3422. * @returns {undefined}
  3423. */
  3424. Void: function Void() {}
  3425. };
  3426. /**
  3427. * @name Array
  3428. * @memberOf SuperMap
  3429. * @namespace
  3430. * @category BaseTypes Util
  3431. * @description 数组操作的一系列常用扩展函数。
  3432. */
  3433. var ArrayExt = SuperMap.Array = {
  3434. /**
  3435. * @function SuperMap.Array.filter
  3436. * @description 过滤数组,提供了 ECMA-262 标准中 Array.prototype.filter 函数的扩展。详见:{@link http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array/filter}
  3437. * @param {Array} array - 要过滤的数组。
  3438. * @param {function} callback - 数组中的每一个元素调用该函数。</br>
  3439. * 如果函数的返回值为 true,该元素将包含在返回的数组中。该函数有三个参数: 数组中的元素,元素的索引,数组自身。</br>
  3440. * 如果设置了可选参数 caller,在调用 callback 时,使用可选参数 caller 设置为 callback 的参数。</br>
  3441. * @param {Object} [caller] - 在调用 callback 时,使用参数 caller 设置为 callback 的参数。
  3442. * @returns {Array} callback 函数返回 true 时的元素将作为返回数组中的元素。
  3443. */
  3444. filter: function filter(array, callback, caller) {
  3445. var selected = [];
  3446. if (Array.prototype.filter) {
  3447. selected = array.filter(callback, caller);
  3448. } else {
  3449. var len = array.length;
  3450. if (typeof callback != "function") {
  3451. throw new TypeError();
  3452. }
  3453. for (var i = 0; i < len; i++) {
  3454. if (i in array) {
  3455. var val = array[i];
  3456. if (callback.call(caller, val, i, array)) {
  3457. selected.push(val);
  3458. }
  3459. }
  3460. }
  3461. }
  3462. return selected;
  3463. }
  3464. };
  3465. ;// CONCATENATED MODULE: ./src/common/commontypes/Util.js
  3466. function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  3467. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  3468. * This program are made available under the terms of the Apache License, Version 2.0
  3469. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  3470. var Util = SuperMap.Util = SuperMap.Util || {};
  3471. /**
  3472. * @name Util
  3473. * @memberOf SuperMap
  3474. * @namespace
  3475. * @category BaseTypes Util
  3476. * @description common 工具类。
  3477. */
  3478. /**
  3479. * @description 复制源对象的所有属性到目标对象上,源对象上的没有定义的属性在目标对象上也不会被设置。
  3480. * @example
  3481. * 要复制 SuperMap.Size 对象的所有属性到自定义对象上,使用方法如下:
  3482. * var size = new SuperMap.Size(100, 100);
  3483. * var obj = {};
  3484. * SuperMap.Util.extend(obj, size);
  3485. * @param {Object} [destination] - 目标对象。
  3486. * @param {Object} source - 源对象,其属性将被设置到目标对象上。
  3487. * @returns {Object} 目标对象。
  3488. */
  3489. SuperMap.Util.extend = function (destination, source) {
  3490. destination = destination || {};
  3491. if (source) {
  3492. for (var property in source) {
  3493. var value = source[property];
  3494. if (value !== undefined) {
  3495. destination[property] = value;
  3496. }
  3497. }
  3498. /**
  3499. * IE doesn't include the toString property when iterating over an object's
  3500. * properties with the for(property in object) syntax. Explicitly check if
  3501. * the source has its own toString property.
  3502. */
  3503. /*
  3504. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  3505. * prototype object" when calling hawOwnProperty if the source object
  3506. * is an instance of window.Event.
  3507. */
  3508. var sourceIsEvt = typeof window.Event === "function" && source instanceof window.Event;
  3509. if (!sourceIsEvt && source.hasOwnProperty && source.hasOwnProperty("toString")) {
  3510. destination.toString = source.toString;
  3511. }
  3512. }
  3513. return destination;
  3514. };
  3515. /**
  3516. * @description 对象拷贝。
  3517. * @param {Object} [des] - 目标对象。
  3518. * @param {Object} soc - 源对象。
  3519. */
  3520. SuperMap.Util.copy = function (des, soc) {
  3521. des = des || {};
  3522. var v;
  3523. if (soc) {
  3524. for (var p in des) {
  3525. v = soc[p];
  3526. if (typeof v !== 'undefined') {
  3527. des[p] = v;
  3528. }
  3529. }
  3530. }
  3531. };
  3532. /**
  3533. * @description 销毁对象,将其属性置空。
  3534. * @param {Object} [obj] - 目标对象。
  3535. */
  3536. SuperMap.Util.reset = function (obj) {
  3537. obj = obj || {};
  3538. for (var p in obj) {
  3539. if (obj.hasOwnProperty(p)) {
  3540. if (_typeof(obj[p]) === "object" && obj[p] instanceof Array) {
  3541. for (var i in obj[p]) {
  3542. if (obj[p][i].destroy) {
  3543. obj[p][i].destroy();
  3544. }
  3545. }
  3546. obj[p].length = 0;
  3547. } else if (_typeof(obj[p]) === "object" && obj[p] instanceof Object) {
  3548. if (obj[p].destroy) {
  3549. obj[p].destroy();
  3550. }
  3551. }
  3552. obj[p] = null;
  3553. }
  3554. }
  3555. };
  3556. /**
  3557. * @description 获取 HTML 元素数组。
  3558. * @returns {Array.<HTMLElement>} HTML 元素数组。
  3559. */
  3560. SuperMap.Util.getElement = function () {
  3561. var elements = [];
  3562. for (var i = 0, len = arguments.length; i < len; i++) {
  3563. var element = arguments[i];
  3564. if (typeof element === 'string') {
  3565. element = document.getElementById(element);
  3566. }
  3567. if (arguments.length === 1) {
  3568. return element;
  3569. }
  3570. elements.push(element);
  3571. }
  3572. return elements;
  3573. };
  3574. /**
  3575. * @description instance of 的跨浏览器实现。
  3576. * @param {Object} o - 对象。
  3577. * @returns {boolean} 是否是页面元素。
  3578. */
  3579. SuperMap.Util.isElement = function (o) {
  3580. return !!(o && o.nodeType === 1);
  3581. };
  3582. /**
  3583. * @description 判断一个对象是否是数组。
  3584. * @param {Object} a - 对象。
  3585. * @returns {boolean} 是否是数组。
  3586. */
  3587. SuperMap.Util.isArray = function (a) {
  3588. return Object.prototype.toString.call(a) === '[object Array]';
  3589. };
  3590. /**
  3591. * @description 从数组中删除某一项。
  3592. * @param {Array} array - 数组。
  3593. * @param {Object} item - 数组中要删除的一项。
  3594. * @returns {Array} 执行删除操作后的数组。
  3595. */
  3596. SuperMap.Util.removeItem = function (array, item) {
  3597. for (var i = array.length - 1; i >= 0; i--) {
  3598. if (array[i] === item) {
  3599. array.splice(i, 1); //break;more than once??
  3600. }
  3601. }
  3602. return array;
  3603. };
  3604. /**
  3605. * @description 获取某对象再数组中的索引值。
  3606. * @param {Array} array - 数组。
  3607. * @param {Object} obj - 对象。
  3608. * @returns {number} 某对象再数组中的索引值。
  3609. */
  3610. SuperMap.Util.indexOf = function (array, obj) {
  3611. if (array == null) {
  3612. return -1;
  3613. } else {
  3614. // use the build-in function if available.
  3615. if (typeof array.indexOf === "function") {
  3616. return array.indexOf(obj);
  3617. } else {
  3618. for (var i = 0, len = array.length; i < len; i++) {
  3619. if (array[i] === obj) {
  3620. return i;
  3621. }
  3622. }
  3623. return -1;
  3624. }
  3625. }
  3626. };
  3627. /**
  3628. * @description 修改某 DOM 元素的许多属性。
  3629. * @param {HTMLElement} element - 待修改的 DOM 元素。
  3630. * @param {string} [id] - DOM 元素的 ID。
  3631. * @param {SuperMap.Pixel} [px] - 包含 DOM 元素的 style 属性的 left 和 top 属性。
  3632. * @param {SuperMap.Size} [sz] - 包含 DOM 元素的 width 和 height 属性。
  3633. * @param {string} [position] - DOM 元素的 position 属性。
  3634. * @param {string} [border] - DOM 元素的 style 属性的 border 属性。
  3635. * @param {string} [overflow] - DOM 元素的 style 属性的 overflow 属性。
  3636. * @param {number} [opacity] - 不透明度值。取值范围为(0.0 - 1.0)。
  3637. */
  3638. SuperMap.Util.modifyDOMElement = function (element, id, px, sz, position, border, overflow, opacity) {
  3639. if (id) {
  3640. element.id = id;
  3641. }
  3642. if (px) {
  3643. element.style.left = px.x + "px";
  3644. element.style.top = px.y + "px";
  3645. }
  3646. if (sz) {
  3647. element.style.width = sz.w + "px";
  3648. element.style.height = sz.h + "px";
  3649. }
  3650. if (position) {
  3651. element.style.position = position;
  3652. }
  3653. if (border) {
  3654. element.style.border = border;
  3655. }
  3656. if (overflow) {
  3657. element.style.overflow = overflow;
  3658. }
  3659. if (parseFloat(opacity) >= 0.0 && parseFloat(opacity) < 1.0) {
  3660. element.style.filter = 'alpha(opacity=' + opacity * 100 + ')';
  3661. element.style.opacity = opacity;
  3662. } else if (parseFloat(opacity) === 1.0) {
  3663. element.style.filter = '';
  3664. element.style.opacity = '';
  3665. }
  3666. };
  3667. /**
  3668. * @description Takes an object and copies any properties that don't exist from
  3669. * another properties, by analogy with SuperMap.Util.extend() from
  3670. * Prototype.js.
  3671. *
  3672. * @param {Object} [to] - 目标对象。
  3673. * @param {Object} from - 源对象。Any properties of this object that
  3674. * are undefined in the to object will be set on the to object.
  3675. *
  3676. * @returns {Object} A reference to the to object. Note that the to argument is modified
  3677. * in place and returned by this function.
  3678. */
  3679. SuperMap.Util.applyDefaults = function (to, from) {
  3680. to = to || {};
  3681. /*
  3682. * FF/Windows < 2.0.0.13 reports "Illegal operation on WrappedNative
  3683. * prototype object" when calling hawOwnProperty if the source object is an
  3684. * instance of window.Event.
  3685. */
  3686. var fromIsEvt = typeof window.Event === "function" && from instanceof window.Event;
  3687. for (var key in from) {
  3688. if (to[key] === undefined || !fromIsEvt && from.hasOwnProperty && from.hasOwnProperty(key) && !to.hasOwnProperty(key)) {
  3689. to[key] = from[key];
  3690. }
  3691. }
  3692. /**
  3693. * IE doesn't include the toString property when iterating over an object's
  3694. * properties with the for(property in object) syntax. Explicitly check if
  3695. * the source has its own toString property.
  3696. */
  3697. if (!fromIsEvt && from && from.hasOwnProperty && from.hasOwnProperty('toString') && !to.hasOwnProperty('toString')) {
  3698. to.toString = from.toString;
  3699. }
  3700. return to;
  3701. };
  3702. /**
  3703. * @description 将参数对象转换为 HTTP 的 GET 请求中的参数字符串。例如:"key1=value1&key2=value2&key3=value3"。
  3704. * @param {Object} params - 参数对象。
  3705. * @returns {string} HTTP 的 GET 请求中的参数字符串。
  3706. */
  3707. SuperMap.Util.getParameterString = function (params) {
  3708. var paramsArray = [];
  3709. for (var key in params) {
  3710. var value = params[key];
  3711. if (value != null && typeof value !== 'function') {
  3712. var encodedValue;
  3713. if (Array.isArray(value) || value.toString() === '[object Object]') {
  3714. encodedValue = encodeURIComponent(JSON.stringify(value));
  3715. } else {
  3716. /* value is a string; simply encode */
  3717. encodedValue = encodeURIComponent(value);
  3718. }
  3719. paramsArray.push(encodeURIComponent(key) + "=" + encodedValue);
  3720. }
  3721. }
  3722. return paramsArray.join("&");
  3723. };
  3724. /**
  3725. * @description 给 URL 追加查询参数。
  3726. * @param {string} url - 待追加参数的 URL 字符串。
  3727. * @param {string} paramStr - 待追加的查询参数。
  3728. * @returns {string} 新的 URL。
  3729. */
  3730. SuperMap.Util.urlAppend = function (url, paramStr) {
  3731. var newUrl = url;
  3732. if (paramStr) {
  3733. if (paramStr.indexOf('?') === 0) {
  3734. paramStr = paramStr.substring(1);
  3735. }
  3736. var parts = (url + " ").split(/[?&]/);
  3737. newUrl += parts.pop() === " " ? paramStr : parts.length ? "&" + paramStr : "?" + paramStr;
  3738. }
  3739. return newUrl;
  3740. };
  3741. /**
  3742. * @description 给 URL 追加 path 参数。
  3743. * @param {string} url - 待追加参数的 URL 字符串。
  3744. * @param {string} paramStr - 待追加的path参数。
  3745. * @returns {string} 新的 URL。
  3746. */
  3747. SuperMap.Util.urlPathAppend = function (url, pathStr) {
  3748. var newUrl = url;
  3749. if (!pathStr) {
  3750. return newUrl;
  3751. }
  3752. if (pathStr.indexOf('/') === 0) {
  3753. pathStr = pathStr.substring(1);
  3754. }
  3755. var parts = url.split('?');
  3756. if (parts[0].indexOf('/', parts[0].length - 1) < 0) {
  3757. parts[0] += '/';
  3758. }
  3759. newUrl = "".concat(parts[0]).concat(pathStr).concat(parts.length > 1 ? "?".concat(parts[1]) : '');
  3760. return newUrl;
  3761. };
  3762. /**
  3763. * @description 为了避免浮点精度错误而保留的有效位数。
  3764. * @type {number}
  3765. * @default 14
  3766. */
  3767. SuperMap.Util.DEFAULT_PRECISION = 14;
  3768. /**
  3769. * @description 将字符串以接近的精度转换为数字。
  3770. * @param {string} number - 字符串。
  3771. * @param {number} [precision=14] - 精度。
  3772. * @returns {number} 数字。
  3773. */
  3774. SuperMap.Util.toFloat = function (number, precision) {
  3775. if (precision == null) {
  3776. precision = SuperMap.Util.DEFAULT_PRECISION;
  3777. }
  3778. if (typeof number !== "number") {
  3779. number = parseFloat(number);
  3780. }
  3781. return precision === 0 ? number : parseFloat(number.toPrecision(precision));
  3782. };
  3783. /**
  3784. * @description 角度转弧度。
  3785. * @param {number} x - 角度。
  3786. * @returns {number} 弧度。
  3787. */
  3788. SuperMap.Util.rad = function (x) {
  3789. return x * Math.PI / 180;
  3790. };
  3791. /**
  3792. * @description 从 URL 字符串中解析出参数对象。
  3793. * @param {string} url - URL。
  3794. * @returns {Object} 解析出的参数对象。
  3795. */
  3796. SuperMap.Util.getParameters = function (url) {
  3797. // if no url specified, take it from the location bar
  3798. url = url === null || url === undefined ? window.location.href : url; //parse out parameters portion of url string
  3799. var paramsString = "";
  3800. if (SuperMap.String.contains(url, '?')) {
  3801. var start = url.indexOf('?') + 1;
  3802. var end = SuperMap.String.contains(url, "#") ? url.indexOf('#') : url.length;
  3803. paramsString = url.substring(start, end);
  3804. }
  3805. var parameters = {};
  3806. var pairs = paramsString.split(/[&;]/);
  3807. for (var i = 0, len = pairs.length; i < len; ++i) {
  3808. var keyValue = pairs[i].split('=');
  3809. if (keyValue[0]) {
  3810. var key = keyValue[0];
  3811. try {
  3812. key = decodeURIComponent(key);
  3813. } catch (err) {
  3814. key = unescape(key);
  3815. } // being liberal by replacing "+" with " "
  3816. var value = (keyValue[1] || '').replace(/\+/g, " ");
  3817. try {
  3818. value = decodeURIComponent(value);
  3819. } catch (err) {
  3820. value = unescape(value);
  3821. } // follow OGC convention of comma delimited values
  3822. value = value.split(","); //if there's only one value, do not return as array
  3823. if (value.length == 1) {
  3824. value = value[0];
  3825. }
  3826. parameters[key] = value;
  3827. }
  3828. }
  3829. return parameters;
  3830. };
  3831. /**
  3832. * @description 不断递增计数变量,用于生成唯一 ID。
  3833. * @type {number}
  3834. * @default 0
  3835. */
  3836. SuperMap.Util.lastSeqID = 0;
  3837. /**
  3838. * @description 创建唯一 ID 值。
  3839. * @param {string} [prefix] - 前缀。
  3840. * @returns {string} 唯一的 ID 值。
  3841. */
  3842. SuperMap.Util.createUniqueID = function (prefix) {
  3843. if (prefix == null) {
  3844. prefix = "id_";
  3845. }
  3846. SuperMap.Util.lastSeqID += 1;
  3847. return prefix + SuperMap.Util.lastSeqID;
  3848. };
  3849. /**
  3850. * @memberOf SuperMap
  3851. * @description 每单位的英尺数。
  3852. * @type {Object}
  3853. * @constant
  3854. */
  3855. SuperMap.INCHES_PER_UNIT = {
  3856. 'inches': 1.0,
  3857. 'ft': 12.0,
  3858. 'mi': 63360.0,
  3859. 'm': 39.3701,
  3860. 'km': 39370.1,
  3861. 'dd': 4374754,
  3862. 'yd': 36
  3863. };
  3864. SuperMap.INCHES_PER_UNIT.in = SuperMap.INCHES_PER_UNIT.inches;
  3865. SuperMap.INCHES_PER_UNIT.degrees = SuperMap.INCHES_PER_UNIT.dd;
  3866. SuperMap.INCHES_PER_UNIT.nmi = 1852 * SuperMap.INCHES_PER_UNIT.m; // Units from CS-Map
  3867. SuperMap.METERS_PER_INCH = 0.02540005080010160020;
  3868. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  3869. "Inch": SuperMap.INCHES_PER_UNIT.inches,
  3870. "Meter": 1.0 / SuperMap.METERS_PER_INCH,
  3871. //EPSG:9001
  3872. "Foot": 0.30480060960121920243 / SuperMap.METERS_PER_INCH,
  3873. //EPSG:9003
  3874. "IFoot": 0.30480000000000000000 / SuperMap.METERS_PER_INCH,
  3875. //EPSG:9002
  3876. "ClarkeFoot": 0.3047972651151 / SuperMap.METERS_PER_INCH,
  3877. //EPSG:9005
  3878. "SearsFoot": 0.30479947153867624624 / SuperMap.METERS_PER_INCH,
  3879. //EPSG:9041
  3880. "GoldCoastFoot": 0.30479971018150881758 / SuperMap.METERS_PER_INCH,
  3881. //EPSG:9094
  3882. "IInch": 0.02540000000000000000 / SuperMap.METERS_PER_INCH,
  3883. "MicroInch": 0.00002540000000000000 / SuperMap.METERS_PER_INCH,
  3884. "Mil": 0.00000002540000000000 / SuperMap.METERS_PER_INCH,
  3885. "Centimeter": 0.01000000000000000000 / SuperMap.METERS_PER_INCH,
  3886. "Kilometer": 1000.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3887. //EPSG:9036
  3888. "Yard": 0.91440182880365760731 / SuperMap.METERS_PER_INCH,
  3889. "SearsYard": 0.914398414616029 / SuperMap.METERS_PER_INCH,
  3890. //EPSG:9040
  3891. "IndianYard": 0.91439853074444079983 / SuperMap.METERS_PER_INCH,
  3892. //EPSG:9084
  3893. "IndianYd37": 0.91439523 / SuperMap.METERS_PER_INCH,
  3894. //EPSG:9085
  3895. "IndianYd62": 0.9143988 / SuperMap.METERS_PER_INCH,
  3896. //EPSG:9086
  3897. "IndianYd75": 0.9143985 / SuperMap.METERS_PER_INCH,
  3898. //EPSG:9087
  3899. "IndianFoot": 0.30479951 / SuperMap.METERS_PER_INCH,
  3900. //EPSG:9080
  3901. "IndianFt37": 0.30479841 / SuperMap.METERS_PER_INCH,
  3902. //EPSG:9081
  3903. "IndianFt62": 0.3047996 / SuperMap.METERS_PER_INCH,
  3904. //EPSG:9082
  3905. "IndianFt75": 0.3047995 / SuperMap.METERS_PER_INCH,
  3906. //EPSG:9083
  3907. "Mile": 1609.34721869443738887477 / SuperMap.METERS_PER_INCH,
  3908. "IYard": 0.91440000000000000000 / SuperMap.METERS_PER_INCH,
  3909. //EPSG:9096
  3910. "IMile": 1609.34400000000000000000 / SuperMap.METERS_PER_INCH,
  3911. //EPSG:9093
  3912. "NautM": 1852.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3913. //EPSG:9030
  3914. "Lat-66": 110943.316488932731 / SuperMap.METERS_PER_INCH,
  3915. "Lat-83": 110946.25736872234125 / SuperMap.METERS_PER_INCH,
  3916. "Decimeter": 0.10000000000000000000 / SuperMap.METERS_PER_INCH,
  3917. "Millimeter": 0.00100000000000000000 / SuperMap.METERS_PER_INCH,
  3918. "Dekameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3919. "Decameter": 10.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3920. "Hectometer": 100.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3921. "GermanMeter": 1.0000135965 / SuperMap.METERS_PER_INCH,
  3922. //EPSG:9031
  3923. "CaGrid": 0.999738 / SuperMap.METERS_PER_INCH,
  3924. "ClarkeChain": 20.1166194976 / SuperMap.METERS_PER_INCH,
  3925. //EPSG:9038
  3926. "GunterChain": 20.11684023368047 / SuperMap.METERS_PER_INCH,
  3927. //EPSG:9033
  3928. "BenoitChain": 20.116782494375872 / SuperMap.METERS_PER_INCH,
  3929. //EPSG:9062
  3930. "SearsChain": 20.11676512155 / SuperMap.METERS_PER_INCH,
  3931. //EPSG:9042
  3932. "ClarkeLink": 0.201166194976 / SuperMap.METERS_PER_INCH,
  3933. //EPSG:9039
  3934. "GunterLink": 0.2011684023368047 / SuperMap.METERS_PER_INCH,
  3935. //EPSG:9034
  3936. "BenoitLink": 0.20116782494375872 / SuperMap.METERS_PER_INCH,
  3937. //EPSG:9063
  3938. "SearsLink": 0.2011676512155 / SuperMap.METERS_PER_INCH,
  3939. //EPSG:9043
  3940. "Rod": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  3941. "IntnlChain": 20.1168 / SuperMap.METERS_PER_INCH,
  3942. //EPSG:9097
  3943. "IntnlLink": 0.201168 / SuperMap.METERS_PER_INCH,
  3944. //EPSG:9098
  3945. "Perch": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  3946. "Pole": 5.02921005842012 / SuperMap.METERS_PER_INCH,
  3947. "Furlong": 201.1684023368046 / SuperMap.METERS_PER_INCH,
  3948. "Rood": 3.778266898 / SuperMap.METERS_PER_INCH,
  3949. "CapeFoot": 0.3047972615 / SuperMap.METERS_PER_INCH,
  3950. "Brealey": 375.00000000000000000000 / SuperMap.METERS_PER_INCH,
  3951. "ModAmFt": 0.304812252984505969011938 / SuperMap.METERS_PER_INCH,
  3952. "Fathom": 1.8288 / SuperMap.METERS_PER_INCH,
  3953. "NautM-UK": 1853.184 / SuperMap.METERS_PER_INCH,
  3954. "50kilometers": 50000.0 / SuperMap.METERS_PER_INCH,
  3955. "150kilometers": 150000.0 / SuperMap.METERS_PER_INCH
  3956. }); //unit abbreviations supported by PROJ.4
  3957. SuperMap.Util.extend(SuperMap.INCHES_PER_UNIT, {
  3958. "mm": SuperMap.INCHES_PER_UNIT.Meter / 1000.0,
  3959. "cm": SuperMap.INCHES_PER_UNIT.Meter / 100.0,
  3960. "dm": SuperMap.INCHES_PER_UNIT.Meter * 100.0,
  3961. "km": SuperMap.INCHES_PER_UNIT.Meter * 1000.0,
  3962. "kmi": SuperMap.INCHES_PER_UNIT.nmi,
  3963. //International Nautical Mile
  3964. "fath": SuperMap.INCHES_PER_UNIT.Fathom,
  3965. //International Fathom
  3966. "ch": SuperMap.INCHES_PER_UNIT.IntnlChain,
  3967. //International Chain
  3968. "link": SuperMap.INCHES_PER_UNIT.IntnlLink,
  3969. //International Link
  3970. "us-in": SuperMap.INCHES_PER_UNIT.inches,
  3971. //U.S. Surveyor's Inch
  3972. "us-ft": SuperMap.INCHES_PER_UNIT.Foot,
  3973. //U.S. Surveyor's Foot
  3974. "us-yd": SuperMap.INCHES_PER_UNIT.Yard,
  3975. //U.S. Surveyor's Yard
  3976. "us-ch": SuperMap.INCHES_PER_UNIT.GunterChain,
  3977. //U.S. Surveyor's Chain
  3978. "us-mi": SuperMap.INCHES_PER_UNIT.Mile,
  3979. //U.S. Surveyor's Statute Mile
  3980. "ind-yd": SuperMap.INCHES_PER_UNIT.IndianYd37,
  3981. //Indian Yard
  3982. "ind-ft": SuperMap.INCHES_PER_UNIT.IndianFt37,
  3983. //Indian Foot
  3984. "ind-ch": 20.11669506 / SuperMap.METERS_PER_INCH //Indian Chain
  3985. });
  3986. /**
  3987. * @memberOf SuperMap
  3988. * @member [SuperMap.DOTS_PER_INCH=96]
  3989. * @description 分辨率与比例尺之间转换的常量。
  3990. * @type {Object}
  3991. */
  3992. SuperMap.DOTS_PER_INCH = 96;
  3993. /**
  3994. * @param {number} scale - 比例尺。
  3995. * @returns {number} 返回正常的 scale 值。
  3996. */
  3997. SuperMap.Util.normalizeScale = function (scale) {
  3998. var normScale = scale > 1.0 ? 1.0 / scale : scale;
  3999. return normScale;
  4000. };
  4001. /**
  4002. * @description 比例尺转分辨率。
  4003. * @param {number} scale - 比例尺。
  4004. * @param {string} [units='degrees'] - 比例尺单位。
  4005. * @returns {number} 分辨率。
  4006. */
  4007. SuperMap.Util.getResolutionFromScale = function (scale, units) {
  4008. var resolution;
  4009. if (scale) {
  4010. if (units == null) {
  4011. units = "degrees";
  4012. }
  4013. var normScale = SuperMap.Util.normalizeScale(scale);
  4014. resolution = 1 / (normScale * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH);
  4015. }
  4016. return resolution;
  4017. };
  4018. /**
  4019. * @description 分辨率转比例尺。
  4020. * @param {number} resolution - 分辨率。
  4021. * @param {string} [units='degrees'] - 分辨率单位。
  4022. * @returns {number} 比例尺。
  4023. */
  4024. SuperMap.Util.getScaleFromResolution = function (resolution, units) {
  4025. if (units == null) {
  4026. units = "degrees";
  4027. }
  4028. var scale = resolution * SuperMap.INCHES_PER_UNIT[units] * SuperMap.DOTS_PER_INCH;
  4029. return scale;
  4030. };
  4031. /**
  4032. * @memberOf SuperMap
  4033. * @description 如果 userAgent 捕获到浏览器使用的是 Gecko 引擎则返回 true。
  4034. * @constant
  4035. */
  4036. SuperMap.IS_GECKO = function () {
  4037. var ua = navigator.userAgent.toLowerCase();
  4038. return ua.indexOf("webkit") === -1 && ua.indexOf("gecko") !== -1;
  4039. }();
  4040. /**
  4041. * @memberOf SuperMap
  4042. * @description 浏览器名称,依赖于 userAgent 属性,BROWSER_NAME 可以是空,或者以下浏览器:
  4043. * * "opera" -- Opera
  4044. * * "msie" -- Internet Explorer
  4045. * * "safari" -- Safari
  4046. * * "firefox" -- Firefox
  4047. * * "mozilla" -- Mozilla
  4048. * @constant
  4049. */
  4050. SuperMap.Browser = function () {
  4051. var name = '',
  4052. version = '',
  4053. device = 'pc',
  4054. uaMatch; //以下进行测试
  4055. var ua = navigator.userAgent.toLowerCase();
  4056. if (ua.indexOf("msie") > -1 || ua.indexOf("trident") > -1 && ua.indexOf("rv") > -1) {
  4057. name = 'msie';
  4058. uaMatch = ua.match(/msie ([\d.]+)/) || ua.match(/rv:([\d.]+)/);
  4059. } else if (ua.indexOf("chrome") > -1) {
  4060. name = 'chrome';
  4061. uaMatch = ua.match(/chrome\/([\d.]+)/);
  4062. } else if (ua.indexOf("firefox") > -1) {
  4063. name = 'firefox';
  4064. uaMatch = ua.match(/firefox\/([\d.]+)/);
  4065. } else if (ua.indexOf("opera") > -1) {
  4066. name = 'opera';
  4067. uaMatch = ua.match(/version\/([\d.]+)/);
  4068. } else if (ua.indexOf("safari") > -1) {
  4069. name = 'safari';
  4070. uaMatch = ua.match(/version\/([\d.]+)/);
  4071. }
  4072. version = uaMatch ? uaMatch[1] : '';
  4073. if (ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone") > -1) {
  4074. device = 'apple';
  4075. } else if (ua.indexOf("android") > -1) {
  4076. uaMatch = ua.match(/version\/([\d.]+)/);
  4077. version = uaMatch ? uaMatch[1] : '';
  4078. device = 'android';
  4079. }
  4080. return {
  4081. name: name,
  4082. version: version,
  4083. device: device
  4084. };
  4085. }();
  4086. /**
  4087. * @description 获取浏览器相关信息。支持的浏览器包括:Opera,Internet Explorer,Safari,Firefox。
  4088. * @returns {Object} 获取浏览器名称、版本、设备名称。对应的属性分别为 name, version, device。
  4089. */
  4090. SuperMap.Util.getBrowser = function () {
  4091. return SuperMap.Browser;
  4092. };
  4093. /**
  4094. * @description 浏览器是否支持 Canvas。
  4095. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas。
  4096. */
  4097. SuperMap.Util.isSupportCanvas = function () {
  4098. var checkRes = true,
  4099. broz = SuperMap.Util.getBrowser();
  4100. if (document.createElement("canvas").getContext) {
  4101. if (broz.name === 'firefox' && parseFloat(broz.version) < 5) {
  4102. checkRes = false;
  4103. }
  4104. if (broz.name === 'safari' && parseFloat(broz.version) < 4) {
  4105. checkRes = false;
  4106. }
  4107. if (broz.name === 'opera' && parseFloat(broz.version) < 10) {
  4108. checkRes = false;
  4109. }
  4110. if (broz.name === 'msie' && parseFloat(broz.version) < 9) {
  4111. checkRes = false;
  4112. }
  4113. } else {
  4114. checkRes = false;
  4115. }
  4116. return checkRes;
  4117. }();
  4118. /**
  4119. * @description 判断;浏览器是否支持 Canvas。
  4120. * @returns {boolean} 获取当前浏览器是否支持 HTML5 Canvas 。
  4121. */
  4122. SuperMap.Util.supportCanvas = function () {
  4123. return SuperMap.Util.isSupportCanvas;
  4124. }; //将服务端的地图单位转成SuperMap的地图单位
  4125. SuperMap.INCHES_PER_UNIT.degree = SuperMap.INCHES_PER_UNIT.dd;
  4126. SuperMap.INCHES_PER_UNIT.meter = SuperMap.INCHES_PER_UNIT.m;
  4127. SuperMap.INCHES_PER_UNIT.foot = SuperMap.INCHES_PER_UNIT.ft;
  4128. SuperMap.INCHES_PER_UNIT.inch = SuperMap.INCHES_PER_UNIT.inches;
  4129. SuperMap.INCHES_PER_UNIT.mile = SuperMap.INCHES_PER_UNIT.mi;
  4130. SuperMap.INCHES_PER_UNIT.kilometer = SuperMap.INCHES_PER_UNIT.km;
  4131. SuperMap.INCHES_PER_UNIT.yard = SuperMap.INCHES_PER_UNIT.yd;
  4132. /**
  4133. * @description 判断一个 URL 请求是否在当前域中。
  4134. * @param {string} url - URL 请求字符串。
  4135. * @returns {boolean} URL 请求是否在当前域中。
  4136. */
  4137. SuperMap.Util.isInTheSameDomain = function (url) {
  4138. if (!url) {
  4139. return true;
  4140. }
  4141. var index = url.indexOf("//");
  4142. var documentUrl = document.location.toString();
  4143. var documentIndex = documentUrl.indexOf("//");
  4144. if (index === -1) {
  4145. return true;
  4146. } else {
  4147. var protocol;
  4148. var substring = protocol = url.substring(0, index);
  4149. var documentSubString = documentUrl.substring(documentIndex + 2);
  4150. documentIndex = documentSubString.indexOf("/");
  4151. var documentPortIndex = documentSubString.indexOf(":");
  4152. var documentDomainWithPort = documentSubString.substring(0, documentIndex); //var documentPort;
  4153. var documentprotocol = document.location.protocol;
  4154. if (documentPortIndex !== -1) {// documentPort = +documentSubString.substring(documentPortIndex, documentIndex);
  4155. } else {
  4156. documentDomainWithPort += ':' + (documentprotocol.toLowerCase() === 'http:' ? 80 : 443);
  4157. }
  4158. if (documentprotocol.toLowerCase() !== substring.toLowerCase()) {
  4159. return false;
  4160. }
  4161. substring = url.substring(index + 2);
  4162. var portIndex = substring.indexOf(":");
  4163. index = substring.indexOf("/");
  4164. var domainWithPort = substring.substring(0, index);
  4165. var domain;
  4166. if (portIndex !== -1) {
  4167. domain = substring.substring(0, portIndex);
  4168. } else {
  4169. domain = substring.substring(0, index);
  4170. domainWithPort += ':' + (protocol.toLowerCase() === 'http:' ? 80 : 443);
  4171. }
  4172. var documentDomain = document.domain;
  4173. if (domain === documentDomain && domainWithPort === documentDomainWithPort) {
  4174. return true;
  4175. }
  4176. }
  4177. return false;
  4178. };
  4179. /**
  4180. * @description 计算 iServer 服务的 REST 图层的显示分辨率,需要从 iServer 的 REST 图层表述中获取 viewBounds、viewer、scale、coordUnit、datumAxis 五个参数,来进行计算。
  4181. * @param {SuperMap.Bounds} viewBounds - 地图的参照可视范围,即地图初始化时默认的地图显示范围。
  4182. * @param {SuperMap.Size} viewer - 地图初始化时默认的地图图片的尺寸。
  4183. * @param {number} scale - 地图初始化时默认的显示比例尺。
  4184. * @param {string} [coordUnit='degrees'] - 投影坐标系统的地图单位。
  4185. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则系统默认为 WGS84 参考系的椭球体长半轴 6378137。
  4186. * @returns {number} 返回图层显示分辨率。
  4187. */
  4188. SuperMap.Util.calculateDpi = function (viewBounds, viewer, scale, coordUnit, datumAxis) {
  4189. //10000 是 0.1毫米与米的转换。DPI的计算公式:Viewer / DPI * 0.0254 * 10000 = ViewBounds * scale ,公式中的10000是为了提高计算结果的精度,以下出现的ratio皆为如此。
  4190. if (!viewBounds || !viewer || !scale) {
  4191. return;
  4192. }
  4193. var ratio = 10000,
  4194. rvbWidth = viewBounds.getWidth(),
  4195. rvbHeight = viewBounds.getHeight(),
  4196. rvWidth = viewer.w,
  4197. rvHeight = viewer.h; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  4198. datumAxis = datumAxis || 6378137;
  4199. coordUnit = coordUnit || "degrees";
  4200. var dpi;
  4201. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  4202. var num1 = rvbWidth / rvWidth,
  4203. num2 = rvbHeight / rvHeight,
  4204. resolution = num1 > num2 ? num1 : num2;
  4205. dpi = 0.0254 * ratio / resolution / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  4206. } else {
  4207. var _resolution = rvbWidth / rvWidth;
  4208. dpi = 0.0254 * ratio / _resolution / scale / ratio;
  4209. }
  4210. return dpi;
  4211. };
  4212. /**
  4213. * @description 将对象转换成 JSON 字符串。
  4214. * @param {Object} obj - 要转换成 JSON 的 Object 对象。
  4215. * @returns {string} 返回转换后的 JSON 对象。
  4216. */
  4217. SuperMap.Util.toJSON = function (obj) {
  4218. var objInn = obj;
  4219. if (objInn == null) {
  4220. return null;
  4221. }
  4222. switch (objInn.constructor) {
  4223. case String:
  4224. //s = "'" + str.replace(/(["\\])/g, "\\$1") + "'"; string含有单引号出错
  4225. objInn = '"' + objInn.replace(/(["\\])/g, '\\$1') + '"';
  4226. objInn = objInn.replace(/\n/g, "\\n");
  4227. objInn = objInn.replace(/\r/g, "\\r");
  4228. objInn = objInn.replace("<", "&lt;");
  4229. objInn = objInn.replace(">", "&gt;");
  4230. objInn = objInn.replace(/%/g, "%25");
  4231. objInn = objInn.replace(/&/g, "%26");
  4232. return objInn;
  4233. case Array:
  4234. var arr = [];
  4235. for (var i = 0, len = objInn.length; i < len; i++) {
  4236. arr.push(SuperMap.Util.toJSON(objInn[i]));
  4237. }
  4238. return "[" + arr.join(",") + "]";
  4239. case Number:
  4240. return isFinite(objInn) ? String(objInn) : null;
  4241. case Boolean:
  4242. return String(objInn);
  4243. case Date:
  4244. 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() + "}";
  4245. return dateStr;
  4246. default:
  4247. if (objInn["toJSON"] != null && typeof objInn["toJSON"] === "function") {
  4248. return objInn.toJSON();
  4249. }
  4250. if (_typeof(objInn) === "object") {
  4251. if (objInn.length) {
  4252. var _arr2 = [];
  4253. for (var _i = 0, _len = objInn.length; _i < _len; _i++) {
  4254. _arr2.push(SuperMap.Util.toJSON(objInn[_i]));
  4255. }
  4256. return "[" + _arr2.join(",") + "]";
  4257. }
  4258. var _arr = [];
  4259. for (var attr in objInn) {
  4260. //为解决SuperMap.Geometry类型头json时堆栈溢出的问题,attr == "parent"时不进行json转换
  4261. if (typeof objInn[attr] !== "function" && attr !== "CLASS_NAME" && attr !== "parent") {
  4262. _arr.push("'" + attr + "':" + SuperMap.Util.toJSON(objInn[attr]));
  4263. }
  4264. }
  4265. if (_arr.length > 0) {
  4266. return "{" + _arr.join(",") + "}";
  4267. } else {
  4268. return "{}";
  4269. }
  4270. }
  4271. return objInn.toString();
  4272. }
  4273. };
  4274. /**
  4275. * @description 根据比例尺和 dpi 计算屏幕分辨率。
  4276. * @param {number} scale - 比例尺。
  4277. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  4278. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  4279. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  4280. * @returns {number} 返回当前比例尺下的屏幕分辨率。
  4281. */
  4282. SuperMap.Util.getResolutionFromScaleDpi = function (scale, dpi, coordUnit, datumAxis) {
  4283. var resolution = null,
  4284. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  4285. datumAxis = datumAxis || 6378137;
  4286. coordUnit = coordUnit || "";
  4287. if (scale > 0 && dpi > 0) {
  4288. scale = SuperMap.Util.normalizeScale(scale);
  4289. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  4290. //scale = SuperMap.Util.normalizeScale(scale);
  4291. resolution = 0.0254 * ratio / dpi / scale / (Math.PI * 2 * datumAxis / 360) / ratio;
  4292. return resolution;
  4293. } else {
  4294. resolution = 0.0254 * ratio / dpi / scale / ratio;
  4295. return resolution;
  4296. }
  4297. }
  4298. return -1;
  4299. };
  4300. /**
  4301. * @description 根据 resolution、dpi、coordUnit 和 datumAxis 计算比例尺。
  4302. * @param {number} resolution - 用于计算比例尺的地图分辨率。
  4303. * @param {number} dpi - 图像分辨率,表示每英寸内的像素个数。
  4304. * @param {string} [coordUnit] - 投影坐标系统的地图单位。
  4305. * @param {number} [datumAxis=6378137] - 地理坐标系统椭球体长半轴。用户自定义地图的 Options 时,若未指定该参数的值,则 DPI 默认按照 WGS84 参考系的椭球体长半轴 6378137 来计算。
  4306. * @returns {number} 返回当前屏幕分辨率下的比例尺。
  4307. */
  4308. SuperMap.Util.getScaleFromResolutionDpi = function (resolution, dpi, coordUnit, datumAxis) {
  4309. var scale = null,
  4310. ratio = 10000; //用户自定义地图的Options时,若未指定该参数的值,则系统默认为6378137米,即WGS84参考系的椭球体长半轴。
  4311. datumAxis = datumAxis || 6378137;
  4312. coordUnit = coordUnit || "";
  4313. if (resolution > 0 && dpi > 0) {
  4314. if (coordUnit.toLowerCase() === "degree" || coordUnit.toLowerCase() === "degrees" || coordUnit.toLowerCase() === "dd") {
  4315. scale = 0.0254 * ratio / dpi / resolution / (Math.PI * 2 * datumAxis / 360) / ratio;
  4316. return scale;
  4317. } else {
  4318. scale = 0.0254 * ratio / dpi / resolution / ratio;
  4319. return scale;
  4320. }
  4321. }
  4322. return -1;
  4323. };
  4324. /**
  4325. * @description 转换查询结果。
  4326. * @param {Object} result - 查询结果。
  4327. * @returns {Object} 转换后的查询结果。
  4328. */
  4329. SuperMap.Util.transformResult = function (result) {
  4330. if (result.responseText && typeof result.responseText === "string") {
  4331. result = JSON.parse(result.responseText);
  4332. }
  4333. return result;
  4334. };
  4335. /**
  4336. * @description 属性拷贝,不拷贝方法类名(CLASS_NAME)等。
  4337. * @param {Object} [destination] - 拷贝目标。
  4338. * @param {Object} source - 源对象。
  4339. *
  4340. */
  4341. SuperMap.Util.copyAttributes = function (destination, source) {
  4342. destination = destination || {};
  4343. if (source) {
  4344. for (var property in source) {
  4345. var value = source[property];
  4346. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  4347. destination[property] = value;
  4348. }
  4349. }
  4350. }
  4351. return destination;
  4352. };
  4353. /**
  4354. * @description 将源对象上的属性拷贝到目标对象上。(不拷贝 CLASS_NAME 和方法)
  4355. * @param {Object} [destination] - 目标对象。
  4356. * @param {Object} source - 源对象。
  4357. * @param {Array.<string>} clip - 源对象中禁止拷贝到目标对象的属性,目的是防止目标对象上不可修改的属性被篡改。
  4358. *
  4359. */
  4360. SuperMap.Util.copyAttributesWithClip = function (destination, source, clip) {
  4361. destination = destination || {};
  4362. if (source) {
  4363. for (var property in source) {
  4364. //去掉禁止拷贝的属性
  4365. var isInClip = false;
  4366. if (clip && clip.length) {
  4367. for (var i = 0, len = clip.length; i < len; i++) {
  4368. if (property === clip[i]) {
  4369. isInClip = true;
  4370. break;
  4371. }
  4372. }
  4373. }
  4374. if (isInClip === true) {
  4375. continue;
  4376. }
  4377. var value = source[property];
  4378. if (value !== undefined && property !== "CLASS_NAME" && typeof value !== "function") {
  4379. destination[property] = value;
  4380. }
  4381. }
  4382. }
  4383. return destination;
  4384. };
  4385. /**
  4386. * @description 克隆一个 Object 对象
  4387. * @param {Object} obj - 需要克隆的对象。
  4388. * @returns {Object} 返回对象的拷贝对象,注意是新的对象,不是指向。
  4389. */
  4390. SuperMap.Util.cloneObject = function (obj) {
  4391. // Handle the 3 simple types, and null or undefined
  4392. if (null === obj || "object" !== _typeof(obj)) {
  4393. return obj;
  4394. } // Handle Date
  4395. if (obj instanceof Date) {
  4396. var copy = new Date();
  4397. copy.setTime(obj.getTime());
  4398. return copy;
  4399. } // Handle Array
  4400. if (obj instanceof Array) {
  4401. var _copy = obj.slice(0);
  4402. return _copy;
  4403. } // Handle Object
  4404. if (obj instanceof Object) {
  4405. var _copy2 = {};
  4406. for (var attr in obj) {
  4407. if (obj.hasOwnProperty(attr)) {
  4408. _copy2[attr] = SuperMap.Util.cloneObject(obj[attr]);
  4409. }
  4410. }
  4411. return _copy2;
  4412. }
  4413. throw new Error("Unable to copy obj! Its type isn't supported.");
  4414. };
  4415. /**
  4416. * @description 判断两条线段是不是有交点。
  4417. * @param {SuperMap.Geometry.Point} a1 - 第一条线段的起始节点。
  4418. * @param {SuperMap.Geometry.Point} a2 - 第一条线段的结束节点。
  4419. * @param {SuperMap.Geometry.Point} b1 - 第二条线段的起始节点。
  4420. * @param {SuperMap.Geometry.Point} b2 - 第二条线段的结束节点。
  4421. * @returns {Object} 如果相交返回交点,如果不相交返回两条线段的位置关系。
  4422. */
  4423. SuperMap.Util.lineIntersection = function (a1, a2, b1, b2) {
  4424. var intersectValue = null;
  4425. var k1;
  4426. var k2;
  4427. var b = (b2.x - b1.x) * (a1.y - b1.y) - (b2.y - b1.y) * (a1.x - b1.x);
  4428. var a = (a2.x - a1.x) * (a1.y - b1.y) - (a2.y - a1.y) * (a1.x - b1.x);
  4429. var ab = (b2.y - b1.y) * (a2.x - a1.x) - (b2.x - b1.x) * (a2.y - a1.y); //ab==0代表两条线断的斜率一样
  4430. if (ab != 0) {
  4431. k1 = b / ab;
  4432. k2 = a / ab;
  4433. if (k1 >= 0 && k2 <= 1 && k1 <= 1 && k2 >= 0) {
  4434. intersectValue = new SuperMap.Geometry.Point(a1.x + k1 * (a2.x - a1.x), a1.y + k1 * (a2.y - a1.y));
  4435. } else {
  4436. intersectValue = "No Intersection";
  4437. }
  4438. } else {
  4439. if (b == 0 && a == 0) {
  4440. var maxy = Math.max(a1.y, a2.y);
  4441. var miny = Math.min(a1.y, a2.y);
  4442. var maxx = Math.max(a1.x, a2.x);
  4443. var minx = Math.min(a1.x, a2.x);
  4444. 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) {
  4445. intersectValue = "Coincident"; //重合
  4446. } else {
  4447. intersectValue = "Parallel"; //平行
  4448. }
  4449. } else {
  4450. intersectValue = "Parallel"; //平行
  4451. }
  4452. }
  4453. return intersectValue;
  4454. };
  4455. /**
  4456. * @description 获取文本外接矩形宽度与高度。
  4457. * @param {SuperMap.ThemeStyle} style - 文本样式。
  4458. * @param {string} text - 文本内容。
  4459. * @param {Object} element - DOM 元素。
  4460. * @returns {Object} 返回裁剪后的宽度,高度信息。
  4461. */
  4462. SuperMap.Util.getTextBounds = function (style, text, element) {
  4463. document.body.appendChild(element);
  4464. element.style.width = 'auto';
  4465. element.style.height = 'auto';
  4466. if (style.fontSize) {
  4467. element.style.fontSize = style.fontSize;
  4468. }
  4469. if (style.fontFamily) {
  4470. element.style.fontFamily = style.fontFamily;
  4471. }
  4472. if (style.fontWeight) {
  4473. element.style.fontWeight = style.fontWeight;
  4474. }
  4475. element.style.position = 'relative';
  4476. element.style.visibility = 'hidden'; //fix 在某些情况下,element内的文本变成竖起排列,导致宽度计算不正确的bug
  4477. element.style.display = 'inline-block';
  4478. element.innerHTML = text;
  4479. var textWidth = element.clientWidth;
  4480. var textHeight = element.clientHeight;
  4481. document.body.removeChild(element);
  4482. return {
  4483. textWidth: textWidth,
  4484. textHeight: textHeight
  4485. };
  4486. };
  4487. ;// CONCATENATED MODULE: ./src/common/commontypes/LonLat.js
  4488. function LonLat_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4489. 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); } }
  4490. function LonLat_createClass(Constructor, protoProps, staticProps) { if (protoProps) LonLat_defineProperties(Constructor.prototype, protoProps); if (staticProps) LonLat_defineProperties(Constructor, staticProps); return Constructor; }
  4491. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4492. * This program are made available under the terms of the Apache License, Version 2.0
  4493. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4494. /**
  4495. * @class SuperMap.LonLat
  4496. * @category BaseTypes Geometry
  4497. * @classdesc 这个类用来表示经度和纬度对。
  4498. * @param {number} [lon=0.0] - 地图单位上的 X 轴坐标,如果地图是地理投影,则此值是经度,否则,此值是地图地理位置的 x 坐标。
  4499. * @param {number} [lat=0.0] - 地图单位上的 Y 轴坐标,如果地图是地理投影,则此值是纬度,否则,此值是地图地理位置的 y 坐标。
  4500. * @param {Array.<float>} [location] - 如果要同时设置,则使用传入横纵坐标组成的数组。
  4501. * @example
  4502. * var lonLat = new SuperMap.LonLat(30,45);
  4503. */
  4504. var LonLat = /*#__PURE__*/function () {
  4505. function LonLat(lon, lat) {
  4506. LonLat_classCallCheck(this, LonLat);
  4507. if (Util.isArray(lon)) {
  4508. lat = lon[1];
  4509. lon = lon[0];
  4510. }
  4511. /**
  4512. * @member {float} [SuperMap.LonLat.prototype.lon=0.0]
  4513. * @description 地图的单位的 X 轴(横轴)坐标。
  4514. */
  4515. this.lon = lon ? Util.toFloat(lon) : 0.0;
  4516. /**
  4517. * @member {float} [SuperMap.LonLat.prototype.lat=0.0]
  4518. * @description 地图的单位的 Y 轴(纵轴)坐标。
  4519. */
  4520. this.lat = lat ? Util.toFloat(lat) : 0.0;
  4521. this.CLASS_NAME = "SuperMap.LonLat";
  4522. }
  4523. /**
  4524. * @function SuperMap.LonLat.prototype.toString
  4525. * @description 返回此对象的字符串形式
  4526. * @example
  4527. * var lonLat = new SuperMap.LonLat(100,50);
  4528. * var str = lonLat.toString();
  4529. * @returns {string} 例如: "lon=100,lat=50"
  4530. */
  4531. LonLat_createClass(LonLat, [{
  4532. key: "toString",
  4533. value: function toString() {
  4534. return "lon=" + this.lon + ",lat=" + this.lat;
  4535. }
  4536. /**
  4537. * @function SuperMap.LonLat.prototype.toShortString
  4538. * @description 将经度纬度转换成简单字符串。
  4539. * @example
  4540. * var lonLat = new SuperMap.LonLat(100,50);
  4541. * var str = lonLat.toShortString();
  4542. * @returns {string} 返回处理后的经纬度字符串。例如:"100,50"
  4543. */
  4544. }, {
  4545. key: "toShortString",
  4546. value: function toShortString() {
  4547. return this.lon + "," + this.lat;
  4548. }
  4549. /**
  4550. * @function SuperMap.LonLat.prototype.clone
  4551. * @description 复制坐标对象,并返回复制后的新对象。
  4552. * @example
  4553. * var lonLat1 = new SuperMap.LonLat(100,50);
  4554. * var lonLat2 = lonLat1.clone();
  4555. * @returns {SuperMap.LonLat} 返回相同坐标值的新的坐标对象。
  4556. */
  4557. }, {
  4558. key: "clone",
  4559. value: function clone() {
  4560. return new LonLat(this.lon, this.lat);
  4561. }
  4562. /**
  4563. * @function SuperMap.LonLat.prototype.add
  4564. * @description 在已有坐标对象的经纬度基础上加上新的坐标经纬度,并返回新的坐标对象。
  4565. * @example
  4566. * var lonLat1 = new SuperMap.LonLat(100,50);
  4567. * //lonLat2 是新的对象
  4568. * var lonLat2 = lonLat1.add(100,50);
  4569. * @param {float} lon - 传入的经度参数。
  4570. * @param {float} lat - 传入的纬度参数。
  4571. * @returns {SuperMap.LonLat} 返回一个新的 LonLat 对象,此对象的经纬度是由传入的经纬度与当前的经纬度相加所得。
  4572. */
  4573. }, {
  4574. key: "add",
  4575. value: function add(lon, lat) {
  4576. if (lon == null || lat == null) {
  4577. throw new TypeError('LonLat.add cannot receive null values');
  4578. }
  4579. return new LonLat(this.lon + Util.toFloat(lon), this.lat + Util.toFloat(lat));
  4580. }
  4581. /**
  4582. * @function SuperMap.LonLat.prototype.equals
  4583. * @description 判断两个坐标对象是否相等。
  4584. * @example
  4585. * var lonLat1 = new SuperMap.LonLat(100,50);
  4586. * var lonLat2 = new SuperMap.LonLat(100,50);
  4587. * var isEquals = lonLat1.equals(lonLat2);
  4588. * @param {SuperMap.LonLat} ll - 需要进行比较的坐标对象。
  4589. * @returns {boolean} 如果LonLat对象的经纬度和传入的经纬度一致则返回true,不一
  4590. * 致或传入的ll参数为NULL则返回false。
  4591. */
  4592. }, {
  4593. key: "equals",
  4594. value: function equals(ll) {
  4595. var equals = false;
  4596. if (ll != null) {
  4597. equals = this.lon === ll.lon && this.lat === ll.lat || isNaN(this.lon) && isNaN(this.lat) && isNaN(ll.lon) && isNaN(ll.lat);
  4598. }
  4599. return equals;
  4600. }
  4601. /**
  4602. * @function SuperMap.LonLat.prototype.wrapDateLine
  4603. * @description 通过传入的范围对象对坐标对象转换到该范围内。
  4604. * 如果经度小于给定范围最小精度,则在原经度基础上加上范围宽度,直到精度在范围内为止,如果经度大于给定范围则在原经度基础上减去范围宽度。
  4605. * 即指将不在经度范围内的坐标转换到范围以内(只会转换 lon,不会转换 lat,主要用于转移到日界线以内)。
  4606. * @example
  4607. * var lonLat1 = new SuperMap.LonLat(420,50);
  4608. * var lonLat2 = lonLat1.wrapDateLine(
  4609. * new SuperMap.Bounds(-180,-90,180,90)
  4610. * );
  4611. * @param {SuperMap.Bounds} maxExtent - 最大边界的范围。
  4612. * @returns {SuperMap.LonLat} 将坐标转换到范围对象以内,并返回新的坐标。
  4613. */
  4614. }, {
  4615. key: "wrapDateLine",
  4616. value: function wrapDateLine(maxExtent) {
  4617. var newLonLat = this.clone();
  4618. if (maxExtent) {
  4619. //shift right?
  4620. while (newLonLat.lon < maxExtent.left) {
  4621. newLonLat.lon += maxExtent.getWidth();
  4622. } //shift left?
  4623. while (newLonLat.lon > maxExtent.right) {
  4624. newLonLat.lon -= maxExtent.getWidth();
  4625. }
  4626. }
  4627. return newLonLat;
  4628. }
  4629. /**
  4630. *
  4631. * @function SuperMap.LonLat.prototype.destroy
  4632. * @description 销毁此对象。
  4633. * 销毁后此对象的所有属性为 null,而不是初始值。
  4634. * @example
  4635. * var lonLat = new SuperMap.LonLat(100,50);
  4636. * lonLat.destroy();
  4637. */
  4638. }, {
  4639. key: "destroy",
  4640. value: function destroy() {
  4641. this.lon = null;
  4642. this.lat = null;
  4643. }
  4644. /**
  4645. * @function SuperMap.LonLat.fromString
  4646. * @description 通过字符串生成一个 {@link SuperMap.LonLat} 对象。
  4647. * @example
  4648. * var str = "100,50";
  4649. * var lonLat = SuperMap.LonLat.fromString(str);
  4650. * @param {string} str - 字符串的格式:Lon+","+Lat。如:"100,50"。
  4651. * @returns {SuperMap.LonLat} 返回一个 {@link SuperMap.LonLat} 对象。
  4652. */
  4653. }], [{
  4654. key: "fromString",
  4655. value: function fromString(str) {
  4656. var pair = str.split(",");
  4657. return new LonLat(pair[0], pair[1]);
  4658. }
  4659. /**
  4660. * @function SuperMap.LonLat.fromArray
  4661. * @description 通过数组生成一个 <SuperMap.LonLat> 对象。
  4662. * @param {Array.<float>} arr - 数组的格式,长度只能为2,:[Lon,Lat]。如:[5,-42]。
  4663. * @returns {SuperMap.LonLat} 返回一个 <SuperMap.LonLat> 对象。
  4664. */
  4665. }, {
  4666. key: "fromArray",
  4667. value: function fromArray(arr) {
  4668. var gotArr = Util.isArray(arr),
  4669. lon = gotArr && arr[0],
  4670. lat = gotArr && arr[1];
  4671. return new LonLat(lon, lat);
  4672. }
  4673. }]);
  4674. return LonLat;
  4675. }();
  4676. ;// CONCATENATED MODULE: ./src/common/commontypes/Bounds.js
  4677. function Bounds_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  4678. 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); } }
  4679. function Bounds_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bounds_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bounds_defineProperties(Constructor, staticProps); return Constructor; }
  4680. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  4681. * This program are made available under the terms of the Apache License, Version 2.0
  4682. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  4683. /**
  4684. * @class SuperMap.Bounds
  4685. * @category BaseTypes Geometry
  4686. * @classdesc 表示边界类实例。使用 bounds 之前需要设置 left,bottom,right,top 四个属性,这些属性的初始值为 null。
  4687. * @param {number} [left] - 左边界,注意考虑宽度,理论上小于 right 值。
  4688. * @param {number} [bottom] - 下边界。考虑高度,理论上小于 top 值。
  4689. * @param {number} [right] - 右边界。
  4690. * @param {number} [top] - 上边界。
  4691. * @param {Array.<number>} [array] - [left, bottom, right, top],如果同时传多个参数,则使用左下右上组成的数组。
  4692. * @example
  4693. * var bounds = new SuperMap.Bounds();
  4694. * bounds.extend(new SuperMap.LonLat(4,5));
  4695. * bounds.extend(new SuperMap.LonLat(5,6));
  4696. * bounds.toBBOX(); // returns 4,5,5,6
  4697. */
  4698. var Bounds = /*#__PURE__*/function () {
  4699. function Bounds(left, bottom, right, top) {
  4700. Bounds_classCallCheck(this, Bounds);
  4701. if (Util.isArray(left)) {
  4702. top = left[3];
  4703. right = left[2];
  4704. bottom = left[1];
  4705. left = left[0];
  4706. }
  4707. /**
  4708. * @member {number} SuperMap.Bounds.prototype.left
  4709. * @description 最小的水平坐标系。
  4710. */
  4711. this.left = left != null ? Util.toFloat(left) : this.left;
  4712. /**
  4713. * @member {number} SuperMap.Bounds.prototype.bottom
  4714. * @description 最小的垂直坐标系。
  4715. */
  4716. this.bottom = bottom != null ? Util.toFloat(bottom) : this.bottom;
  4717. /**
  4718. * @member {number} SuperMap.Bounds.prototype.right
  4719. * @description 最大的水平坐标系。
  4720. */
  4721. this.right = right != null ? Util.toFloat(right) : this.right;
  4722. /**
  4723. * @member {number} SuperMap.Bounds.prototype.top
  4724. * @description 最大的垂直坐标系。
  4725. */
  4726. this.top = top != null ? Util.toFloat(top) : this.top;
  4727. /**
  4728. * @member {SuperMap.LonLat} SuperMap.Bounds.prototype.centerLonLat
  4729. * @description bounds 的地图空间的中心点。用 getCenterLonLat() 获得。
  4730. */
  4731. this.centerLonLat = null;
  4732. this.CLASS_NAME = "SuperMap.Bounds";
  4733. }
  4734. /**
  4735. * @function SuperMap.Bounds.prototype.clone
  4736. * @description 复制当前 bounds 对象。
  4737. * @example
  4738. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  4739. * var bounds2 = bounds1.clone();
  4740. * @returns {SuperMap.Bounds} 返回一个克隆的 bounds。
  4741. */
  4742. Bounds_createClass(Bounds, [{
  4743. key: "clone",
  4744. value: function clone() {
  4745. return new Bounds(this.left, this.bottom, this.right, this.top);
  4746. }
  4747. /**
  4748. * @function SuperMap.Bounds.prototype.equals
  4749. * @description 判断两个 bounds 对象是否相等。
  4750. * @example
  4751. * var bounds1 = new SuperMap.Bounds(-180,-90,180,90);
  4752. * var bounds2 = new SuperMap.Bounds(-180,-90,180,90);
  4753. * var isEquals = bounds1.equals(bounds2);
  4754. * @param {SuperMap.Bounds} bounds - 需要进行计较的 bounds。
  4755. * @returns {boolean} 如果 bounds 对象的边和传入的 bounds 一致则返回 true,不一致或传入的 bounds 参数为 NULL 则返回 false。
  4756. */
  4757. }, {
  4758. key: "equals",
  4759. value: function equals(bounds) {
  4760. var equals = false;
  4761. if (bounds != null) {
  4762. equals = this.left === bounds.left && this.right === bounds.right && this.top === bounds.top && this.bottom === bounds.bottom;
  4763. }
  4764. return equals;
  4765. }
  4766. /**
  4767. * @function SuperMap.Bounds.prototype.toString
  4768. * @description 返回此对象的字符串形式。
  4769. * @example
  4770. * var bounds = new SuperMap.Bounds(-180,-90,180,90);
  4771. * var str = bounds.toString();
  4772. * @returns {string} 边界对象的字符串表示形式(left,bottom,right,top),例如: "-180,-90,180,90"。
  4773. */
  4774. }, {
  4775. key: "toString",
  4776. value: function toString() {
  4777. return [this.left, this.bottom, this.right, this.top].join(",");
  4778. }
  4779. /**
  4780. * @function SuperMap.Bounds.prototype.toArray
  4781. * @description 边界对象的数组表示形式。
  4782. * @example
  4783. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4784. * //array1 = [-180,-90,100,80];
  4785. * var array1 = bounds.toArray();
  4786. * //array1 = [-90,-180,80,100];
  4787. * var array2 = bounds.toArray(true);
  4788. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  4789. * 如果设为 true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  4790. * @returns {Array.<number>} left, bottom, right, top 数组。
  4791. */
  4792. }, {
  4793. key: "toArray",
  4794. value: function toArray(reverseAxisOrder) {
  4795. if (reverseAxisOrder === true) {
  4796. return [this.bottom, this.left, this.top, this.right];
  4797. } else {
  4798. return [this.left, this.bottom, this.right, this.top];
  4799. }
  4800. }
  4801. /**
  4802. * @function SuperMap.Bounds.prototype.toBBOX
  4803. * @description 取小数点后 decimal 位数字进行四舍五入再转换为 BBOX 字符串。
  4804. * @example
  4805. * var bounds = new SuperMap.Bounds(-1.1234567,-1.7654321,1.4444444,1.5555555);
  4806. * //str1 = "-1.123457,-1.765432,1.444444,1.555556";
  4807. * var str1 = bounds.toBBOX();
  4808. * //str2 = "-1.1,-1.8,1.4,1.6";
  4809. * var str2 = bounds.toBBOX(1);
  4810. * //str2 = "-1.8,-1.1,1.6,1.4";
  4811. * var str2 = bounds.toBBOX(1,true);
  4812. * @param {integer} [decimal=6] - 边界方位坐标的有效数字个数。
  4813. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。
  4814. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  4815. * @returns {string} 边界对象的字符串表示形式,如:"5,42,10,45"。
  4816. */
  4817. }, {
  4818. key: "toBBOX",
  4819. value: function toBBOX(decimal, reverseAxisOrder) {
  4820. if (decimal == null) {
  4821. decimal = 6;
  4822. }
  4823. var mult = Math.pow(10, decimal);
  4824. var xmin = Math.round(this.left * mult) / mult;
  4825. var ymin = Math.round(this.bottom * mult) / mult;
  4826. var xmax = Math.round(this.right * mult) / mult;
  4827. var ymax = Math.round(this.top * mult) / mult;
  4828. if (reverseAxisOrder === true) {
  4829. return ymin + "," + xmin + "," + ymax + "," + xmax;
  4830. } else {
  4831. return xmin + "," + ymin + "," + xmax + "," + ymax;
  4832. }
  4833. }
  4834. /**
  4835. * @function SuperMap.Bounds.prototype.toGeometry
  4836. * @description 基于当前边界范围创建一个新的多边形对象。
  4837. * @example
  4838. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4839. * //SuperMap.Geometry.Polygon对象
  4840. * var geo = bounds.toGeometry();
  4841. * @returns {SuperMap.Geometry.Polygon} 基于当前 bounds 坐标创建的新的多边形。
  4842. */
  4843. // toGeometry() {
  4844. // return new Polygon([
  4845. // new LinearRing([
  4846. // new Point(this.left, this.bottom),
  4847. // new Point(this.right, this.bottom),
  4848. // new Point(this.right, this.top),
  4849. // new Point(this.left, this.top)
  4850. // ])
  4851. // ]);
  4852. // }
  4853. /**
  4854. * @function SuperMap.Bounds.prototype.getWidth
  4855. * @description 获取 bounds 的宽度。
  4856. * @example
  4857. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4858. * //width = 280;
  4859. * var width = bounds.getWidth();
  4860. * @returns {float} 获取当前 bounds 的宽度(right 减去 left)。
  4861. */
  4862. }, {
  4863. key: "getWidth",
  4864. value: function getWidth() {
  4865. return this.right - this.left;
  4866. }
  4867. /**
  4868. * @function SuperMap.Bounds.prototype.getHeight
  4869. * @description 获取 bounds 的高度。
  4870. * @example
  4871. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4872. * //height = 170;
  4873. * var height = bounds.getHeight();
  4874. * @returns {float} 返回边界高度(top 减去 bottom)。
  4875. */
  4876. }, {
  4877. key: "getHeight",
  4878. value: function getHeight() {
  4879. return this.top - this.bottom;
  4880. }
  4881. /**
  4882. * @function SuperMap.Bounds.prototype.getSize
  4883. * @description 获取边框大小。
  4884. * @example
  4885. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4886. * var size = bounds.getSize();
  4887. * @returns {SuperMap.Size} 返回边框大小。
  4888. */
  4889. }, {
  4890. key: "getSize",
  4891. value: function getSize() {
  4892. return new Size(this.getWidth(), this.getHeight());
  4893. }
  4894. /**
  4895. * @function SuperMap.Bounds.prototype.getCenterPixel
  4896. * @description 获取像素格式的范围中心点。
  4897. * @example
  4898. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4899. * var pixel = bounds.getCenterPixel();
  4900. * @returns {SuperMap.Pixel} 返回像素格式的当前范围的中心点。
  4901. */
  4902. }, {
  4903. key: "getCenterPixel",
  4904. value: function getCenterPixel() {
  4905. return new Pixel((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  4906. }
  4907. /**
  4908. * @function SuperMap.Bounds.prototype.getCenterLonLat
  4909. * @description 获取地理格式的范围中心点。
  4910. * @example
  4911. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  4912. * var lonlat = bounds.getCenterLonLat();
  4913. * @returns {SuperMap.LonLat} 返回当前地理范围的中心点。
  4914. */
  4915. }, {
  4916. key: "getCenterLonLat",
  4917. value: function getCenterLonLat() {
  4918. if (!this.centerLonLat) {
  4919. this.centerLonLat = new LonLat((this.left + this.right) / 2, (this.bottom + this.top) / 2);
  4920. }
  4921. return this.centerLonLat;
  4922. }
  4923. /**
  4924. * @function SuperMap.Bounds.prototype.scale
  4925. * @description 按照比例扩大/缩小出一个新的 bounds。
  4926. * @example
  4927. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  4928. * var bounds2 = bounds.scale(2);
  4929. * @param {float} [ratio=1] - 需要扩大的比例。
  4930. * @param {(SuperMap.Pixel|SuperMap.LonLat)} [origin] - 扩大时的基准点,默认为当前 bounds 的中心点。
  4931. * @returns {SuperMap.Bounds} 返回通过 ratio、origin 计算得到的新的边界范围。
  4932. */
  4933. }, {
  4934. key: "scale",
  4935. value: function scale(ratio, origin) {
  4936. ratio = ratio ? ratio : 1;
  4937. if (origin == null) {
  4938. origin = this.getCenterLonLat();
  4939. }
  4940. var origx, origy; // get origin coordinates
  4941. if (origin.CLASS_NAME === "SuperMap.LonLat") {
  4942. origx = origin.lon;
  4943. origy = origin.lat;
  4944. } else {
  4945. origx = origin.x;
  4946. origy = origin.y;
  4947. }
  4948. var left = (this.left - origx) * ratio + origx;
  4949. var bottom = (this.bottom - origy) * ratio + origy;
  4950. var right = (this.right - origx) * ratio + origx;
  4951. var top = (this.top - origy) * ratio + origy;
  4952. return new Bounds(left, bottom, right, top);
  4953. }
  4954. /**
  4955. * @function SuperMap.Bounds.prototype.add
  4956. * @description 在当前的 Bounds 上按照传入的坐标点进行平移,返回新的范围。
  4957. * @example
  4958. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  4959. * //bounds2 是新的 bounds
  4960. * var bounds2 = bounds.add(20,10);
  4961. * @param {float} x - 传入坐标点的 x 坐标。
  4962. * @param {float} y - 传入坐标点的 y 坐标。
  4963. * @returns {SuperMap.Bounds} 返回一个新的 bounds,此 bounds 的坐标是由传入的 x,y 参数与当前 bounds 坐标计算所得。
  4964. */
  4965. }, {
  4966. key: "add",
  4967. value: function add(x, y) {
  4968. if (x == null || y == null) {
  4969. throw new TypeError('Bounds.add cannot receive null values');
  4970. }
  4971. return new Bounds(this.left + x, this.bottom + y, this.right + x, this.top + y);
  4972. }
  4973. /**
  4974. * @function SuperMap.Bounds.prototype.extend
  4975. * @description 在当前 bounds 上扩展 bounds,支持 point,lanlat 和 bounds。扩展后的 bounds 的范围是两者的结合。
  4976. * @example
  4977. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  4978. * //bounds 改变
  4979. * bounds.extend(new SuperMap.LonLat(50,60));
  4980. * @param {(SuperMap.Geometry.Point|SuperMap.LonLat|SuperMap.Bounds)} object - 可以是 point、lonlat 和 bounds。
  4981. */
  4982. }, {
  4983. key: "extend",
  4984. value: function extend(object) {
  4985. var bounds = null;
  4986. if (object) {
  4987. // clear cached center location
  4988. switch (object.CLASS_NAME) {
  4989. case "SuperMap.LonLat":
  4990. bounds = new Bounds(object.lon, object.lat, object.lon, object.lat);
  4991. break;
  4992. case "SuperMap.Geometry.Point":
  4993. bounds = new Bounds(object.x, object.y, object.x, object.y);
  4994. break;
  4995. case "SuperMap.Bounds":
  4996. bounds = object;
  4997. break;
  4998. }
  4999. if (bounds) {
  5000. this.centerLonLat = null;
  5001. if (this.left == null || bounds.left < this.left) {
  5002. this.left = bounds.left;
  5003. }
  5004. if (this.bottom == null || bounds.bottom < this.bottom) {
  5005. this.bottom = bounds.bottom;
  5006. }
  5007. if (this.right == null || bounds.right > this.right) {
  5008. this.right = bounds.right;
  5009. }
  5010. if (this.top == null || bounds.top > this.top) {
  5011. this.top = bounds.top;
  5012. }
  5013. }
  5014. }
  5015. }
  5016. /**
  5017. * @function SuperMap.Bounds.prototype.containsLonLat
  5018. * @description 判断传入的坐标是否在范围内。
  5019. * @example
  5020. * var bounds1 = new SuperMap.Bounds(-50,-50,40,40);
  5021. * //isContains1 = true
  5022. * //这里的第二个参数可以直接为 boolean 类型,也就是inclusive
  5023. * var isContains1 = bounds.containsLonLat(new SuperMap.LonLat(40,40),true);
  5024. *
  5025. * //(40,40)在范围内,同样(40+360,40)也在范围内
  5026. * var bounds2 = new SuperMap.Bounds(-50,-50,40,40);
  5027. * //isContains2 = true;
  5028. * var isContains2 = bounds2.containsLonLat(
  5029. * new SuperMap.LonLat(400,40),
  5030. * {
  5031. * inclusive:true,
  5032. * //全球的范围
  5033. * worldBounds: new SuperMap.Bounds(-180,-90,180,90)
  5034. * }
  5035. * );
  5036. * @param {(SuperMap.LonLat|Object)} ll - <SuperMap.LonLat> 对象或者是一个包含 'lon' 与 'lat' 属性的对象。
  5037. * @param {Object} options - 可选参数。
  5038. * @param {boolean} [options.inclusive=true] - 是否包含边界。
  5039. * @param {SuperMap.Bounds} [options.worldBounds] - 如果提供 worldBounds 参数, 如果 ll 参数提供的坐标超出了世界边界(worldBounds),
  5040. * 但是通过日界线的转化可以被包含, 它将被认为是包含在该范围内的。
  5041. * @returns {boolean} 传入坐标是否包含在范围内。
  5042. */
  5043. }, {
  5044. key: "containsLonLat",
  5045. value: function containsLonLat(ll, options) {
  5046. if (typeof options === "boolean") {
  5047. options = {
  5048. inclusive: options
  5049. };
  5050. }
  5051. options = options || {};
  5052. var contains = this.contains(ll.lon, ll.lat, options.inclusive),
  5053. worldBounds = options.worldBounds; //日界线以外的也有可能算包含,
  5054. if (worldBounds && !contains) {
  5055. var worldWidth = worldBounds.getWidth();
  5056. var worldCenterX = (worldBounds.left + worldBounds.right) / 2; //这一步很关键
  5057. var worldsAway = Math.round((ll.lon - worldCenterX) / worldWidth);
  5058. contains = this.containsLonLat({
  5059. lon: ll.lon - worldsAway * worldWidth,
  5060. lat: ll.lat
  5061. }, {
  5062. inclusive: options.inclusive
  5063. });
  5064. }
  5065. return contains;
  5066. }
  5067. /**
  5068. * @function SuperMap.Bounds.prototype.containsPixel
  5069. * @description 判断传入的像素是否在范围内。直接匹配大小,不涉及像素和地理转换。
  5070. * @example
  5071. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  5072. * //isContains = true
  5073. * var isContains = bounds.containsPixel(new SuperMap.Pixel(40,40),true);
  5074. * @param {SuperMap.Pixel} px - 提供的像素参数。
  5075. * @param {boolean} [inclusive=true] - 是否包含边界。
  5076. * @returns {boolean} 传入的 pixel 在当前边界范围之内。
  5077. */
  5078. }, {
  5079. key: "containsPixel",
  5080. value: function containsPixel(px, inclusive) {
  5081. return this.contains(px.x, px.y, inclusive);
  5082. }
  5083. /**
  5084. * @function SuperMap.Bounds.prototype.contains
  5085. * @description 判断传入的 x,y 坐标值是否在范围内。
  5086. * @example
  5087. * var bounds = new SuperMap.Bounds(-50,-50,40,40);
  5088. * //isContains = true
  5089. * var isContains = bounds.contains(40,40,true);
  5090. * @param {float} x - 传入的 x 坐标值。
  5091. * @param {float} y - 传入的 y 坐标值。
  5092. * @param {boolean} [inclusive=true] - 是否包含边界。
  5093. * @returns {boolean} 传入的 x,y 坐标是否在当前范围内。
  5094. */
  5095. }, {
  5096. key: "contains",
  5097. value: function contains(x, y, inclusive) {
  5098. //set default
  5099. if (inclusive == null) {
  5100. inclusive = true;
  5101. }
  5102. if (x == null || y == null) {
  5103. return false;
  5104. } //x = Util.toFloat(x);
  5105. //y = Util.toFloat(y);
  5106. var contains = false;
  5107. if (inclusive) {
  5108. contains = x >= this.left && x <= this.right && y >= this.bottom && y <= this.top;
  5109. } else {
  5110. contains = x > this.left && x < this.right && y > this.bottom && y < this.top;
  5111. }
  5112. return contains;
  5113. }
  5114. /**
  5115. * @function SuperMap.Bounds.prototype.intersectsBounds
  5116. * @description 判断目标边界范围是否与当前边界范围相交。如果两个边界范围中的任意
  5117. * 边缘相交或者一个边界包含了另外一个就认为这两个边界相交。
  5118. * @example
  5119. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5120. * var isIntersects = bounds.intersectsBounds(
  5121. * new SuperMap.Bounds(-170,-90,120,80)
  5122. * );
  5123. * @param {SuperMap.Bounds} bounds - 目标边界。
  5124. * @param {Object} options - 参数。
  5125. * @param {boolean} [options.inclusive=true] - 边缘重合也看成相交。如果是false,
  5126. * 两个边界范围没有重叠部分仅仅是在边缘相接(重合),
  5127. * 这种情况被认为没有相交。
  5128. * @param {SuperMap.Bounds} [options.worldBounds] - 提供了 worldBounds 参数, 如果他们相交时
  5129. * 是在全球范围内, 两个边界将被视为相交。这仅适用于交叉或完全不在世界范围的边界。
  5130. * @returns {boolean} 传入的 bounds 对象与当前 bounds 相交。
  5131. */
  5132. }, {
  5133. key: "intersectsBounds",
  5134. value: function intersectsBounds(bounds, options) {
  5135. if (typeof options === "boolean") {
  5136. options = {
  5137. inclusive: options
  5138. };
  5139. }
  5140. options = options || {};
  5141. if (options.worldBounds) {
  5142. var self = this.wrapDateLine(options.worldBounds);
  5143. bounds = bounds.wrapDateLine(options.worldBounds);
  5144. } else {
  5145. self = this;
  5146. }
  5147. if (options.inclusive == null) {
  5148. options.inclusive = true;
  5149. }
  5150. var intersects = false;
  5151. var mightTouch = self.left === bounds.right || self.right === bounds.left || self.top === bounds.bottom || self.bottom === bounds.top; // if the two bounds only touch at an edge, and inclusive is false,
  5152. // then the bounds don't *really* intersect.
  5153. if (options.inclusive || !mightTouch) {
  5154. // otherwise, if one of the boundaries even partially contains another,
  5155. // inclusive of the edges, then they do intersect.
  5156. var inBottom = bounds.bottom >= self.bottom && bounds.bottom <= self.top || self.bottom >= bounds.bottom && self.bottom <= bounds.top;
  5157. var inTop = bounds.top >= self.bottom && bounds.top <= self.top || self.top > bounds.bottom && self.top < bounds.top;
  5158. var inLeft = bounds.left >= self.left && bounds.left <= self.right || self.left >= bounds.left && self.left <= bounds.right;
  5159. var inRight = bounds.right >= self.left && bounds.right <= self.right || self.right >= bounds.left && self.right <= bounds.right;
  5160. intersects = (inBottom || inTop) && (inLeft || inRight);
  5161. } // document me
  5162. if (options.worldBounds && !intersects) {
  5163. var world = options.worldBounds;
  5164. var width = world.getWidth();
  5165. var selfCrosses = !world.containsBounds(self);
  5166. var boundsCrosses = !world.containsBounds(bounds);
  5167. if (selfCrosses && !boundsCrosses) {
  5168. bounds = bounds.add(-width, 0);
  5169. intersects = self.intersectsBounds(bounds, {
  5170. inclusive: options.inclusive
  5171. });
  5172. } else if (boundsCrosses && !selfCrosses) {
  5173. self = self.add(-width, 0);
  5174. intersects = bounds.intersectsBounds(self, {
  5175. inclusive: options.inclusive
  5176. });
  5177. }
  5178. }
  5179. return intersects;
  5180. }
  5181. /**
  5182. * @function SuperMap.Bounds.prototype.containsBounds
  5183. * @description 判断目标边界是否被当前边界包含在内。
  5184. * @example
  5185. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5186. * var isContains = bounds.containsBounds(
  5187. * new SuperMap.Bounds(-170,-90,100,80),true,true
  5188. * );
  5189. * @param {SuperMap.Bounds} bounds - 目标边界。
  5190. * @param {boolean} [partial=false] - 目标边界的任意部分都包含在当前边界中则被认为是包含关系。
  5191. * 如果设为 false,整个目标边界全部被包含在当前边界范围内。
  5192. * @param {boolean} [inclusive=true] - 边缘共享被视为包含。
  5193. * @returns {boolean} 传入的边界被当前边界包含。
  5194. */
  5195. }, {
  5196. key: "containsBounds",
  5197. value: function containsBounds(bounds, partial, inclusive) {
  5198. if (partial == null) {
  5199. partial = false;
  5200. }
  5201. if (inclusive == null) {
  5202. inclusive = true;
  5203. }
  5204. var bottomLeft = this.contains(bounds.left, bounds.bottom, inclusive);
  5205. var bottomRight = this.contains(bounds.right, bounds.bottom, inclusive);
  5206. var topLeft = this.contains(bounds.left, bounds.top, inclusive);
  5207. var topRight = this.contains(bounds.right, bounds.top, inclusive);
  5208. return partial ? bottomLeft || bottomRight || topLeft || topRight : bottomLeft && bottomRight && topLeft && topRight;
  5209. }
  5210. /**
  5211. * @function SuperMap.Bounds.prototype.determineQuadrant
  5212. * @description 判断传入坐标是否在 bounds 范围内的象限。以 bounds 中心点为坐标原点。
  5213. * @example
  5214. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5215. * //str = "tr";
  5216. * var str = bounds.determineQuadrant(
  5217. * new SuperMap.LonLat(20,20)
  5218. * );
  5219. * @param {SuperMap.LonLat} lonlat - 传入的坐标对象。
  5220. * @returns {string} 传入坐标所在的象限("br" "tr" "tl" "bl" 分别对应"右下","右上","左上" "左下")。
  5221. */
  5222. }, {
  5223. key: "determineQuadrant",
  5224. value: function determineQuadrant(lonlat) {
  5225. var quadrant = "";
  5226. var center = this.getCenterLonLat();
  5227. quadrant += lonlat.lat < center.lat ? "b" : "t";
  5228. quadrant += lonlat.lon < center.lon ? "l" : "r";
  5229. return quadrant;
  5230. }
  5231. /**
  5232. * @function SuperMap.Bounds.prototype.wrapDateLine
  5233. * @description 将当前 bounds 移动到最大边界范围内部(所谓的内部是相交或者内部)。
  5234. * @example
  5235. * var bounds = new SuperMap.Bounds(380,-40,400,-20);
  5236. * var maxExtent = new SuperMap.Bounds(-180,-90,100,80);
  5237. * //新的bounds
  5238. * var newBounds = bounds.wrapDateLine(maxExtent);
  5239. * @param {SuperMap.Bounds} maxExtent - 最大的边界范围(一般是全球范围)。
  5240. * @param {Object} options - 可选选项参数。
  5241. * @param {float} [options.leftTolerance=0] - left 允许的误差。
  5242. * @param {float} [options.rightTolerance=0] - right 允许的误差。
  5243. * @returns {SuperMap.Bounds} 克隆当前边界。如果当前边界完全在最大范围之外此函数则返回一个不同值的边界,
  5244. * 若落在最大边界的左边,则给当前的bounds值加上最大范围的宽度,即向右移动,
  5245. * 若落在右边,则向左移动,即给当前的bounds值加上负的最大范围的宽度。
  5246. */
  5247. }, {
  5248. key: "wrapDateLine",
  5249. value: function wrapDateLine(maxExtent, options) {
  5250. options = options || {};
  5251. var leftTolerance = options.leftTolerance || 0;
  5252. var rightTolerance = options.rightTolerance || 0;
  5253. var newBounds = this.clone();
  5254. if (maxExtent) {
  5255. var width = maxExtent.getWidth(); //如果 newBounds 在 maxExtent 的左边,那么一直向右移动,直到相交或者包含为止,每次移动width
  5256. //shift right?
  5257. while (newBounds.left < maxExtent.left && newBounds.right - rightTolerance <= maxExtent.left) {
  5258. newBounds = newBounds.add(width, 0);
  5259. } //如果 newBounds 在 maxExtent 的右边,那么一直向左移动,直到相交或者包含为止,每次移动width
  5260. //shift left?
  5261. while (newBounds.left + leftTolerance >= maxExtent.right && newBounds.right > maxExtent.right) {
  5262. newBounds = newBounds.add(-width, 0);
  5263. } //如果和右边相交,左边又在内部,那么再次向左边移动一次
  5264. // crosses right only? force left
  5265. var newLeft = newBounds.left + leftTolerance;
  5266. if (newLeft < maxExtent.right && newLeft > maxExtent.left && newBounds.right - rightTolerance > maxExtent.right) {
  5267. newBounds = newBounds.add(-width, 0);
  5268. }
  5269. }
  5270. return newBounds;
  5271. }
  5272. /**
  5273. * @function SuperMap.Bounds.prototype.toServerJSONObject
  5274. * @description 转换成对应的 JSON 格式对象。
  5275. * @example
  5276. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5277. * var obj = bounds.toServerJSONObject();
  5278. * @returns {Object} 返回 JSON 格式的 Object 对象。
  5279. */
  5280. }, {
  5281. key: "toServerJSONObject",
  5282. value: function toServerJSONObject() {
  5283. var jsonObject = {
  5284. rightTop: {
  5285. x: this.right,
  5286. y: this.top
  5287. },
  5288. leftBottom: {
  5289. x: this.left,
  5290. y: this.bottom
  5291. },
  5292. left: this.left,
  5293. right: this.right,
  5294. top: this.top,
  5295. bottom: this.bottom
  5296. };
  5297. return jsonObject;
  5298. }
  5299. /**
  5300. *
  5301. * @function SuperMap.Bounds.prototype.destroy
  5302. * @description 销毁此对象。
  5303. * 销毁后此对象的所有属性为 null,而不是初始值。
  5304. * @example
  5305. * var bounds = new SuperMap.Bounds(-180,-90,100,80);
  5306. * bounds.destroy();
  5307. */
  5308. }, {
  5309. key: "destroy",
  5310. value: function destroy() {
  5311. this.left = null;
  5312. this.right = null;
  5313. this.top = null;
  5314. this.bottom = null;
  5315. this.centerLonLat = null;
  5316. }
  5317. /**
  5318. * @function SuperMap.Bounds.fromString
  5319. * @description 通过字符串参数创建新的 bounds 的构造函数。
  5320. * @example
  5321. * var bounds = SuperMap.Bounds.fromString("-180,-90,100,80");
  5322. * @param {string} str - 边界字符串,用逗号隔开(e.g. <i>"5,42,10,45"</i>)。
  5323. * @param {boolean} [reverseAxisOrder=false] - 是否反转轴顺序。
  5324. * 如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  5325. * @returns {SuperMap.Bounds} 返回给定的字符串创建的新的边界对象。
  5326. */
  5327. }], [{
  5328. key: "fromString",
  5329. value: function fromString(str, reverseAxisOrder) {
  5330. var bounds = str.split(",");
  5331. return Bounds.fromArray(bounds, reverseAxisOrder);
  5332. }
  5333. /**
  5334. * @function SuperMap.Bounds.fromArray
  5335. * @description 通过边界框数组创建 Bounds。
  5336. * @example
  5337. * var bounds = SuperMap.Bounds.fromArray([-180,-90,100,80]);
  5338. * @param {Array.<float>} bbox - 边界值数组。(e.g. <i>[5,42,10,45]</i>)。
  5339. * @param {boolean} [reverseAxisOrder=false] - 是否是反转轴顺序。如果设为true,则倒转顺序(bottom,left,top,right),否则按正常轴顺序(left,bottom,right,top)。
  5340. * @returns {SuperMap.Bounds} 返回根据传入的数组创建的新的边界对象。
  5341. */
  5342. }, {
  5343. key: "fromArray",
  5344. value: function fromArray(bbox, reverseAxisOrder) {
  5345. return reverseAxisOrder === true ? new Bounds(bbox[1], bbox[0], bbox[3], bbox[2]) : new Bounds(bbox[0], bbox[1], bbox[2], bbox[3]);
  5346. }
  5347. /**
  5348. * @function SuperMap.Bounds.fromSize
  5349. * @description 通过传入的边界大小来创建新的边界。
  5350. * @example
  5351. * var bounds = SuperMap.Bounds.fromSize(new SuperMap.Size(20,10));
  5352. * @param {SuperMap.Size} size - 传入的边界大小。
  5353. * @returns {SuperMap.Bounds} 返回根据传入的边界大小的创建新的边界。
  5354. */
  5355. }, {
  5356. key: "fromSize",
  5357. value: function fromSize(size) {
  5358. return new Bounds(0, size.h, size.w, 0);
  5359. }
  5360. /**
  5361. * @function SuperMap.Bounds.oppositeQuadrant
  5362. * @description 反转象限。"t"和"b" 交换,"r"和"l"交换, 如:"tl"变为"br"。
  5363. * @param {string} quadrant - 代表象限的字符串,如:"tl"。
  5364. * @returns {string} 反转后的象限。
  5365. */
  5366. }, {
  5367. key: "oppositeQuadrant",
  5368. value: function oppositeQuadrant(quadrant) {
  5369. var opp = "";
  5370. opp += quadrant.charAt(0) === 't' ? 'b' : 't';
  5371. opp += quadrant.charAt(1) === 'l' ? 'r' : 'l';
  5372. return opp;
  5373. }
  5374. }]);
  5375. return Bounds;
  5376. }();
  5377. SuperMap.Bounds = Bounds;
  5378. ;// CONCATENATED MODULE: ./src/common/commontypes/Geometry.js
  5379. function Geometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5380. 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); } }
  5381. function Geometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) Geometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) Geometry_defineProperties(Constructor, staticProps); return Constructor; }
  5382. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5383. * This program are made available under the terms of the Apache License, Version 2.0
  5384. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5385. // import {WKT} from '../format/WKT';
  5386. // import {Vector} from './Vector';
  5387. /**
  5388. * @class SuperMap.Geometry
  5389. * @category BaseTypes Geometry
  5390. * @classdesc 几何对象类,描述地理对象的几何图形。
  5391. */
  5392. var Geometry = /*#__PURE__*/function () {
  5393. function Geometry() {
  5394. Geometry_classCallCheck(this, Geometry);
  5395. this.CLASS_NAME = "SuperMap.Geometry";
  5396. /**
  5397. * @member {string} SuperMap.Geometry.prototype.id
  5398. * @description 此几何对象的唯一标示符。
  5399. *
  5400. */
  5401. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  5402. /**
  5403. * @member {SuperMap.Geometry} SuperMap.Geometry.prototype.parent
  5404. * @description This is set when a Geometry is added as component
  5405. * of another geometry
  5406. */
  5407. this.parent = null;
  5408. /**
  5409. * @member {SuperMap.Bounds} SuperMap.Geometry.prototype.bounds
  5410. * @description 几何对象的范围。
  5411. *
  5412. */
  5413. this.bounds = null;
  5414. /**
  5415. * @member {interger} SuperMap.Geometry.prototype.SRID
  5416. * @description 投影坐标参数。通过该参数,服务器判断 Geometry 对象的坐标参考系是否与数据集相同,如果不同,则在数据入库前进行投影变换。
  5417. * @example
  5418. * var geometry= new SuperMap.Geometry();
  5419. * geometry. SRID=4326;
  5420. *
  5421. */
  5422. this.SRID = null;
  5423. }
  5424. /**
  5425. * @function SuperMap.Geometry.prototype.destroy
  5426. * @description 解构 Geometry 类,释放资源。
  5427. */
  5428. Geometry_createClass(Geometry, [{
  5429. key: "destroy",
  5430. value: function destroy() {
  5431. this.id = null;
  5432. this.bounds = null;
  5433. this.SRID = null;
  5434. }
  5435. /**
  5436. * @function SuperMap.Geometry.prototype.clone
  5437. * @description 创建克隆的几何图形。克隆的几何图形不设置非标准的属性。
  5438. * @returns {SuperMap.Geometry} 克隆的几何图形。
  5439. */
  5440. }, {
  5441. key: "clone",
  5442. value: function clone() {
  5443. return new Geometry();
  5444. }
  5445. /**
  5446. * @function SuperMap.Geometry.prototype.setBounds
  5447. * @description 设置此几何对象的 bounds。
  5448. * @param {SuperMap.Bounds} bounds - 范围。
  5449. */
  5450. }, {
  5451. key: "setBounds",
  5452. value: function setBounds(bounds) {
  5453. if (bounds) {
  5454. this.bounds = bounds.clone();
  5455. }
  5456. }
  5457. /**
  5458. * @function SuperMap.Geometry.prototype.clearBounds
  5459. * @description 清除几何对象的 bounds。
  5460. * 如果该对象有父类,也会清除父类几何对象的 bounds。
  5461. */
  5462. }, {
  5463. key: "clearBounds",
  5464. value: function clearBounds() {
  5465. this.bounds = null;
  5466. if (this.parent) {
  5467. this.parent.clearBounds();
  5468. }
  5469. }
  5470. /**
  5471. * @function SuperMap.Geometry.prototype.extendBounds
  5472. * @description Extend the existing bounds to include the new bounds.
  5473. * If geometry's bounds is not yet set, then set a new Bounds.
  5474. *
  5475. * @param {SuperMap.Bounds} newBounds - 范围。
  5476. */
  5477. }, {
  5478. key: "extendBounds",
  5479. value: function extendBounds(newBounds) {
  5480. var bounds = this.getBounds();
  5481. if (!bounds) {
  5482. this.setBounds(newBounds);
  5483. } else {
  5484. this.bounds.extend(newBounds);
  5485. }
  5486. }
  5487. /**
  5488. * @function SuperMap.Geometry.prototype.getBounds
  5489. * @description 获得几何图形的边界。如果没有设置边界,可通过计算获得。
  5490. * @returns {SuperMap.Bounds} 返回的几何对象的边界。
  5491. */
  5492. }, {
  5493. key: "getBounds",
  5494. value: function getBounds() {
  5495. if (this.bounds == null) {
  5496. this.calculateBounds();
  5497. }
  5498. return this.bounds;
  5499. }
  5500. /**
  5501. * @function SuperMap.Geometry.prototype.calculateBounds
  5502. * @description 重新计算几何图形的边界(需要在子类中实现此方法)。
  5503. */
  5504. }, {
  5505. key: "calculateBounds",
  5506. value: function calculateBounds() {//
  5507. // This should be overridden by subclasses.
  5508. //
  5509. }
  5510. /**
  5511. * @function SuperMap.Geometry.prototype.getVertices
  5512. * @description 返回几何图形的所有顶点的列表(需要在子类中实现此方法)。
  5513. * @param {boolean} [nodes] - 如果是 true,线则只返回线的末端点,如果 false,仅仅返回顶点,如果没有设置,则返回顶点。
  5514. * @returns {Array} 几何图形的顶点列表。
  5515. */
  5516. }, {
  5517. key: "getVertices",
  5518. value: function getVertices(nodes) {// eslint-disable-line no-unused-vars
  5519. }
  5520. /**
  5521. * @function SuperMap.Geometry.prototype.getArea
  5522. * @description 计算几何对象的面积 ,此方法需要在子类中定义。
  5523. * @returns {float} The area of the collection by summing its parts
  5524. */
  5525. }, {
  5526. key: "getArea",
  5527. value: function getArea() {
  5528. //to be overridden by geometries that actually have an area
  5529. //
  5530. return 0.0;
  5531. } // /**
  5532. // * @function SuperMap.Geometry.prototype.toString
  5533. // * @description 返回geometry对象的字符串表述,需要引入{@link SuperMap.Format.WKT}。此方法只能在子类实现,在父类使用会报错。
  5534. // * @returns {string} geometry对象的字符串表述(Well-Known Text)
  5535. // */
  5536. // toString() {
  5537. // var string;
  5538. // if (WKT) {
  5539. // var wkt = new WKT();
  5540. // string = wkt.write(new Vector(this));
  5541. // } else {
  5542. // string = Object.prototype.toString.call(this);
  5543. // }
  5544. // return string;
  5545. // }
  5546. }]);
  5547. return Geometry;
  5548. }();
  5549. SuperMap.Geometry = Geometry;
  5550. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Collection.js
  5551. function Collection_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Collection_typeof = function _typeof(obj) { return typeof obj; }; } else { Collection_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Collection_typeof(obj); }
  5552. function Collection_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5553. 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); } }
  5554. function Collection_createClass(Constructor, protoProps, staticProps) { if (protoProps) Collection_defineProperties(Constructor.prototype, protoProps); if (staticProps) Collection_defineProperties(Constructor, staticProps); return Constructor; }
  5555. function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } 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(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
  5556. function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
  5557. 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  5558. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  5559. 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); }; }
  5560. function _possibleConstructorReturn(self, call) { if (call && (Collection_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  5561. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5562. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  5563. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  5564. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5565. * This program are made available under the terms of the Apache License, Version 2.0
  5566. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5567. /**
  5568. * @class SuperMap.Geometry.Collection
  5569. * @classdesc 几何对象集合类,存储在本地的 components 属性中(可作为参数传递给构造函数)。<br>
  5570. * 随着新的几何图形添加到集合中,将不能被克隆,当移动几何图形时,需要指定参照物。<br>
  5571. * getArea 和 getLength 函数只能通过遍历存储几何对象的 components 数组,总计所有几何图形的面积和长度。
  5572. * @category BaseTypes Geometry
  5573. * @extends {SuperMap.Geometry}
  5574. * @param {Array.<SuperMap.Geometry>} components - 几何对象数组。
  5575. * @example
  5576. * var point1 = new SuperMap.Geometry.Point(10,20);
  5577. * var point2 = new SuperMap.Geometry.Point(30,40);
  5578. * var col = new SuperMap.Geometry.Collection([point1,point2]);
  5579. */
  5580. var Collection = /*#__PURE__*/function (_Geometry) {
  5581. _inherits(Collection, _Geometry);
  5582. var _super = _createSuper(Collection);
  5583. function Collection(components) {
  5584. var _this;
  5585. Collection_classCallCheck(this, Collection);
  5586. _this = _super.call(this);
  5587. /**
  5588. * @description 存储几何对象的数组。
  5589. * @member {Array.<SuperMap.Geometry>} SuperMap.Geometry.Collection.prototype.components
  5590. */
  5591. _this.components = [];
  5592. /**
  5593. * @member {Array.<string>} SuperMap.Geometry.Collection.prototype.componentTypes
  5594. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  5595. */
  5596. _this.componentTypes = null;
  5597. if (components != null) {
  5598. _this.addComponents(components);
  5599. }
  5600. _this.CLASS_NAME = "SuperMap.Geometry.Collection";
  5601. _this.geometryType = "Collection";
  5602. return _this;
  5603. }
  5604. /**
  5605. * @function SuperMap.Geometry.Collection.prototype.destroy
  5606. * @description 销毁几何图形。
  5607. */
  5608. Collection_createClass(Collection, [{
  5609. key: "destroy",
  5610. value: function destroy() {
  5611. this.components.length = 0;
  5612. this.components = null;
  5613. _get(_getPrototypeOf(Collection.prototype), "destroy", this).call(this);
  5614. }
  5615. /**
  5616. * @function SuperMap.Geometry.Collection.prototype.clone
  5617. * @description 克隆当前几何对象。
  5618. * @returns {SuperMap.Geometry.Collection} 克隆的几何对象集合。
  5619. */
  5620. }, {
  5621. key: "clone",
  5622. value: function clone() {
  5623. var geometry = new Collection();
  5624. for (var i = 0, len = this.components.length; i < len; i++) {
  5625. geometry.addComponent(this.components[i].clone());
  5626. } // catch any randomly tagged-on properties
  5627. Util.applyDefaults(geometry, this);
  5628. return geometry;
  5629. }
  5630. /**
  5631. * @function SuperMap.Geometry.Collection.prototype.getComponentsString
  5632. * @description 获取 components 字符串。
  5633. * @returns {string} components 字符串。
  5634. */
  5635. }, {
  5636. key: "getComponentsString",
  5637. value: function getComponentsString() {
  5638. var strings = [];
  5639. for (var i = 0, len = this.components.length; i < len; i++) {
  5640. strings.push(this.components[i].toShortString());
  5641. }
  5642. return strings.join(",");
  5643. }
  5644. /**
  5645. * @function SuperMap.Geometry.Collection.prototype.calculateBounds
  5646. * @description 通过遍历数组重新计算边界,在遍历每一子项中时调用 extend 方法。
  5647. */
  5648. }, {
  5649. key: "calculateBounds",
  5650. value: function calculateBounds() {
  5651. this.bounds = null;
  5652. var bounds = new Bounds();
  5653. var components = this.components;
  5654. if (components) {
  5655. for (var i = 0, len = components.length; i < len; i++) {
  5656. bounds.extend(components[i].getBounds());
  5657. }
  5658. } // to preserve old behavior, we only set bounds if non-null
  5659. // in the future, we could add bounds.isEmpty()
  5660. if (bounds.left != null && bounds.bottom != null && bounds.right != null && bounds.top != null) {
  5661. this.setBounds(bounds);
  5662. }
  5663. }
  5664. /**
  5665. * @function SuperMap.Geometry.Collection.prototype.addComponents
  5666. * @description 给几何图形对象添加元素。
  5667. * @param {Array.<SuperMap.Geometry>} components - 几何对象组件。
  5668. * @example
  5669. * var collection = new SuperMap.Geometry.Collection();
  5670. * collection.addComponents(new SuerpMap.Geometry.Point(10,10));
  5671. */
  5672. }, {
  5673. key: "addComponents",
  5674. value: function addComponents(components) {
  5675. if (!Util.isArray(components)) {
  5676. components = [components];
  5677. }
  5678. for (var i = 0, len = components.length; i < len; i++) {
  5679. this.addComponent(components[i]);
  5680. }
  5681. }
  5682. /**
  5683. * @function SuperMap.Geometry.Collection.prototype.addComponent
  5684. * @description 添加一个几何对象到集合中。如果设置了 componentTypes 类型,则添加的几何对象必须是 componentTypes 中的类型。
  5685. * @param {SuperMap.Geometry} component - 待添加的几何对象。
  5686. * @param {int} [index] - 几何对象插入的位置。
  5687. * @returns {boolean} 是否添加成功。
  5688. */
  5689. }, {
  5690. key: "addComponent",
  5691. value: function addComponent(component, index) {
  5692. var added = false;
  5693. if (component) {
  5694. if (this.componentTypes == null || Util.indexOf(this.componentTypes, component.CLASS_NAME) > -1) {
  5695. if (index != null && index < this.components.length) {
  5696. var components1 = this.components.slice(0, index);
  5697. var components2 = this.components.slice(index, this.components.length);
  5698. components1.push(component);
  5699. this.components = components1.concat(components2);
  5700. } else {
  5701. this.components.push(component);
  5702. }
  5703. component.parent = this;
  5704. this.clearBounds();
  5705. added = true;
  5706. }
  5707. }
  5708. return added;
  5709. }
  5710. /**
  5711. * @function SuperMap.Geometry.Collection.prototype.removeComponents
  5712. * @description 清除几何对象。
  5713. * @param {Array.<SuperMap.Geometry>} components - 需要清除的几何对象。
  5714. * @returns {boolean} 元素是否被删除。
  5715. */
  5716. }, {
  5717. key: "removeComponents",
  5718. value: function removeComponents(components) {
  5719. var removed = false;
  5720. if (!Util.isArray(components)) {
  5721. components = [components];
  5722. }
  5723. for (var i = components.length - 1; i >= 0; --i) {
  5724. removed = this.removeComponent(components[i]) || removed;
  5725. }
  5726. return removed;
  5727. }
  5728. /**
  5729. * @function SuperMap.Geometry.Collection.prototype.removeComponent
  5730. * @description 从集合中移除一个几何对象。
  5731. * @param {SuperMap.Geometry} component - 要移除的几何对象。
  5732. * @returns {boolean} 几何对象是否移除成功。
  5733. */
  5734. }, {
  5735. key: "removeComponent",
  5736. value: function removeComponent(component) {
  5737. Util.removeItem(this.components, component); // clearBounds() so that it gets recalculated on the next call
  5738. // to this.getBounds();
  5739. this.clearBounds();
  5740. return true;
  5741. }
  5742. /**
  5743. * @function SuperMap.Geometry.Collection.prototype.getArea
  5744. * @description 计算几何对象的面积。注意,这个方法在 {@link SuperMap.Geometry.Polygon} 类中需要重写。
  5745. * @returns {number} 几何图形的面积,是几何对象中所有组成部分的面积之和。
  5746. */
  5747. }, {
  5748. key: "getArea",
  5749. value: function getArea() {
  5750. var area = 0.0;
  5751. for (var i = 0, len = this.components.length; i < len; i++) {
  5752. area += this.components[i].getArea();
  5753. }
  5754. return area;
  5755. }
  5756. /**
  5757. * @function SuperMap.Geometry.Collection.prototype.equals
  5758. * @description 判断两个几何图形是否相等。如果所有的 components 具有相同的坐标,则认为是相等的。
  5759. * @param {SuperMap.Geometry} geometry - 需要判断的几何图形。
  5760. * @returns {boolean} 输入的几何图形与当前几何图形是否相等。
  5761. */
  5762. }, {
  5763. key: "equals",
  5764. value: function equals(geometry) {
  5765. var equivalent = true;
  5766. if (!geometry || !geometry.CLASS_NAME || this.CLASS_NAME !== geometry.CLASS_NAME) {
  5767. equivalent = false;
  5768. } else if (!Util.isArray(geometry.components) || geometry.components.length !== this.components.length) {
  5769. equivalent = false;
  5770. } else {
  5771. for (var i = 0, len = this.components.length; i < len; ++i) {
  5772. if (!this.components[i].equals(geometry.components[i])) {
  5773. equivalent = false;
  5774. break;
  5775. }
  5776. }
  5777. }
  5778. return equivalent;
  5779. }
  5780. /**
  5781. * @function SuperMap.Geometry.Collection.prototype.getVertices
  5782. * @description 返回几何对象的所有结点的列表。
  5783. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点如果没有设置此参数,则返回所有顶点。
  5784. * @returns {Array} 几何对象的顶点列表。
  5785. */
  5786. }, {
  5787. key: "getVertices",
  5788. value: function getVertices(nodes) {
  5789. var vertices = [];
  5790. for (var i = 0, len = this.components.length; i < len; ++i) {
  5791. Array.prototype.push.apply(vertices, this.components[i].getVertices(nodes));
  5792. }
  5793. return vertices;
  5794. }
  5795. }]);
  5796. return Collection;
  5797. }(Geometry);
  5798. SuperMap.Geometry.Collection = Collection;
  5799. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPoint.js
  5800. function MultiPoint_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPoint_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPoint_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPoint_typeof(obj); }
  5801. function MultiPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5802. 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); } }
  5803. function MultiPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) MultiPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) MultiPoint_defineProperties(Constructor, staticProps); return Constructor; }
  5804. 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 } }); if (superClass) MultiPoint_setPrototypeOf(subClass, superClass); }
  5805. function MultiPoint_setPrototypeOf(o, p) { MultiPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPoint_setPrototypeOf(o, p); }
  5806. 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); }; }
  5807. function MultiPoint_possibleConstructorReturn(self, call) { if (call && (MultiPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPoint_assertThisInitialized(self); }
  5808. function MultiPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5809. function MultiPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  5810. function MultiPoint_getPrototypeOf(o) { MultiPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPoint_getPrototypeOf(o); }
  5811. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5812. * This program are made available under the terms of the Apache License, Version 2.0
  5813. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5814. /**
  5815. * @class SuperMap.Geometry.MultiPoint
  5816. * @classdesc 几何对象多点类。
  5817. * @category BaseTypes Geometry
  5818. * @extends {SuperMap.Geometry.Collection}
  5819. * @param {Array.<SuperMap.Geometry.Point>} components - 点对象数组。
  5820. * @example
  5821. * var point1 = new SuperMap.Geometry.Point(5,6);
  5822. * var poine2 = new SuperMap.Geometry.Point(7,8);
  5823. * var multiPoint = new SuperMap.Geometry.MultiPoint([point1,point2]);
  5824. */
  5825. var MultiPoint = /*#__PURE__*/function (_Collection) {
  5826. MultiPoint_inherits(MultiPoint, _Collection);
  5827. var _super = MultiPoint_createSuper(MultiPoint);
  5828. function MultiPoint(components) {
  5829. var _this;
  5830. MultiPoint_classCallCheck(this, MultiPoint);
  5831. _this = _super.call(this, components);
  5832. /**
  5833. * @member {Array.<string>} [SuperMap.Geometry.MultiPoint.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  5834. * @description components 存储的的几何对象所支持的几何类型数组。
  5835. * @readonly
  5836. */
  5837. _this.componentTypes = ["SuperMap.Geometry.Point"];
  5838. _this.CLASS_NAME = "SuperMap.Geometry.MultiPoint";
  5839. _this.geometryType = "MultiPoint";
  5840. return _this;
  5841. }
  5842. /**
  5843. * @function SuperMap.Geometry.MultiPoint.prototype.addPoint
  5844. * @description 添加点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.addComponent} 方法。
  5845. * @param {SuperMap.Geometry.Point} point - 添加的点。
  5846. * @param {integer} [index] - 下标。
  5847. */
  5848. MultiPoint_createClass(MultiPoint, [{
  5849. key: "addPoint",
  5850. value: function addPoint(point, index) {
  5851. this.addComponent(point, index);
  5852. }
  5853. /**
  5854. * @function SuperMap.Geometry.MultiPoint.prototype.removePoint
  5855. * @description 移除点,封装了 {@link SuperMap.Geometry.Collection|SuperMap.Geometry.Collection.removeComponent} 方法。
  5856. * @param {SuperMap.Geometry.Point} point - 移除的点对象。
  5857. */
  5858. }, {
  5859. key: "removePoint",
  5860. value: function removePoint(point) {
  5861. this.removeComponent(point);
  5862. }
  5863. }]);
  5864. return MultiPoint;
  5865. }(Collection);
  5866. SuperMap.Geometry.MultiPoint = MultiPoint;
  5867. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Curve.js
  5868. function Curve_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Curve_typeof = function _typeof(obj) { return typeof obj; }; } else { Curve_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Curve_typeof(obj); }
  5869. function Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5870. 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 } }); if (superClass) Curve_setPrototypeOf(subClass, superClass); }
  5871. function Curve_setPrototypeOf(o, p) { Curve_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Curve_setPrototypeOf(o, p); }
  5872. 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); }; }
  5873. function Curve_possibleConstructorReturn(self, call) { if (call && (Curve_typeof(call) === "object" || typeof call === "function")) { return call; } return Curve_assertThisInitialized(self); }
  5874. function Curve_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5875. function Curve_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  5876. function Curve_getPrototypeOf(o) { Curve_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Curve_getPrototypeOf(o); }
  5877. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5878. * This program are made available under the terms of the Apache License, Version 2.0
  5879. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5880. /**
  5881. * @class SuperMap.Geometry.Curve
  5882. * @classdesc 几何对象曲线类。
  5883. * @category BaseTypes Geometry
  5884. * @extends {SuperMap.Geometry.MultiPoint}
  5885. * @param {Array.<SuperMap.Geometry.Point>} components - 几何对象数组。
  5886. * @example
  5887. * var point1 = new SuperMap.Geometry.Point(10,20);
  5888. * var point2 = new SuperMap.Geometry.Point(30,40);
  5889. * var curve = new SuperMap.Geometry.Curve([point1,point2]);
  5890. */
  5891. var Curve = /*#__PURE__*/function (_MultiPoint) {
  5892. Curve_inherits(Curve, _MultiPoint);
  5893. var _super = Curve_createSuper(Curve);
  5894. function Curve(components) {
  5895. var _this;
  5896. Curve_classCallCheck(this, Curve);
  5897. _this = _super.call(this, components);
  5898. /**
  5899. * @member {Array.<string>} [SuperMap.Geometry.Curve.prototype.componentType=["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"]]
  5900. * @description components 存储的的几何对象所支持的几何类型数组。
  5901. * @readonly
  5902. */
  5903. _this.componentTypes = ["SuperMap.Geometry.Point", "SuperMap.PointWithMeasure"];
  5904. _this.CLASS_NAME = "SuperMap.Geometry.Curve";
  5905. _this.geometryType = "Curve";
  5906. return _this;
  5907. }
  5908. return Curve;
  5909. }(MultiPoint);
  5910. SuperMap.Geometry.Curve = Curve;
  5911. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Point.js
  5912. function Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Point_typeof = function _typeof(obj) { return typeof obj; }; } else { Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Point_typeof(obj); }
  5913. function Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  5914. 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); } }
  5915. function Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) Point_defineProperties(Constructor, staticProps); return Constructor; }
  5916. function Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Point_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Point_get(target, property, receiver || target); }
  5917. function Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Point_getPrototypeOf(object); if (object === null) break; } return object; }
  5918. 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 } }); if (superClass) Point_setPrototypeOf(subClass, superClass); }
  5919. function Point_setPrototypeOf(o, p) { Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Point_setPrototypeOf(o, p); }
  5920. 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); }; }
  5921. function Point_possibleConstructorReturn(self, call) { if (call && (Point_typeof(call) === "object" || typeof call === "function")) { return call; } return Point_assertThisInitialized(self); }
  5922. function Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  5923. function Point_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  5924. function Point_getPrototypeOf(o) { Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Point_getPrototypeOf(o); }
  5925. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  5926. * This program are made available under the terms of the Apache License, Version 2.0
  5927. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  5928. /**
  5929. * @class SuperMap.Geometry.Point
  5930. * @classdesc 点几何对象类。
  5931. * @category BaseTypes Geometry
  5932. * @extends {SuperMap.Geometry}
  5933. * @param {float} x - x 坐标。
  5934. * @param {float} y - y 坐标。
  5935. * @param {string} [type = 'Point'] - 用来存储点的类型。
  5936. * @param {float} [tag] - 用来存储额外的属性,比如差值分析中的 Z 值。
  5937. * @example
  5938. * var point = new SuperMap.Geometry.Point(-111.04, 45.68);
  5939. */
  5940. var Point = /*#__PURE__*/function (_Geometry) {
  5941. Point_inherits(Point, _Geometry);
  5942. var _super = Point_createSuper(Point);
  5943. function Point(x, y, type, tag) {
  5944. var _this;
  5945. Point_classCallCheck(this, Point);
  5946. _this = _super.call(this, x, y, type, tag);
  5947. /**
  5948. * @member {float} SuperMap.Geometry.Point.prototype.x
  5949. * @description 横坐标。
  5950. */
  5951. _this.x = parseFloat(x);
  5952. /**
  5953. * @member {float} SuperMap.Geometry.Point.prototype.y
  5954. * @description 纵坐标。
  5955. */
  5956. _this.y = parseFloat(y);
  5957. /**
  5958. * @member {string} SuperMap.Geometry.Point.prototype.tag
  5959. * @description 用来存储额外的属性,比如差值分析中的 Z 值。
  5960. */
  5961. _this.tag = tag || tag == 0 ? parseFloat(tag) : null;
  5962. /**
  5963. * @member {string} SuperMap.Geometry.Point.prototype.tag
  5964. * @description 用来存储点的类型
  5965. */
  5966. _this.type = type || "Point";
  5967. _this.CLASS_NAME = "SuperMap.Geometry.Point";
  5968. _this.geometryType = "Point";
  5969. return _this;
  5970. }
  5971. /**
  5972. * @function SuperMap.Geometry.Point.prototype.clone
  5973. * @description 克隆点对象。
  5974. * @returns {SuperMap.Geometry.Point} 克隆后的点对象。
  5975. */
  5976. Point_createClass(Point, [{
  5977. key: "clone",
  5978. value: function clone(obj) {
  5979. if (obj == null) {
  5980. obj = new Point(this.x, this.y);
  5981. } // catch any randomly tagged-on properties
  5982. Util.applyDefaults(obj, this);
  5983. return obj;
  5984. }
  5985. /**
  5986. * @function SuperMap.Geometry.Point.prototype.calculateBounds
  5987. * @description 计算点对象的范围。
  5988. */
  5989. }, {
  5990. key: "calculateBounds",
  5991. value: function calculateBounds() {
  5992. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  5993. }
  5994. /**
  5995. * @function SuperMap.Geometry.Point.prototype.equals
  5996. * @description 判断两个点对象是否相等。如果两个点对象具有相同的坐标,则认为是相等的。
  5997. * @example
  5998. * var point= new SuperMap.Geometry.Point(0,0);
  5999. * var point1={x:0,y:0};
  6000. * var result= point.equals(point1);
  6001. * @param {SuperMap.Geometry.Point} geom - 需要判断的点对象。
  6002. * @returns {boolean} 两个点对象是否相等(true 为相等,false 为不等)。
  6003. */
  6004. }, {
  6005. key: "equals",
  6006. value: function equals(geom) {
  6007. var equals = false;
  6008. if (geom != null) {
  6009. equals = this.x === geom.x && this.y === geom.y || isNaN(this.x) && isNaN(this.y) && isNaN(geom.x) && isNaN(geom.y);
  6010. }
  6011. return equals;
  6012. }
  6013. /**
  6014. * @function SuperMap.Geometry.Point.prototype.move
  6015. * @description 沿着 x、y 轴的正方向上按照给定的位移移动点对象,move 不仅改变了几何对象的位置并且清理了边界缓存。
  6016. * @param {float} x - x 轴正方向上的偏移量。
  6017. * @param {float} y - y 轴正方向上偏移量。
  6018. */
  6019. }, {
  6020. key: "move",
  6021. value: function move(x, y) {
  6022. this.x = this.x + x;
  6023. this.y = this.y + y;
  6024. this.clearBounds();
  6025. }
  6026. /**
  6027. * @function SuperMap.Geometry.Point.prototype.toShortString
  6028. * @returns {string} 字符串代表点对象。(ex. <i>"5, 42"</i>)
  6029. */
  6030. }, {
  6031. key: "toShortString",
  6032. value: function toShortString() {
  6033. return this.x + ", " + this.y;
  6034. }
  6035. /**
  6036. * @function SuperMap.Geometry.Point.prototype.destroy
  6037. * @description 释放点对象的资源。
  6038. */
  6039. }, {
  6040. key: "destroy",
  6041. value: function destroy() {
  6042. this.x = null;
  6043. this.y = null;
  6044. this.tag = null;
  6045. Point_get(Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  6046. }
  6047. /**
  6048. * @function SuperMap.Geometry.Point.prototype.getVertices
  6049. * @description 返回点对象的所有顶点的列表。
  6050. * @param {boolean} [nodes] - 对于点对象此参数不起作用,直接返回点。
  6051. * @returns {Array} 几何图形的顶点列表。
  6052. */
  6053. }, {
  6054. key: "getVertices",
  6055. value: function getVertices(nodes) {
  6056. // eslint-disable-line no-unused-vars
  6057. return [this];
  6058. }
  6059. }]);
  6060. return Point;
  6061. }(Geometry);
  6062. SuperMap.Geometry.Point = Point;
  6063. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LineString.js
  6064. function LineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LineString_typeof = function _typeof(obj) { return typeof obj; }; } else { LineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LineString_typeof(obj); }
  6065. function LineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6066. 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); } }
  6067. function LineString_createClass(Constructor, protoProps, staticProps) { if (protoProps) LineString_defineProperties(Constructor.prototype, protoProps); if (staticProps) LineString_defineProperties(Constructor, staticProps); return Constructor; }
  6068. function LineString_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LineString_get = Reflect.get; } 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(receiver); } return desc.value; }; } return LineString_get(target, property, receiver || target); }
  6069. function LineString_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LineString_getPrototypeOf(object); if (object === null) break; } return object; }
  6070. 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 } }); if (superClass) LineString_setPrototypeOf(subClass, superClass); }
  6071. function LineString_setPrototypeOf(o, p) { LineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LineString_setPrototypeOf(o, p); }
  6072. 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); }; }
  6073. function LineString_possibleConstructorReturn(self, call) { if (call && (LineString_typeof(call) === "object" || typeof call === "function")) { return call; } return LineString_assertThisInitialized(self); }
  6074. function LineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6075. function LineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6076. function LineString_getPrototypeOf(o) { LineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LineString_getPrototypeOf(o); }
  6077. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6078. * This program are made available under the terms of the Apache License, Version 2.0
  6079. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6080. /**
  6081. * @class SuperMap.Geometry.LineString
  6082. * @classdesc 几何对象线串类。
  6083. * @category BaseTypes Geometry
  6084. * @param {Array.<SuperMap.Geometry.Point>} points - 用来生成线串的点数组。
  6085. * @extends {SuperMap.Geometry.Curve}
  6086. * @example
  6087. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  6088. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  6089. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  6090. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  6091. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  6092. * var roadLine = new SuperMap.Geometry.LineString(points);
  6093. */
  6094. var LineString = /*#__PURE__*/function (_Curve) {
  6095. LineString_inherits(LineString, _Curve);
  6096. var _super = LineString_createSuper(LineString);
  6097. function LineString(points) {
  6098. var _this;
  6099. LineString_classCallCheck(this, LineString);
  6100. _this = _super.call(this, points);
  6101. _this.CLASS_NAME = "SuperMap.Geometry.LineString";
  6102. _this.geometryType = "LineString";
  6103. return _this;
  6104. }
  6105. /**
  6106. * @function SuperMap.Geometry.LineString.prototype.removeComponent
  6107. * @description 只有在线串上有三个或更多的点的时候,才会允许移除点(否则结果将会是单一的点)。
  6108. * @param {SuperMap.Geometry.Point} point - 将被删除的点。
  6109. * @returns {boolean} 删除的点。
  6110. */
  6111. LineString_createClass(LineString, [{
  6112. key: "removeComponent",
  6113. value: function removeComponent(point) {
  6114. // eslint-disable-line no-unused-vars
  6115. var removed = this.components && this.components.length > 2;
  6116. if (removed) {
  6117. LineString_get(LineString_getPrototypeOf(LineString.prototype), "removeComponent", this).apply(this, arguments);
  6118. }
  6119. return removed;
  6120. }
  6121. /**
  6122. * @function SuperMap.Geometry.LineString.prototype.getSortedSegments
  6123. * @returns {Array} An array of segment objects. Segment objects have properties
  6124. * x1, y1, x2, and y2. The start point is represented by x1 and y1.
  6125. * The end point is represented by x2 and y2. Start and end are
  6126. * ordered so that x1 < x2.
  6127. */
  6128. }, {
  6129. key: "getSortedSegments",
  6130. value: function getSortedSegments() {
  6131. var numSeg = this.components.length - 1;
  6132. var segments = new Array(numSeg),
  6133. point1,
  6134. point2;
  6135. for (var i = 0; i < numSeg; ++i) {
  6136. point1 = this.components[i];
  6137. point2 = this.components[i + 1];
  6138. if (point1.x < point2.x) {
  6139. segments[i] = {
  6140. x1: point1.x,
  6141. y1: point1.y,
  6142. x2: point2.x,
  6143. y2: point2.y
  6144. };
  6145. } else {
  6146. segments[i] = {
  6147. x1: point2.x,
  6148. y1: point2.y,
  6149. x2: point1.x,
  6150. y2: point1.y
  6151. };
  6152. }
  6153. } // more efficient to define this somewhere static
  6154. function byX1(seg1, seg2) {
  6155. return seg1.x1 - seg2.x1;
  6156. }
  6157. return segments.sort(byX1);
  6158. }
  6159. /**
  6160. * @function SuperMap.Geometry.LineString.prototype.getVertices
  6161. * @description 返回几何图形的所有顶点的列表。
  6162. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false,则返回非端点的顶点。如果没有设置此参数,则返回所有顶点。
  6163. * @returns {Array} 几何图形的顶点列表。
  6164. */
  6165. }, {
  6166. key: "getVertices",
  6167. value: function getVertices(nodes) {
  6168. var vertices;
  6169. if (nodes === true) {
  6170. vertices = [this.components[0], this.components[this.components.length - 1]];
  6171. } else if (nodes === false) {
  6172. vertices = this.components.slice(1, this.components.length - 1);
  6173. } else {
  6174. vertices = this.components.slice();
  6175. }
  6176. return vertices;
  6177. }
  6178. /**
  6179. * @function SuperMap.Geometry.LineString.calculateCircle
  6180. * @description 三点画圆弧。
  6181. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  6182. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的圆弧控制点。
  6183. * @example
  6184. * var points = [];
  6185. * points.push(new SuperMap.Geometry.Point(-50,30));
  6186. * points.push(new SuperMap.Geometry.Point(-30,50));
  6187. * points.push(new SuperMap.Geometry.Point(2,60));
  6188. * var circle = SuperMap.Geometry.LineString.calculateCircle(points);
  6189. */
  6190. }], [{
  6191. key: "calculateCircle",
  6192. value: function calculateCircle(points) {
  6193. if (points.length < 3) {
  6194. return points;
  6195. }
  6196. var centerPoint = {},
  6197. p1 = points[0],
  6198. p2 = points[1],
  6199. p3 = points[2];
  6200. var R = 0,
  6201. dStep = 0,
  6202. direc = true,
  6203. dRotation = 0,
  6204. dRotationBegin = 0,
  6205. dRotationAngle = 0,
  6206. nSegmentCount = 72,
  6207. circlePoints = [];
  6208. var KTan13 = (p3.y - p1.y) / (p3.x - p1.x);
  6209. var B13 = p3.y - KTan13 * p3.x;
  6210. 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) {
  6211. circlePoints.push(p1);
  6212. circlePoints.push(p2);
  6213. circlePoints.push(p3);
  6214. } else {
  6215. 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));
  6216. 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));
  6217. var F = 4 * ((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y));
  6218. centerPoint.x = D / F;
  6219. centerPoint.y = E / F;
  6220. R = Math.sqrt((p1.x - centerPoint.x) * (p1.x - centerPoint.x) + (p1.y - centerPoint.y) * (p1.y - centerPoint.y));
  6221. var dis = (p1.x - p3.x) * (p1.x - p3.x) + (p1.y - p3.y) * (p1.y - p3.y);
  6222. var cons = (2 * R * R - dis) / (2 * R * R);
  6223. cons = cons >= 1 ? 1 : cons;
  6224. cons = cons <= -1 ? -1 : cons;
  6225. dRotationAngle = Math.acos(cons) * 180 / Math.PI;
  6226. if (p3.x == p1.x) {
  6227. dRotationAngle = centerPoint.x > p1.x && p2.x > p1.x || centerPoint.x < p1.x && p2.x < p1.x ? 360 - dRotationAngle : dRotationAngle;
  6228. } else {
  6229. 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;
  6230. }
  6231. dStep = dRotationAngle / 72;
  6232. if (p3.y != p1.y) {
  6233. if (p3.x == p1.x) {
  6234. if (p3.y > p1.y) {
  6235. if (p2.x < p1.x) {
  6236. direc = false;
  6237. }
  6238. } else {
  6239. if (p2.x > p1.x) {
  6240. direc = false;
  6241. }
  6242. }
  6243. } else if (p3.x < p1.x) {
  6244. if (p2.y < KTan13 * p2.x + B13) {
  6245. direc = false;
  6246. }
  6247. } else {
  6248. if (p2.y > KTan13 * p2.x + B13) {
  6249. direc = false;
  6250. }
  6251. }
  6252. } else {
  6253. if (p3.x > p1.x) {
  6254. if (p2.y > p1.y) {
  6255. direc = false;
  6256. }
  6257. } else {
  6258. if (p2.y < p1.y) {
  6259. direc = false;
  6260. }
  6261. }
  6262. }
  6263. var K10 = (p1.y - centerPoint.y) / (p1.x - centerPoint.x);
  6264. var atan10 = K10 >= 0 ? Math.atan(K10) * 180 / Math.PI : Math.abs(Math.atan(K10) * 180 / Math.PI) + 90;
  6265. var CY = Math.abs(centerPoint.y);
  6266. if (p1.y == CY && CY == p3.y) {
  6267. if (p1.x < p3.x) {
  6268. atan10 = atan10 + 180;
  6269. }
  6270. }
  6271. var newPY = p1.y - centerPoint.y;
  6272. circlePoints.push(p1);
  6273. for (var i = 1; i < nSegmentCount; i++) {
  6274. dRotation = dStep * i;
  6275. dRotationBegin = atan10;
  6276. if (direc) {
  6277. if (newPY >= 0) {
  6278. if (K10 >= 0) {
  6279. dRotationBegin = dRotationBegin + dRotation;
  6280. } else {
  6281. dRotationBegin = 180 - (dRotationBegin - 90) + dRotation;
  6282. }
  6283. } else {
  6284. if (K10 > 0) {
  6285. dRotationBegin = dRotationBegin - 180 + dRotation;
  6286. } else {
  6287. dRotationBegin = 90 - dRotationBegin + dRotation;
  6288. }
  6289. }
  6290. } else {
  6291. if (newPY >= 0) {
  6292. if (K10 >= 0) {
  6293. dRotationBegin = dRotationBegin - dRotation;
  6294. } else {
  6295. dRotationBegin = 180 - (dRotationBegin - 90) - dRotation;
  6296. }
  6297. } else {
  6298. if (K10 >= 0) {
  6299. dRotationBegin = dRotationBegin - 180 - dRotation;
  6300. } else {
  6301. dRotationBegin = 90 - dRotationBegin - dRotation;
  6302. }
  6303. }
  6304. }
  6305. dRotationBegin = dRotationBegin * Math.PI / 180;
  6306. var x = centerPoint.x + R * Math.cos(dRotationBegin);
  6307. var y = centerPoint.y + R * Math.sin(dRotationBegin);
  6308. circlePoints.push(new Point(x, y));
  6309. }
  6310. circlePoints.push(p3);
  6311. }
  6312. return circlePoints;
  6313. }
  6314. /**
  6315. * @function SuperMap.Geometry.LineString.createLineEPS
  6316. * @description 根据点的类型画出不同类型的曲线。
  6317. * 点的类型有三种:LTypeArc,LTypeCurve,NONE。
  6318. * @param {Array.<SuperMap.Geometry.Point>} points - 传入的待计算的初始点串。
  6319. * @returns {Array.<SuperMap.Geometry.Point>} 计算出相应的 lineEPS 控制点。
  6320. * @example
  6321. * var points = [];
  6322. * points.push(new SuperMap.Geometry.Point(-50,30));
  6323. * points.push(new SuperMap.Geometry.Point(-30,50,"LTypeArc"));
  6324. * points.push(new SuperMap.Geometry.Point(2,60));
  6325. * points.push(new SuperMap.Geometry.Point(8,20));
  6326. * var lineEPS = SuperMap.Geometry.LineString.createLineEPS(points);
  6327. */
  6328. }, {
  6329. key: "createLineEPS",
  6330. value: function createLineEPS(points) {
  6331. var list = [],
  6332. len = points.length;
  6333. if (len < 2) {
  6334. return points;
  6335. }
  6336. for (var i = 0; i < len;) {
  6337. var type = points[i].type;
  6338. if (type == 'LTypeArc') {
  6339. var listObj = LineString.createLineArc(list, i, len, points);
  6340. list = listObj[0];
  6341. i = listObj[1];
  6342. } else {
  6343. list.push(points[i]);
  6344. i++;
  6345. }
  6346. }
  6347. return list;
  6348. }
  6349. }, {
  6350. key: "createLineArc",
  6351. value: function createLineArc(list, i, len, points) {
  6352. if (i == 0) {
  6353. var bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  6354. Array.prototype.push.apply(list, bezierPtsObj[0]);
  6355. i = bezierPtsObj[1] + 1;
  6356. } else if (i == len - 1) {
  6357. var bezierP = [points[i - 1], points[i]],
  6358. bezierPts = LineString.calculateCircle(bezierP);
  6359. Array.prototype.push.apply(list, bezierPts);
  6360. i++;
  6361. } else {
  6362. var _bezierPtsObj = LineString.addPointEPS(points, i, len, 'LTypeArc');
  6363. list.pop();
  6364. Array.prototype.push.apply(list, _bezierPtsObj[0]);
  6365. i = _bezierPtsObj[1] + 1;
  6366. }
  6367. return [list, i];
  6368. }
  6369. }, {
  6370. key: "addPointEPS",
  6371. value: function addPointEPS(points, i, len, type) {
  6372. var bezierP = [],
  6373. j = i + 1;
  6374. if (i == 0) {
  6375. Array.prototype.push.apply(bezierP, [points[i], points[i + 1]]);
  6376. } else if (i == len - 1) {
  6377. Array.prototype.push.apply(bezierP, [points[i - 1], points[i]]);
  6378. } else {
  6379. Array.prototype.push.apply(bezierP, [points[i - 1], points[i], points[i + 1]]);
  6380. }
  6381. var bezierPts;
  6382. if (type == 'LTypeCurve') {
  6383. bezierPts = LineString.calculatePointsFBZN(bezierP);
  6384. } else if (type == 'LTypeArc') {
  6385. bezierPts = LineString.calculateCircle(bezierP);
  6386. }
  6387. return [bezierPts, j];
  6388. }
  6389. }]);
  6390. return LineString;
  6391. }(Curve);
  6392. SuperMap.Geometry.LineString = LineString;
  6393. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/GeoText.js
  6394. function GeoText_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoText_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoText_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoText_typeof(obj); }
  6395. function GeoText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6396. 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); } }
  6397. function GeoText_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoText_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoText_defineProperties(Constructor, staticProps); return Constructor; }
  6398. function GeoText_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoText_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeoText_get(target, property, receiver || target); }
  6399. function GeoText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoText_getPrototypeOf(object); if (object === null) break; } return object; }
  6400. 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 } }); if (superClass) GeoText_setPrototypeOf(subClass, superClass); }
  6401. function GeoText_setPrototypeOf(o, p) { GeoText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoText_setPrototypeOf(o, p); }
  6402. 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); }; }
  6403. function GeoText_possibleConstructorReturn(self, call) { if (call && (GeoText_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoText_assertThisInitialized(self); }
  6404. function GeoText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6405. function GeoText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6406. function GeoText_getPrototypeOf(o) { GeoText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoText_getPrototypeOf(o); }
  6407. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6408. * This program are made available under the terms of the Apache License, Version 2.0
  6409. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6410. /**
  6411. * @class SuperMap.Geometry.GeoText
  6412. * @classdesc 文本标签类。
  6413. * @category BaseTypes Geometry
  6414. * @extends {SuperMap.Geometry}
  6415. * @param {float} x - x 坐标。
  6416. * @param {float} y - y 坐标。
  6417. * @param {string} text - 标签中的文本内容。
  6418. */
  6419. var GeoText = /*#__PURE__*/function (_Geometry) {
  6420. GeoText_inherits(GeoText, _Geometry);
  6421. var _super = GeoText_createSuper(GeoText);
  6422. function GeoText(x, y, text) {
  6423. var _this;
  6424. GeoText_classCallCheck(this, GeoText);
  6425. _this = _super.call(this, x, y, text);
  6426. /**
  6427. * @member {float} SuperMap.Geometry.GeoText.prototype.x
  6428. * @description 横坐标。
  6429. */
  6430. _this.x = parseFloat(x);
  6431. /**
  6432. * @member {float} SuperMap.Geometry.GeoText.prototype.y
  6433. * @description 纵坐标。
  6434. */
  6435. _this.y = parseFloat(y);
  6436. /**
  6437. * @member {string} SuperMap.Geometry.GeoText.prototype.text
  6438. * @description 标签中的文本内容。
  6439. */
  6440. _this.text = text.toString();
  6441. /**
  6442. * @member {Object} SuperMap.Geometry.GeoText.prototype.bsInfo
  6443. * @description 标签范围的基础信息。
  6444. * @property {number} w - bounds 的宽。
  6445. * @property {number} h - bounds 的高度。
  6446. */
  6447. _this.bsInfo = {
  6448. "h": null,
  6449. "w": null
  6450. };
  6451. _this.element = document.createElement('span');
  6452. _this.CLASS_NAME = "SuperMap.Geometry.GeoText";
  6453. _this.geometryType = "GeoText";
  6454. return _this;
  6455. }
  6456. /**
  6457. * @function SuperMap.Geometry.GeoText.prototype.destroy
  6458. * @description 销毁文本标签类。
  6459. */
  6460. GeoText_createClass(GeoText, [{
  6461. key: "destroy",
  6462. value: function destroy() {
  6463. GeoText_get(GeoText_getPrototypeOf(GeoText.prototype), "destroy", this).call(this);
  6464. this.x = null;
  6465. this.y = null;
  6466. this.text = null;
  6467. }
  6468. /**
  6469. * @function SuperMap.Geometry.GeoText.prototype.getCentroid
  6470. * @description 获取标签对象的质心。
  6471. * @returns {SuperMap.Geometry.Point} 标签对象的质心。
  6472. */
  6473. }, {
  6474. key: "getCentroid",
  6475. value: function getCentroid() {
  6476. return new Point(this.x, this.y);
  6477. }
  6478. /**
  6479. * @function SuperMap.Geometry.GeoText.prototype.clone
  6480. * @description 克隆标签对象。
  6481. * @returns {SuperMap.Geometry.GeoText} 克隆后的标签对象。
  6482. */
  6483. }, {
  6484. key: "clone",
  6485. value: function clone(obj) {
  6486. if (obj == null) {
  6487. obj = new GeoText(this.x, this.y, this.text);
  6488. }
  6489. Util.applyDefaults(obj, this);
  6490. return obj;
  6491. }
  6492. /**
  6493. * @function SuperMap.Geometry.GeoText.prototype.calculateBounds
  6494. * @description 计算标签对象的范围。
  6495. */
  6496. }, {
  6497. key: "calculateBounds",
  6498. value: function calculateBounds() {
  6499. this.bounds = new Bounds(this.x, this.y, this.x, this.y);
  6500. }
  6501. /**
  6502. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByLabel
  6503. * @description 根据绘制好的标签获取文字标签的像素范围,参数的单位是像素;此方法相对于 getLabelPxBoundsByText 效率较低,但支持所有格式的文本。
  6504. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  6505. * @param {string} labelWidth - 标签的宽度,如:“90px”。
  6506. * @param {string} labelHeight - 标签的高度。
  6507. * @param {Object} style - 标签的 style。
  6508. * @returns {SuperMap.Bounds} 标签的像素范围。
  6509. */
  6510. }, {
  6511. key: "getLabelPxBoundsByLabel",
  6512. value: function getLabelPxBoundsByLabel(locationPixel, labelWidth, labelHeight, style) {
  6513. var labelPxBounds, left, bottom, top, right;
  6514. var locationPx = Util.cloneObject(locationPixel); //计算文本行数
  6515. var theText = style.label || this.text;
  6516. var textRows = theText.split('\n');
  6517. var laberRows = textRows.length; //处理文字对齐
  6518. labelWidth = parseFloat(labelWidth);
  6519. labelHeight = parseFloat(labelHeight);
  6520. if (laberRows > 1) {
  6521. labelHeight = parseFloat(labelHeight) * laberRows;
  6522. }
  6523. if (style.labelAlign && style.labelAlign !== "cm") {
  6524. switch (style.labelAlign) {
  6525. case "lt":
  6526. locationPx.x += labelWidth / 2;
  6527. locationPx.y += labelHeight / 2;
  6528. break;
  6529. case "lm":
  6530. locationPx.x += labelWidth / 2;
  6531. break;
  6532. case "lb":
  6533. locationPx.x += labelWidth / 2;
  6534. locationPx.y -= labelHeight / 2;
  6535. break;
  6536. case "ct":
  6537. locationPx.y += labelHeight / 2;
  6538. break;
  6539. case "cb":
  6540. locationPx.y -= labelHeight / 2;
  6541. break;
  6542. case "rt":
  6543. locationPx.x -= labelWidth / 2;
  6544. locationPx.y += labelHeight / 2;
  6545. break;
  6546. case "rm":
  6547. locationPx.x -= labelWidth / 2;
  6548. break;
  6549. case "rb":
  6550. locationPx.x -= labelWidth / 2;
  6551. locationPx.y -= labelHeight / 2;
  6552. break;
  6553. default:
  6554. break;
  6555. }
  6556. }
  6557. this.bsInfo.h = labelHeight;
  6558. this.bsInfo.w = labelWidth; //bounds的四边
  6559. left = locationPx.x - parseFloat(labelWidth) / 2;
  6560. bottom = locationPx.y + parseFloat(labelHeight) / 2;
  6561. right = locationPx.x + parseFloat(labelWidth) / 2;
  6562. top = locationPx.y - parseFloat(labelHeight) / 2;
  6563. labelPxBounds = new Bounds(left, bottom, right, top);
  6564. return labelPxBounds;
  6565. }
  6566. /**
  6567. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxBoundsByText
  6568. * @description 根据文本内容获取文字标签的像素范围。
  6569. * @param {Object} locationPixel - 标签的位置点,该对象含有属性 x(横坐标),属性 y(纵坐标)。
  6570. * @param {Object} style - 标签的样式。
  6571. * @returns {SuperMap.Bounds} 标签的像素范围。
  6572. */
  6573. }, {
  6574. key: "getLabelPxBoundsByText",
  6575. value: function getLabelPxBoundsByText(locationPixel, style) {
  6576. var labelPxBounds, left, bottom, top, right;
  6577. var labelSize = this.getLabelPxSize(style);
  6578. var locationPx = Util.cloneObject(locationPixel); //处理文字对齐
  6579. if (style.labelAlign && style.labelAlign !== "cm") {
  6580. switch (style.labelAlign) {
  6581. case "lt":
  6582. locationPx.x += labelSize.w / 2;
  6583. locationPx.y += labelSize.h / 2;
  6584. break;
  6585. case "lm":
  6586. locationPx.x += labelSize.w / 2;
  6587. break;
  6588. case "lb":
  6589. locationPx.x += labelSize.w / 2;
  6590. locationPx.y -= labelSize.h / 2;
  6591. break;
  6592. case "ct":
  6593. locationPx.y += labelSize.h / 2;
  6594. break;
  6595. case "cb":
  6596. locationPx.y -= labelSize.h / 2;
  6597. break;
  6598. case "rt":
  6599. locationPx.x -= labelSize.w / 2;
  6600. locationPx.y += labelSize.h / 2;
  6601. break;
  6602. case "rm":
  6603. locationPx.x -= labelSize.w / 2;
  6604. break;
  6605. case "rb":
  6606. locationPx.x -= labelSize.w / 2;
  6607. locationPx.y -= labelSize.h / 2;
  6608. break;
  6609. default:
  6610. break;
  6611. }
  6612. }
  6613. this.bsInfo.h = labelSize.h;
  6614. this.bsInfo.w = labelSize.w;
  6615. left = locationPx.x - labelSize.w / 2;
  6616. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  6617. if (style.fontStyle && style.fontStyle === "italic") {
  6618. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  6619. } else {
  6620. right = locationPx.x + labelSize.w / 2;
  6621. }
  6622. top = locationPx.y - labelSize.h / 2;
  6623. labelPxBounds = new Bounds(left, bottom, right, top);
  6624. return labelPxBounds;
  6625. }
  6626. /**
  6627. * @function SuperMap.Geometry.GeoText.prototype.getLabelPxSize
  6628. * @description 获取 label 的像素大小。
  6629. * @param {Object} style - 标签样式。
  6630. * @returns {Object} 标签大小对象,属性 w 表示标签的宽度,属性 h 表示标签的高度。
  6631. */
  6632. }, {
  6633. key: "getLabelPxSize",
  6634. value: function getLabelPxSize(style) {
  6635. var text,
  6636. //文本内容
  6637. fontSize,
  6638. //字体大小
  6639. spacing = 1,
  6640. //两个字符间的间距(单位:px)
  6641. lineSpacing = 0.2,
  6642. bgstrokeWidth = parseFloat(style.strokeWidth); //标签背景框边框的宽度
  6643. text = style.label || this.text;
  6644. if (style.fontSize) {
  6645. fontSize = parseFloat(style.fontSize);
  6646. } else {
  6647. fontSize = parseFloat("12px");
  6648. } //标签宽高
  6649. var labelW, labelH;
  6650. var textRows = text.split('\n');
  6651. var numRows = textRows.length;
  6652. if (numRows > 1) {
  6653. labelH = fontSize * numRows + numRows + bgstrokeWidth + lineSpacing * fontSize;
  6654. } else {
  6655. labelH = fontSize + bgstrokeWidth + lineSpacing * fontSize + 1;
  6656. } //取最大宽度
  6657. labelW = 0;
  6658. if (this.labelWTmp && labelW < this.labelWTmp) {
  6659. labelW = this.labelWTmp;
  6660. }
  6661. for (var i = 0; i < numRows; i++) {
  6662. var textCharC = this.getTextCount(textRows[i]);
  6663. var labelWTmp = this.labelWTmp = Util.getTextBounds(style, textRows[i], this.element).textWidth + textCharC.textC * spacing + bgstrokeWidth;
  6664. if (labelW < labelWTmp) {
  6665. labelW = labelWTmp;
  6666. }
  6667. }
  6668. var labelSize = new Object(); //标签大小
  6669. labelSize.h = labelH;
  6670. labelSize.w = labelW;
  6671. return labelSize;
  6672. }
  6673. /**
  6674. * @function SuperMap.Geometry.GeoText.prototype.getTextCount
  6675. * @description 获取 text 中的字符个数。
  6676. * @param {string} text - 字符串。
  6677. * @returns {Object} 字符个数统计结果,属性 cnC 表示中文字符个数,属性 enC 表示英文字符个数,属性 textC 表示字符总个数。
  6678. */
  6679. }, {
  6680. key: "getTextCount",
  6681. value: function getTextCount(text) {
  6682. var textCharCount = {};
  6683. var cnCount = 0;
  6684. var enCount = 0;
  6685. for (var i = 0; i < text.length; i++) {
  6686. if (text.charCodeAt(i) > 255) {
  6687. //遍历判断字符串中每个字符的Unicode码,大于255则为中文
  6688. cnCount++;
  6689. } else {
  6690. enCount++;
  6691. }
  6692. } //中午字符个数
  6693. textCharCount.cnC = cnCount; //英文字符个数
  6694. textCharCount.enC = enCount; //字符总个数
  6695. textCharCount.textC = text.length;
  6696. return textCharCount;
  6697. }
  6698. }]);
  6699. return GeoText;
  6700. }(Geometry);
  6701. SuperMap.Geometry.GeoText = GeoText;
  6702. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/LinearRing.js
  6703. function LinearRing_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LinearRing_typeof = function _typeof(obj) { return typeof obj; }; } else { LinearRing_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LinearRing_typeof(obj); }
  6704. function LinearRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6705. 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); } }
  6706. function LinearRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinearRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinearRing_defineProperties(Constructor, staticProps); return Constructor; }
  6707. function LinearRing_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LinearRing_get = Reflect.get; } 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(receiver); } return desc.value; }; } return LinearRing_get(target, property, receiver || target); }
  6708. function LinearRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LinearRing_getPrototypeOf(object); if (object === null) break; } return object; }
  6709. 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 } }); if (superClass) LinearRing_setPrototypeOf(subClass, superClass); }
  6710. function LinearRing_setPrototypeOf(o, p) { LinearRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LinearRing_setPrototypeOf(o, p); }
  6711. 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); }; }
  6712. function LinearRing_possibleConstructorReturn(self, call) { if (call && (LinearRing_typeof(call) === "object" || typeof call === "function")) { return call; } return LinearRing_assertThisInitialized(self); }
  6713. function LinearRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6714. function LinearRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6715. function LinearRing_getPrototypeOf(o) { LinearRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LinearRing_getPrototypeOf(o); }
  6716. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6717. * This program are made available under the terms of the Apache License, Version 2.0
  6718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6719. /**
  6720. * @class SuperMap.Geometry.LinearRing
  6721. * @classdesc 几何对象线环类,是一个特殊的封闭的线串,在每次 addPoint/removePoint 之后会通过添加一个点(此点是复制的第一个点得到的)
  6722. * 作为最后的一个点来自动关闭线环。
  6723. * @category BaseTypes Geometry
  6724. * @extends {SuperMap.Geometry.LineString}
  6725. * @param {Array.<SuperMap.Geometry.Point>} points - 组成线性环的点。
  6726. * @example
  6727. * var points = [new SuperMap.Geometry.Point(4933.319287022352, -3337.3849141502124),
  6728. * new SuperMap.Geometry.Point(4960.9674060199022, -3349.3316322355736),
  6729. * new SuperMap.Geometry.Point(5006.0235999418364, -3358.8890067038628),
  6730. * new SuperMap.Geometry.Point(5075.3145648369318, -3378.0037556404409),
  6731. * new SuperMap.Geometry.Point(5305.19551436013, -3376.9669111768926)],
  6732. * var linearRing = new SuperMap.Geometry.LinearRing(points);
  6733. */
  6734. var LinearRing = /*#__PURE__*/function (_LineString) {
  6735. LinearRing_inherits(LinearRing, _LineString);
  6736. var _super = LinearRing_createSuper(LinearRing);
  6737. function LinearRing(points) {
  6738. var _this;
  6739. LinearRing_classCallCheck(this, LinearRing);
  6740. _this = _super.call(this, points);
  6741. /**
  6742. * @member {Array.<string>} [SuperMap.Geometry.LinearRing.prototype.componentTypes=["SuperMap.Geometry.Point"]]
  6743. * @description components 存储的的几何对象所支持的几何类型数组,为空表示类型不受限制。
  6744. * @readonly
  6745. */
  6746. _this.componentTypes = ["SuperMap.Geometry.Point"];
  6747. _this.CLASS_NAME = "SuperMap.Geometry.LinearRing";
  6748. _this.geometryType = "LinearRing";
  6749. return _this;
  6750. }
  6751. /**
  6752. * @function SuperMap.Geometry.LinearRing.prototype.addComponent
  6753. * @description 添加一个点到几何图形数组中,如果这个点将要被添加到组件数组的末端,并且与数组中已经存在的最后一个点相同,
  6754. * 重复的点是不能被添加的。这将影响未关闭环的关闭。
  6755. * 这个方法可以通过将非空索引(组件数组的下标)作为第二个参数重写。
  6756. * @param {SuperMap.Geometry.Point} point - 点对象。
  6757. * @param {integer} [index] - 插入组件数组的下标。
  6758. * @returns {boolean} 点对象是否添加成功。
  6759. */
  6760. LinearRing_createClass(LinearRing, [{
  6761. key: "addComponent",
  6762. value: function addComponent(point, index) {
  6763. var added = false; //remove last point
  6764. var lastPoint = this.components.pop(); // given an index, add the point
  6765. // without an index only add non-duplicate points
  6766. if (index != null || !point.equals(lastPoint)) {
  6767. added = LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, arguments);
  6768. } //append copy of first point
  6769. var firstPoint = this.components[0];
  6770. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  6771. return added;
  6772. }
  6773. /**
  6774. * @function SuperMap.Geometry.LinearRing.prototype.removeComponent
  6775. * @description 从几何组件中删除一个点。
  6776. * @param {SuperMap.Geometry.Point} point - 点对象。
  6777. * @returns {boolean} 点对象是否删除。
  6778. */
  6779. }, {
  6780. key: "removeComponent",
  6781. value: function removeComponent(point) {
  6782. // eslint-disable-line no-unused-vars
  6783. var removed = this.components && this.components.length > 3;
  6784. if (removed) {
  6785. //remove last point
  6786. this.components.pop(); //remove our point
  6787. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "removeComponent", this).apply(this, arguments); //append copy of first point
  6788. var firstPoint = this.components[0];
  6789. LinearRing_get(LinearRing_getPrototypeOf(LinearRing.prototype), "addComponent", this).apply(this, [firstPoint]);
  6790. }
  6791. return removed;
  6792. }
  6793. /**
  6794. * @function SuperMap.Geometry.LinearRing.prototype.getArea
  6795. * @description 获得当前几何对象区域大小,如果是沿顺时针方向的环则是正值,否则为负值。
  6796. * @returns {float} 环的面积。
  6797. */
  6798. }, {
  6799. key: "getArea",
  6800. value: function getArea() {
  6801. var area = 0.0;
  6802. if (this.components && this.components.length > 2) {
  6803. var sum = 0.0;
  6804. for (var i = 0, len = this.components.length; i < len - 1; i++) {
  6805. var b = this.components[i];
  6806. var c = this.components[i + 1];
  6807. sum += (b.x + c.x) * (c.y - b.y);
  6808. }
  6809. area = -sum / 2.0;
  6810. }
  6811. return area;
  6812. }
  6813. /**
  6814. * @function SuperMap.Geometry.LinearRing.prototype.getVertices
  6815. * @description 返回几何图形的所有点的列表。
  6816. * @param {boolean} [nodes] - 对于线来说,仅仅返回作为端点的顶点,如果设为 false ,则返回非端点的顶点,如果没有设置此参数,则返回所有顶点。
  6817. * @returns {Array} 几何对象所有点的列表。
  6818. */
  6819. }, {
  6820. key: "getVertices",
  6821. value: function getVertices(nodes) {
  6822. return nodes === true ? [] : this.components.slice(0, this.components.length - 1);
  6823. }
  6824. }]);
  6825. return LinearRing;
  6826. }(LineString);
  6827. SuperMap.Geometry.LinearRing = LinearRing;
  6828. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiLineString.js
  6829. function MultiLineString_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiLineString_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiLineString_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiLineString_typeof(obj); }
  6830. function MultiLineString_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6831. 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 } }); if (superClass) MultiLineString_setPrototypeOf(subClass, superClass); }
  6832. function MultiLineString_setPrototypeOf(o, p) { MultiLineString_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiLineString_setPrototypeOf(o, p); }
  6833. 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); }; }
  6834. function MultiLineString_possibleConstructorReturn(self, call) { if (call && (MultiLineString_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiLineString_assertThisInitialized(self); }
  6835. function MultiLineString_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6836. function MultiLineString_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6837. function MultiLineString_getPrototypeOf(o) { MultiLineString_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiLineString_getPrototypeOf(o); }
  6838. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6839. * This program are made available under the terms of the Apache License, Version 2.0
  6840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6841. /**
  6842. * @class SuperMap.Geometry.MultiLineString
  6843. * @classdesc 几何对象多线类。
  6844. * @category BaseTypes Geometry
  6845. * @extends {SuperMap.Geometry.Collection}
  6846. * @param {Array.<SuperMap.Geometry.LineString>} components - LineString 数组。
  6847. * @example
  6848. * var multi = new SuperMap.Geometry.MultiLineString([
  6849. * new SuperMap.Geometry.LineString([
  6850. * new SuperMap.Geometry.Point(1, 0),
  6851. * new SuperMap.Geometry.Point(0, 1)
  6852. * ])
  6853. * ]);
  6854. */
  6855. var MultiLineString = /*#__PURE__*/function (_Collection) {
  6856. MultiLineString_inherits(MultiLineString, _Collection);
  6857. var _super = MultiLineString_createSuper(MultiLineString);
  6858. function MultiLineString(components) {
  6859. var _this;
  6860. MultiLineString_classCallCheck(this, MultiLineString);
  6861. _this = _super.call(this, components);
  6862. /**
  6863. * @member {Array.<string>} [SuperMap.Geometry.MultiLineString.prototype.componentTypes=["SuperMap.Geometry.LineString"]]
  6864. * @description components 存储的的几何对象所支持的几何类型数组。
  6865. * @readonly
  6866. */
  6867. _this.componentTypes = ["SuperMap.Geometry.LineString"];
  6868. _this.CLASS_NAME = "SuperMap.Geometry.MultiLineString";
  6869. _this.geometryType = "MultiLineString";
  6870. return _this;
  6871. }
  6872. return MultiLineString;
  6873. }(Collection);
  6874. SuperMap.Geometry.MultiLineString = MultiLineString;
  6875. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/MultiPolygon.js
  6876. function MultiPolygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MultiPolygon_typeof = function _typeof(obj) { return typeof obj; }; } else { MultiPolygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MultiPolygon_typeof(obj); }
  6877. function MultiPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6878. 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 } }); if (superClass) MultiPolygon_setPrototypeOf(subClass, superClass); }
  6879. function MultiPolygon_setPrototypeOf(o, p) { MultiPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MultiPolygon_setPrototypeOf(o, p); }
  6880. 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); }; }
  6881. function MultiPolygon_possibleConstructorReturn(self, call) { if (call && (MultiPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return MultiPolygon_assertThisInitialized(self); }
  6882. function MultiPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6883. function MultiPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6884. function MultiPolygon_getPrototypeOf(o) { MultiPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MultiPolygon_getPrototypeOf(o); }
  6885. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6886. * This program are made available under the terms of the Apache License, Version 2.0
  6887. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6888. /**
  6889. * @class SuperMap.Geometry.MultiPolygon
  6890. * @classdesc 几何对象多多边形类。
  6891. * @category BaseTypes Geometry
  6892. * @extends {SuperMap.Geometry.Collection}
  6893. * @param {Array.<SuperMap.Geometry.Polygon>} components - 形成 MultiPolygon 的多边形数组。
  6894. * @example
  6895. * var points1 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0)];
  6896. * var points2 = [new SuperMap.Geometry.Point(10,10),new SuperMap.Geometry.Point(0,0),new SuperMap.Geometry.Point(3,3),new SuperMap.Geometry.Point(10,10)];
  6897. *
  6898. * var linearRing1 = new SuperMap.Geometry.LinearRing(points1);
  6899. * var linearRing2 = new SuperMap.Geometry.LinearRing(points2);
  6900. *
  6901. * var polygon1 = new SuperMap.Geometry.Polygon([linearRing1]);
  6902. * var polygon2 = new SuperMap.Geometry.Polygon([linearRing2]);
  6903. *
  6904. * var multiPolygon1 = new SuperMap.Geometry.MultiPolygon([polygon1,polygon2]);
  6905. */
  6906. var MultiPolygon = /*#__PURE__*/function (_Collection) {
  6907. MultiPolygon_inherits(MultiPolygon, _Collection);
  6908. var _super = MultiPolygon_createSuper(MultiPolygon);
  6909. function MultiPolygon(components) {
  6910. var _this;
  6911. MultiPolygon_classCallCheck(this, MultiPolygon);
  6912. _this = _super.call(this, components);
  6913. /**
  6914. * @member {Array.<string>} [SuperMap.Geometry.MultiPolygon.prototype.componentTypes=["SuperMap.Geometry.Polygon"]]
  6915. * @description components 存储的的几何对象所支持的几何类型数组。
  6916. * @readonly
  6917. */
  6918. _this.componentTypes = ["SuperMap.Geometry.Polygon"];
  6919. _this.CLASS_NAME = "SuperMap.Geometry.MultiPolygon";
  6920. _this.geometryType = "MultiPolygon";
  6921. return _this;
  6922. }
  6923. return MultiPolygon;
  6924. }(Collection);
  6925. SuperMap.Geometry.MultiPolygon = MultiPolygon;
  6926. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Polygon.js
  6927. function Polygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Polygon_typeof = function _typeof(obj) { return typeof obj; }; } else { Polygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Polygon_typeof(obj); }
  6928. function Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6929. 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); } }
  6930. function Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  6931. 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 } }); if (superClass) Polygon_setPrototypeOf(subClass, superClass); }
  6932. function Polygon_setPrototypeOf(o, p) { Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Polygon_setPrototypeOf(o, p); }
  6933. 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); }; }
  6934. function Polygon_possibleConstructorReturn(self, call) { if (call && (Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return Polygon_assertThisInitialized(self); }
  6935. function Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  6936. function Polygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  6937. function Polygon_getPrototypeOf(o) { Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Polygon_getPrototypeOf(o); }
  6938. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  6939. * This program are made available under the terms of the Apache License, Version 2.0
  6940. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  6941. /**
  6942. * @class SuperMap.Geometry.Polygon
  6943. * @classdesc 多边形几何对象类。
  6944. * @category BaseTypes Geometry
  6945. * @extends {SuperMap.Geometry.Collection}
  6946. * @param {Array.<SuperMap.Geometry.LinearRing>} components - 用来生成多边形的线环数组。
  6947. * @example
  6948. * var points =[new SuperMap.Geometry.Point(0,4010338),
  6949. * new SuperMap.Geometry.Point(1063524,4010338),
  6950. * new SuperMap.Geometry.Point(1063524,3150322),
  6951. * new SuperMap.Geometry.Point(0,3150322)
  6952. * ],
  6953. * var linearRings = new SuperMap.Geometry.LinearRing(points),
  6954. * var region = new SuperMap.Geometry.Polygon([linearRings]);
  6955. */
  6956. var Polygon = /*#__PURE__*/function (_Collection) {
  6957. Polygon_inherits(Polygon, _Collection);
  6958. var _super = Polygon_createSuper(Polygon);
  6959. function Polygon(components) {
  6960. var _this;
  6961. Polygon_classCallCheck(this, Polygon);
  6962. _this = _super.call(this, components);
  6963. /**
  6964. * @member {Array.<string>} [SuperMap.Geometry.Polygon.prototype.componentTypes=["SuperMap.Geometry.LinearRing"]]
  6965. * @description components 存储的的几何对象所支持的几何类型数组。
  6966. * @readonly
  6967. */
  6968. _this.componentTypes = ["SuperMap.Geometry.LinearRing"];
  6969. _this.CLASS_NAME = "SuperMap.Geometry.Polygon";
  6970. _this.geometryType = "Polygon";
  6971. return _this;
  6972. }
  6973. /**
  6974. * @function SuperMap.Geometry.Polygon.prototype.getArea
  6975. * @description 获得区域面积,从区域的外部口径减去计此区域内部口径算所得的面积。
  6976. * @returns {float} 几何对象的面积。
  6977. */
  6978. Polygon_createClass(Polygon, [{
  6979. key: "getArea",
  6980. value: function getArea() {
  6981. var area = 0.0;
  6982. if (this.components && this.components.length > 0) {
  6983. area += Math.abs(this.components[0].getArea());
  6984. for (var i = 1, len = this.components.length; i < len; i++) {
  6985. area -= Math.abs(this.components[i].getArea());
  6986. }
  6987. }
  6988. return area;
  6989. }
  6990. }]);
  6991. return Polygon;
  6992. }(Collection);
  6993. SuperMap.Geometry.Polygon = Polygon;
  6994. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/Rectangle.js
  6995. function Rectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Rectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { Rectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Rectangle_typeof(obj); }
  6996. function Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  6997. 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); } }
  6998. function Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  6999. 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 } }); if (superClass) Rectangle_setPrototypeOf(subClass, superClass); }
  7000. function Rectangle_setPrototypeOf(o, p) { Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Rectangle_setPrototypeOf(o, p); }
  7001. 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); }; }
  7002. function Rectangle_possibleConstructorReturn(self, call) { if (call && (Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return Rectangle_assertThisInitialized(self); }
  7003. function Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  7004. function Rectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  7005. function Rectangle_getPrototypeOf(o) { Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Rectangle_getPrototypeOf(o); }
  7006. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7007. * This program are made available under the terms of the Apache License, Version 2.0
  7008. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7009. /**
  7010. * @class SuperMap.Geometry.Rectangle
  7011. * @classdesc 矩形几何对象类。
  7012. * @category BaseTypes Geometry
  7013. * @param {float} x - 矩形左下角点的横坐标。
  7014. * @param {float} y - 矩形左下角点的纵坐标。
  7015. * @param {float} width - 矩形的宽度。
  7016. * @param {float} height - 矩形的高度。
  7017. * @extends {SuperMap.Geometry}
  7018. * @example
  7019. * //x 为矩形左下角点的横坐标;y 为矩形左下角点的纵坐标;w 为矩形的宽度;h 为矩形的高度
  7020. * var x = 1;
  7021. * var y = 2;
  7022. * var w = 10;
  7023. * var h = 20;
  7024. * var recttangle = new SuperMap.Geometry.Rectangle(x, y, w, h);
  7025. */
  7026. var Rectangle = /*#__PURE__*/function (_Geometry) {
  7027. Rectangle_inherits(Rectangle, _Geometry);
  7028. var _super = Rectangle_createSuper(Rectangle);
  7029. function Rectangle(x, y, width, height) {
  7030. var _this;
  7031. Rectangle_classCallCheck(this, Rectangle);
  7032. _this = _super.call(this, x, y, width, height);
  7033. /**
  7034. * @member {float} SuperMap.Geometry.Rectangle.prototype.x
  7035. * @description 矩形左下角点的横坐标。
  7036. */
  7037. _this.x = x;
  7038. /**
  7039. * @member {float} SuperMap.Geometry.Rectangle.prototype.y
  7040. * @description 矩形左下角点的纵坐标。
  7041. */
  7042. _this.y = y;
  7043. /**
  7044. * @member {float} SuperMap.Geometry.Rectangle.prototype.width
  7045. * @description 矩形的宽度。
  7046. */
  7047. _this.width = width;
  7048. /**
  7049. * @member {float} SuperMap.Geometry.Rectangle.prototype.height
  7050. * @description 矩形的高度。
  7051. */
  7052. _this.height = height;
  7053. _this.CLASS_NAME = "SuperMap.Geometry.Rectangle";
  7054. _this.geometryType = "Rectangle";
  7055. return _this;
  7056. }
  7057. /**
  7058. * @function SuperMap.Geometry.Rectangle.prototype.calculateBounds
  7059. * @description 计算出此矩形对象的 bounds。
  7060. */
  7061. Rectangle_createClass(Rectangle, [{
  7062. key: "calculateBounds",
  7063. value: function calculateBounds() {
  7064. this.bounds = new Bounds(this.x, this.y, this.x + this.width, this.y + this.height);
  7065. }
  7066. /**
  7067. * @function SuperMap.Geometry.Rectangle.prototype.getArea
  7068. * @description 获取矩形对象的面积。
  7069. * @returns {float} 矩形对象面积。
  7070. */
  7071. }, {
  7072. key: "getArea",
  7073. value: function getArea() {
  7074. var area = this.width * this.height;
  7075. return area;
  7076. }
  7077. }]);
  7078. return Rectangle;
  7079. }(Geometry);
  7080. SuperMap.Geometry.Rectangle = Rectangle;
  7081. ;// CONCATENATED MODULE: ./src/common/commontypes/geometry/index.js
  7082. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7083. * This program are made available under the terms of the Apache License, Version 2.0
  7084. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7085. ;// CONCATENATED MODULE: ./src/common/commontypes/Credential.js
  7086. function Credential_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7087. 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); } }
  7088. function Credential_createClass(Constructor, protoProps, staticProps) { if (protoProps) Credential_defineProperties(Constructor.prototype, protoProps); if (staticProps) Credential_defineProperties(Constructor, staticProps); return Constructor; }
  7089. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7090. * This program are made available under the terms of the Apache License, Version 2.0
  7091. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7092. /**
  7093. * @class SuperMap.Credential
  7094. * @category Security
  7095. * @classdesc SuperMap 的安全证书类,其中包括 token 等安全验证信息。</br>
  7096. * 需要使用用户名和密码在:"http://localhost:8090/iserver/services/security/tokens" 下申请 value。</br>
  7097. * 获得形如:"2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.." 的 value。</br>
  7098. * 目前支持的功能包括:地图服务、专题图、量算、查询、公交换乘、空间分析、网络分析,不支持轮询功能。</br>
  7099. * @param {string} value - 访问受安全限制的服务时用于通过安全认证的验证信息。
  7100. * @param {string} [name='token'] - 验证信息前缀,name=value 部分的 name 部分。
  7101. * @example
  7102. * var pixcel = new SuperMap.Credential("valueString","token");
  7103. * pixcel.destroy();
  7104. */
  7105. var Credential = /*#__PURE__*/function () {
  7106. function Credential(value, name) {
  7107. Credential_classCallCheck(this, Credential);
  7108. /**
  7109. * @member {string} SuperMap.Bounds.prototype.value
  7110. * @description 访问受安全限制的服务时用于通过安全认证的验证信息。
  7111. */
  7112. this.value = value ? value : "";
  7113. /**
  7114. * @member {string} [SuperMap.Bounds.prototype.name='token']
  7115. * @description 验证信息前缀,name=value 部分的 name 部分。
  7116. */
  7117. this.name = name ? name : "token";
  7118. this.CLASS_NAME = "SuperMap.Credential";
  7119. }
  7120. /**
  7121. * @function SuperMap.Credential.prototype.getUrlParameters
  7122. * @example
  7123. * var credential = new SuperMap.Credential("valueString","token");
  7124. * //这里 str = "token=valueString";
  7125. * var str = credential.getUrlParameters();
  7126. * @returns {string} 返回安全信息组成的 url 片段。
  7127. */
  7128. Credential_createClass(Credential, [{
  7129. key: "getUrlParameters",
  7130. value: function getUrlParameters() {
  7131. //当需要其他安全信息的时候,则需要return this.name + "=" + this.value + "&" + "...";的形式添加。
  7132. return this.name + "=" + this.value;
  7133. }
  7134. /**
  7135. * @function SuperMap.Bounds.prototype.getValue
  7136. * @description 获取 value。
  7137. * @example
  7138. * var credential = new SuperMap.Credential("2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..","token");
  7139. * //这里 str = "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..";
  7140. * var str = credential.getValue();
  7141. * @returns {string} 返回 value 字符串,在 iServer 服务下该 value 值即为 token 值。
  7142. */
  7143. }, {
  7144. key: "getValue",
  7145. value: function getValue() {
  7146. return this.value;
  7147. }
  7148. /**
  7149. *
  7150. * @function SuperMap.Credential.prototype.destroy
  7151. * @description 销毁此对象。销毁后此对象的所有属性为 null,而不是初始值。
  7152. * @example
  7153. * var credential = new SuperMap.Credential("valueString","token");
  7154. * credential.destroy();
  7155. */
  7156. }, {
  7157. key: "destroy",
  7158. value: function destroy() {
  7159. this.value = null;
  7160. this.name = null;
  7161. }
  7162. }]);
  7163. return Credential;
  7164. }();
  7165. /**
  7166. * @member {SuperMap.Credential} SuperMap.Credential.CREDENTIAL
  7167. * @description 这个对象保存一个安全类的实例,在服务端需要安全验证的时候必须进行设置。
  7168. * @constant
  7169. * @example
  7170. * 代码实例:
  7171. * // 当iServer启用服务安全的时候,下边的代码是必须的。安全证书类能够接收一个value和一个name参数。
  7172. * var value = "(以iServer为例,这里是申请的token值)";
  7173. * var name = "token";
  7174. * // 默认name参数为token,所以当使用iServer服务的时候可以不进行设置。
  7175. * SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);
  7176. *
  7177. */
  7178. Credential.CREDENTIAL = null;
  7179. SuperMap.Credential = Credential;
  7180. ;// CONCATENATED MODULE: ./src/common/commontypes/Date.js
  7181. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7182. * This program are made available under the terms of the Apache License, Version 2.0
  7183. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7184. /**
  7185. * @name Date
  7186. * @memberOf SuperMap
  7187. * @namespace
  7188. * @category BaseTypes Util
  7189. * @description 包含 parse、toISOString 方法的实现,两个方法用来解析 RFC 3339 日期,遵循 ECMAScript 5 规范。
  7190. */
  7191. var DateExt = SuperMap.Date = {
  7192. /**
  7193. * @description 生成代表一个具体的日期字符串,该日期遵循 ISO 8601 标准(详情查看{@link http://tools.ietf.org/html/rfc3339})。
  7194. * @example
  7195. * var dateString = SuperMap.Date.toISOString(new Date());
  7196. * @param {Date} date - 日期对象。
  7197. * @returns {string} 一个代表日期的字符串。(例如 "2010-08-07T16:58:23.123Z")。
  7198. */
  7199. toISOString: function () {
  7200. //标准的Date会存在toISOString方法,可以直接调用
  7201. if ("toISOString" in Date.prototype) {
  7202. return function (date) {
  7203. return date.toISOString();
  7204. };
  7205. } else {
  7206. // 部分浏览器没有,就得自己组合,组合后的字符串规则不变
  7207. var pad = function pad(num, len) {
  7208. var str = num + "";
  7209. while (str.length < len) {
  7210. str = "0" + str;
  7211. }
  7212. return str;
  7213. };
  7214. return function (date) {
  7215. var str;
  7216. if (isNaN(date.getTime())) {
  7217. // ECMA-262 says throw RangeError, Firefox returns
  7218. // "Invalid Date"
  7219. str = "Invalid Date";
  7220. } else {
  7221. 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";
  7222. }
  7223. return str;
  7224. };
  7225. }
  7226. }(),
  7227. /**
  7228. * @description 从一个字符串生成一个日期对象。
  7229. * @example
  7230. * var date = SuperMap.Date.parse("2010-08-07");
  7231. * @param {string} str - 代表日期的字符串。(例如: "2010", "2010-08", "2010-08-07", "2010-08-07T16:58:23.123Z","2010-08-07T11:58:23.123-06")。
  7232. * @returns {Date} 日期对象,如果字符串无法被解析,则返回一个无效的日期。(例如 isNaN(date.getTime()))。
  7233. */
  7234. parse: function parse(str) {
  7235. var date;
  7236. 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)?$/);
  7237. if (match && (match[1] || match[7])) {
  7238. // must have at least year or time
  7239. var year = parseInt(match[1], 10) || 0;
  7240. var month = parseInt(match[2], 10) - 1 || 0;
  7241. var day = parseInt(match[3], 10) || 1;
  7242. date = new Date(Date.UTC(year, month, day)); // optional time
  7243. var type = match[7];
  7244. if (type) {
  7245. var hours = parseInt(match[4], 10);
  7246. var minutes = parseInt(match[5], 10);
  7247. var secFrac = parseFloat(match[6]);
  7248. var seconds = secFrac | 0;
  7249. var milliseconds = Math.round(1000 * (secFrac - seconds));
  7250. date.setUTCHours(hours, minutes, seconds, milliseconds); // check offset
  7251. if (type !== "Z") {
  7252. var hoursOffset = parseInt(type, 10);
  7253. var minutesOffset = parseInt(match[8], 10) || 0;
  7254. var offset = -1000 * (60 * (hoursOffset * 60) + minutesOffset * 60);
  7255. date = new Date(date.getTime() + offset);
  7256. }
  7257. }
  7258. } else {
  7259. date = new Date("invalid");
  7260. }
  7261. return date;
  7262. }
  7263. };
  7264. ;// CONCATENATED MODULE: ./src/common/commontypes/Event.js
  7265. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7266. * This program are made available under the terms of the Apache License, Version 2.0
  7267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7268. /**
  7269. * @name Event
  7270. * @memberOf SuperMap
  7271. * @namespace
  7272. * @description 事件处理函数.
  7273. */
  7274. var Event = SuperMap.Event = {
  7275. /**
  7276. * @description A hash table cache of the event observers. Keyed by element._eventCacheID
  7277. * @type {boolean}
  7278. * @default false
  7279. */
  7280. observers: false,
  7281. /**
  7282. * @description KEY_SPACE
  7283. * @type {number}
  7284. * @default 32
  7285. */
  7286. KEY_SPACE: 32,
  7287. /**
  7288. * @description KEY_BACKSPACE
  7289. * @type {number}
  7290. * @default 8
  7291. */
  7292. KEY_BACKSPACE: 8,
  7293. /**
  7294. * @description KEY_TAB
  7295. * @type {number}
  7296. * @default 9
  7297. */
  7298. KEY_TAB: 9,
  7299. /**
  7300. * @description KEY_RETURN
  7301. * @type {number}
  7302. * @default 13
  7303. */
  7304. KEY_RETURN: 13,
  7305. /**
  7306. * @description KEY_ESC
  7307. * @type {number}
  7308. * @default 27
  7309. */
  7310. KEY_ESC: 27,
  7311. /**
  7312. * @description KEY_LEFT
  7313. * @type {number}
  7314. * @default 37
  7315. */
  7316. KEY_LEFT: 37,
  7317. /**
  7318. * @description KEY_UP
  7319. * @type {number}
  7320. * @default 38
  7321. */
  7322. KEY_UP: 38,
  7323. /**
  7324. * @description KEY_RIGHT
  7325. * @type {number}
  7326. * @default 39
  7327. */
  7328. KEY_RIGHT: 39,
  7329. /**
  7330. * @description KEY_DOWN
  7331. * @type {number}
  7332. * @default 40
  7333. */
  7334. KEY_DOWN: 40,
  7335. /**
  7336. * @description KEY_DELETE
  7337. * @type {number}
  7338. * @default 46
  7339. */
  7340. KEY_DELETE: 46,
  7341. /**
  7342. * @description Cross browser event element detection.
  7343. * @param {Event} event - The event
  7344. * @returns {HTMLElement} The element that caused the event
  7345. */
  7346. element: function element(event) {
  7347. return event.target || event.srcElement;
  7348. },
  7349. /**
  7350. * @description Determine whether event was caused by a single touch
  7351. * @param {Event} event - The event
  7352. * @returns {boolean}
  7353. */
  7354. isSingleTouch: function isSingleTouch(event) {
  7355. return event.touches && event.touches.length === 1;
  7356. },
  7357. /**
  7358. * @description Determine whether event was caused by a multi touch
  7359. * @param {Event} event - The event
  7360. * @returns {boolean}
  7361. */
  7362. isMultiTouch: function isMultiTouch(event) {
  7363. return event.touches && event.touches.length > 1;
  7364. },
  7365. /**
  7366. * @description Determine whether event was caused by a left click.
  7367. * @param {Event} event - The event
  7368. * @returns {boolean}
  7369. */
  7370. isLeftClick: function isLeftClick(event) {
  7371. return event.which && event.which === 1 || event.button && event.button === 1;
  7372. },
  7373. /**
  7374. * @description Determine whether event was caused by a right mouse click.
  7375. * @param {Event} event - The event
  7376. * @returns {boolean}
  7377. */
  7378. isRightClick: function isRightClick(event) {
  7379. return event.which && event.which === 3 || event.button && event.button === 2;
  7380. },
  7381. /**
  7382. * @description Stops an event from propagating.
  7383. * @param {Event} event - The event
  7384. * @param {boolean} allowDefault - If true, we stop the event chain but still allow the default browser behaviour (text selection, radio-button clicking, etc) Default false
  7385. */
  7386. stop: function stop(event, allowDefault) {
  7387. if (!allowDefault) {
  7388. if (event.preventDefault) {
  7389. event.preventDefault();
  7390. } else {
  7391. event.returnValue = false;
  7392. }
  7393. }
  7394. if (event.stopPropagation) {
  7395. event.stopPropagation();
  7396. } else {
  7397. event.cancelBubble = true;
  7398. }
  7399. },
  7400. /**
  7401. * @param {Event} event - The event。
  7402. * @param {string} tagName - html 标签名。
  7403. * @returns {HTMLElement} The first node with the given tagName, starting from the node the event was triggered on and traversing the DOM upwards
  7404. */
  7405. findElement: function findElement(event, tagName) {
  7406. var element = SuperMap.Event.element(event);
  7407. while (element.parentNode && (!element.tagName || element.tagName.toUpperCase() != tagName.toUpperCase())) {
  7408. element = element.parentNode;
  7409. }
  7410. return element;
  7411. },
  7412. /**
  7413. * @description 监听事件,注册事件处理方法。
  7414. * @param {(HTMLElement|string)} elementParam - 待监听的 DOM 对象或者其 ID 标识。
  7415. * @param {string} name - 监听事件的类别名称。
  7416. * @param {function} observer - 注册的事件处理方法。
  7417. * @param {boolean} [useCapture=false] - 是否捕获。
  7418. */
  7419. observe: function observe(elementParam, name, observer, useCapture) {
  7420. var element = Util.getElement(elementParam);
  7421. useCapture = useCapture || false;
  7422. if (name === 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)) {
  7423. name = 'keydown';
  7424. } //if observers cache has not yet been created, create it
  7425. if (!this.observers) {
  7426. this.observers = {};
  7427. } //if not already assigned, make a new unique cache ID
  7428. if (!element._eventCacheID) {
  7429. var idPrefix = "eventCacheID_";
  7430. if (element.id) {
  7431. idPrefix = element.id + "_" + idPrefix;
  7432. }
  7433. element._eventCacheID = Util.createUniqueID(idPrefix);
  7434. }
  7435. var cacheID = element._eventCacheID; //if there is not yet a hash entry for this element, add one
  7436. if (!this.observers[cacheID]) {
  7437. this.observers[cacheID] = [];
  7438. } //add a new observer to this element's list
  7439. this.observers[cacheID].push({
  7440. 'element': element,
  7441. 'name': name,
  7442. 'observer': observer,
  7443. 'useCapture': useCapture
  7444. }); //add the actual browser event listener
  7445. if (element.addEventListener) {
  7446. if (name === 'mousewheel') {
  7447. // https://www.chromestatus.com/features/6662647093133312
  7448. element.addEventListener(name, observer, {
  7449. useCapture: useCapture,
  7450. passive: false
  7451. });
  7452. } else {
  7453. element.addEventListener(name, observer, useCapture);
  7454. }
  7455. } else if (element.attachEvent) {
  7456. element.attachEvent('on' + name, observer);
  7457. }
  7458. },
  7459. /**
  7460. * @description Given the id of an element to stop observing, cycle through the
  7461. * element's cached observers, calling stopObserving on each one,
  7462. * skipping those entries which can no longer be removed.
  7463. *
  7464. * @param {(HTMLElement|string)} elementParam -
  7465. */
  7466. stopObservingElement: function stopObservingElement(elementParam) {
  7467. var element = Util.getElement(elementParam);
  7468. var cacheID = element._eventCacheID;
  7469. this._removeElementObservers(SuperMap.Event.observers[cacheID]);
  7470. },
  7471. /**
  7472. * @param {Array.<Object>} elementObservers - Array of (element, name,
  7473. * observer, usecapture) objects,
  7474. * taken directly from hashtable
  7475. */
  7476. _removeElementObservers: function _removeElementObservers(elementObservers) {
  7477. if (elementObservers) {
  7478. for (var i = elementObservers.length - 1; i >= 0; i--) {
  7479. var entry = elementObservers[i];
  7480. var args = new Array(entry.element, entry.name, entry.observer, entry.useCapture);
  7481. SuperMap.Event.stopObserving.apply(this, args);
  7482. }
  7483. }
  7484. },
  7485. /**
  7486. * @description 移除事件监听和注册的事件处理方法。注意:事件的移除和监听相对应,移除时的各属性信息必须监听时
  7487. * 保持一致才能确保事件移除成功。
  7488. * @param {(HTMLElement|string)} elementParam - 被监听的 DOM 元素或者其 ID。
  7489. * @param {string} name - 需要移除的被监听事件名称。
  7490. * @param {function} observer - 需要移除的事件处理方法。
  7491. * @param {boolean} [useCapture=false] - 是否捕获。
  7492. * @returns {boolean} Whether or not the event observer was removed
  7493. */
  7494. stopObserving: function stopObserving(elementParam, name, observer, useCapture) {
  7495. useCapture = useCapture || false;
  7496. var element = Util.getElement(elementParam);
  7497. var cacheID = element._eventCacheID;
  7498. if (name === 'keypress') {
  7499. if (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent) {
  7500. name = 'keydown';
  7501. }
  7502. } // find element's entry in this.observers cache and remove it
  7503. var foundEntry = false;
  7504. var elementObservers = SuperMap.Event.observers[cacheID];
  7505. if (elementObservers) {
  7506. // find the specific event type in the element's list
  7507. var i = 0;
  7508. while (!foundEntry && i < elementObservers.length) {
  7509. var cacheEntry = elementObservers[i];
  7510. if (cacheEntry.name === name && cacheEntry.observer === observer && cacheEntry.useCapture === useCapture) {
  7511. elementObservers.splice(i, 1);
  7512. if (elementObservers.length == 0) {
  7513. delete SuperMap.Event.observers[cacheID];
  7514. }
  7515. foundEntry = true;
  7516. break;
  7517. }
  7518. i++;
  7519. }
  7520. } //actually remove the event listener from browser
  7521. if (foundEntry) {
  7522. if (element.removeEventListener) {
  7523. element.removeEventListener(name, observer, useCapture);
  7524. } else if (element && element.detachEvent) {
  7525. element.detachEvent('on' + name, observer);
  7526. }
  7527. }
  7528. return foundEntry;
  7529. },
  7530. /**
  7531. * @description Cycle through all the element entries in the events cache and call
  7532. * stopObservingElement on each.
  7533. */
  7534. unloadCache: function unloadCache() {
  7535. // check for SuperMap.Event before checking for observers, because
  7536. // SuperMap.Event may be undefined in IE if no map instance was
  7537. // created
  7538. if (SuperMap.Event && SuperMap.Event.observers) {
  7539. for (var cacheID in SuperMap.Event.observers) {
  7540. var elementObservers = SuperMap.Event.observers[cacheID];
  7541. SuperMap.Event._removeElementObservers.apply(this, [elementObservers]);
  7542. }
  7543. SuperMap.Event.observers = false;
  7544. }
  7545. },
  7546. CLASS_NAME: "SuperMap.Event"
  7547. };
  7548. SuperMap.Event = Event;
  7549. /* prevent memory leaks in IE */
  7550. SuperMap.Event.observe(window, 'unload', SuperMap.Event.unloadCache, false);
  7551. ;// CONCATENATED MODULE: ./src/common/commontypes/Events.js
  7552. function Events_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Events_typeof = function _typeof(obj) { return typeof obj; }; } else { Events_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Events_typeof(obj); }
  7553. function Events_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  7554. 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); } }
  7555. function Events_createClass(Constructor, protoProps, staticProps) { if (protoProps) Events_defineProperties(Constructor.prototype, protoProps); if (staticProps) Events_defineProperties(Constructor, staticProps); return Constructor; }
  7556. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  7557. * This program are made available under the terms of the Apache License, Version 2.0
  7558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  7559. /**
  7560. * @class SuperMap.Events
  7561. * @classdesc 事件类。
  7562. * @param {Object} object - 当前事件对象被添加到的 JS 对象。
  7563. * @param {HTMLElement} element - 响应浏览器事件的 DOM 元素。
  7564. * @param {Array.<string>} eventTypes - 自定义应用事件的数组。
  7565. * @param {boolean} [fallThrough=false] - 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  7566. * @param {Object} options - 事件对象选项。
  7567. */
  7568. var Events = /*#__PURE__*/function () {
  7569. function Events(object, element, eventTypes, fallThrough, options) {
  7570. Events_classCallCheck(this, Events);
  7571. /**
  7572. * @member {Array.<string>} SuperMap.Events.prototype.BROWSER_EVENTS
  7573. * @description 支持的事件。
  7574. * @constant
  7575. * @default [
  7576. "mouseover", "mouseout","mousedown", "mouseup", "mousemove",
  7577. "click", "dblclick", "rightclick", "dblrightclick","resize",
  7578. "focus", "blur","touchstart", "touchmove", "touchend","keydown",
  7579. "MSPointerDown", "MSPointerUp", "pointerdown", "pointerup",
  7580. "MSGestureStart", "MSGestureChange", "MSGestureEnd","contextmenu"
  7581. ]
  7582. */
  7583. 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"];
  7584. /**
  7585. * @member {Object} SuperMap.Events.prototype.listeners
  7586. * @description Hashtable of Array(function): events listener functions
  7587. */
  7588. this.listeners = {};
  7589. /**
  7590. * @member {Object} SuperMap.Events.prototype.object
  7591. * @description 发布应用程序事件的对象。
  7592. */
  7593. this.object = object;
  7594. /**
  7595. * @member {HTMLElement} SuperMap.Events.prototype.element
  7596. * @description 接受浏览器事件的 DOM 节点。
  7597. */
  7598. this.element = null;
  7599. /**
  7600. * @member {Array.<string>} SuperMap.Events.prototype.eventTypes
  7601. * @description 支持的事件类型列表。
  7602. */
  7603. this.eventTypes = [];
  7604. /**
  7605. * @member {function} SuperMap.Events.prototype.eventHandler
  7606. * @description 绑定在元素上的事件处理器对象。
  7607. */
  7608. this.eventHandler = null;
  7609. /**
  7610. * @member {boolean} [SuperMap.Events.prototype.fallThrough=false]
  7611. * @description 是否允许事件处理之后向上传递(冒泡),为 false 的时候阻止事件冒泡。
  7612. */
  7613. this.fallThrough = fallThrough;
  7614. /**
  7615. * @member {boolean} [SuperMap.Events.prototype.includeXY=false]
  7616. * @description 判断是否让 xy 属性自动创建到浏览器上的鼠标事件,一般设置为 false,如果设置为 true,鼠标事件将会在事件传递过程中自动产生 xy 属性。
  7617. * 可根据事件对象的 'evt.object' 属性在相关的事件句柄上调用 getMousePosition 函数。这个选项习惯默认为 false 的原因在于,当创建一个
  7618. * 事件对象,其主要目的是管理。在一个 div 的相对定位的鼠标事件,将其设为 true 也是有意义的。这个选项也可以用来控制是否抵消缓存。如果
  7619. * 设为 false 不抵消,如果设为 true,用 this.clearMouseCache() 清除缓存偏移(边界元素偏移,元素在页面的位置偏移)。
  7620. * @example
  7621. * function named(evt) {
  7622. * this.xy = this.object.events.getMousePosition(evt);
  7623. * }
  7624. */
  7625. this.includeXY = false;
  7626. /**
  7627. * @member {Object} SuperMap.Events.prototype.extensions
  7628. * @description 事件扩展。Keys 代表事件类型,values 代表事件对象。
  7629. * @example
  7630. * 以扩展 "foostart" 和 "fooend" 事件为例。展示替换 css 属性为 foo 的元素的 click 事件。
  7631. *
  7632. * SuperMap.Events.foostart = SuperMap.Class({
  7633. * initialize: function(target) {
  7634. * this.target = target;
  7635. * this.target.register("click", this, this.doStuff, {extension: true});
  7636. * // only required if extension provides more than one event type
  7637. * this.target.extensions["foostart"] = true;
  7638. * this.target.extensions["fooend"] = true;
  7639. * },
  7640. * destroy: function() {
  7641. * var target = this.target;
  7642. * target.unregister("click", this, this.doStuff);
  7643. * delete this.target;
  7644. * // only required if extension provides more than one event type
  7645. * delete target.extensions["foostart"];
  7646. * delete target.extensions["fooend"];
  7647. * },
  7648. * doStuff: function(evt) {
  7649. * var propagate = true;
  7650. * if (SuperMap.Event.element(evt).className === "foo") {
  7651. * propagate = false;
  7652. * var target = this.target;
  7653. * target.triggerEvent("foostart");
  7654. * window.setTimeout(function() {
  7655. * target.triggerEvent("fooend");
  7656. * }, 1000);
  7657. * }
  7658. * return propagate;
  7659. * }
  7660. * });
  7661. * // only required if extension provides more than one event type
  7662. * SuperMap.Events.fooend = SuperMap.Events.foostart;
  7663. */
  7664. this.extensions = {};
  7665. /**
  7666. * @member {Object} SuperMap.Events.prototype.extensionCount
  7667. */
  7668. this.extensionCount = {};
  7669. /**
  7670. * @member {Object} SuperMap.Events.prototype.clearMouseListener
  7671. */
  7672. this.clearMouseListener = null;
  7673. Util.extend(this, options);
  7674. if (eventTypes != null) {
  7675. for (var i = 0, len = eventTypes.length; i < len; i++) {
  7676. this.addEventType(eventTypes[i]);
  7677. }
  7678. }
  7679. if (element != null) {
  7680. this.attachToElement(element);
  7681. }
  7682. this.CLASS_NAME = "SuperMap.Events";
  7683. }
  7684. /**
  7685. * @function SuperMap.Events.prototype.destroy
  7686. * @description 移除当前要素 element 上的所有事件监听和处理。
  7687. */
  7688. Events_createClass(Events, [{
  7689. key: "destroy",
  7690. value: function destroy() {
  7691. for (var e in this.extensions) {
  7692. if (typeof this.extensions[e] !== "boolean") {
  7693. this.extensions[e].destroy();
  7694. }
  7695. }
  7696. this.extensions = null;
  7697. if (this.element) {
  7698. Event.stopObservingElement(this.element);
  7699. if (this.element.hasScrollEvent) {
  7700. Event.stopObserving(window, "scroll", this.clearMouseListener);
  7701. }
  7702. }
  7703. this.element = null;
  7704. this.listeners = null;
  7705. this.object = null;
  7706. this.eventTypes = null;
  7707. this.fallThrough = null;
  7708. this.eventHandler = null;
  7709. }
  7710. /**
  7711. * @function SuperMap.Events.prototype.addEventType
  7712. * @description 在此事件对象中添加新的事件类型,如果这个事件类型已经添加过了,则不做任何事情。
  7713. * @param {string} eventName - 事件名。
  7714. */
  7715. }, {
  7716. key: "addEventType",
  7717. value: function addEventType(eventName) {
  7718. if (!this.listeners[eventName]) {
  7719. this.eventTypes.push(eventName);
  7720. this.listeners[eventName] = [];
  7721. }
  7722. }
  7723. /**
  7724. * @function SuperMap.Events.prototype.attachToElement
  7725. * @description 给 DOM 元素绑定浏览器事件。
  7726. * @param {HTMLDOMElement} element - 绑定浏览器事件的 DOM 元素。
  7727. */
  7728. }, {
  7729. key: "attachToElement",
  7730. value: function attachToElement(element) {
  7731. if (this.element) {
  7732. Event.stopObservingElement(this.element);
  7733. } else {
  7734. // keep a bound copy of handleBrowserEvent() so that we can
  7735. // pass the same function to both Event.observe() and .stopObserving()
  7736. this.eventHandler = FunctionExt.bindAsEventListener(this.handleBrowserEvent, this); // to be used with observe and stopObserving
  7737. this.clearMouseListener = FunctionExt.bind(this.clearMouseCache, this);
  7738. }
  7739. this.element = element;
  7740. for (var i = 0, len = this.BROWSER_EVENTS.length; i < len; i++) {
  7741. var eventType = this.BROWSER_EVENTS[i]; // every browser event has a corresponding application event
  7742. // (whether it's listened for or not).
  7743. this.addEventType(eventType); // use Prototype to register the event cross-browser
  7744. Event.observe(element, eventType, this.eventHandler);
  7745. } // disable dragstart in IE so that mousedown/move/up works normally
  7746. Event.observe(element, "dragstart", Event.stop);
  7747. }
  7748. /**
  7749. * @function SuperMap.Events.prototype.on
  7750. * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。
  7751. * @example
  7752. * // 注册一个 "loadstart" 监听事件
  7753. * events.on({"loadstart": loadStartListener});
  7754. *
  7755. * // 同样注册一个 "loadstart" 监听事件
  7756. * events.register("loadstart", undefined, loadStartListener);
  7757. *
  7758. * // 同时为对象注册多个监听事件
  7759. * events.on({
  7760. * "loadstart": loadStartListener,
  7761. * "loadend": loadEndListener,
  7762. * scope: object
  7763. * });
  7764. *
  7765. * // 同时为对象注册多个监听事件,多次调用 register 方法
  7766. * events.register("loadstart", object, loadStartListener);
  7767. * events.register("loadend", object, loadEndListener);
  7768. *
  7769. *
  7770. * @param {Object} object - 添加监听的对象。
  7771. */
  7772. }, {
  7773. key: "on",
  7774. value: function on(object) {
  7775. for (var type in object) {
  7776. if (type !== "scope" && object.hasOwnProperty(type)) {
  7777. this.register(type, object.scope, object[type]);
  7778. }
  7779. }
  7780. }
  7781. /**
  7782. * @function SuperMap.Events.prototype.register
  7783. * @description 在事件对象上注册一个事件。当事件被触发时,'func' 函数被调用,假设我们触发一个事件,
  7784. * 指定 SuperMap.Bounds 作为 "obj",当事件被触发时,回调函数的上下文作为 Bounds 对象。
  7785. * @param {string} type - 事件注册者的名字。
  7786. * @param {Object} [obj=this.object] - 对象绑定的回调。
  7787. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  7788. * @param {(boolean|Object)} [priority] - 当为 true 时将新的监听加在事件队列的前面。
  7789. */
  7790. }, {
  7791. key: "register",
  7792. value: function register(type, obj, func, priority) {
  7793. if (type in Events && !this.extensions[type]) {
  7794. this.extensions[type] = new Events[type](this);
  7795. }
  7796. if (func != null && Util.indexOf(this.eventTypes, type) !== -1) {
  7797. if (obj == null) {
  7798. obj = this.object;
  7799. }
  7800. var listeners = this.listeners[type];
  7801. if (!listeners) {
  7802. listeners = [];
  7803. this.listeners[type] = listeners;
  7804. this.extensionCount[type] = 0;
  7805. }
  7806. var listener = {
  7807. obj: obj,
  7808. func: func
  7809. };
  7810. if (priority) {
  7811. listeners.splice(this.extensionCount[type], 0, listener);
  7812. if (Events_typeof(priority) === "object" && priority.extension) {
  7813. this.extensionCount[type]++;
  7814. }
  7815. } else {
  7816. listeners.push(listener);
  7817. }
  7818. }
  7819. }
  7820. /**
  7821. * @function SuperMap.Events.prototype.registerPriority
  7822. * @description 相同的注册方法,但是在前面增加新的监听者事件查询而代替到方法的结束。
  7823. * @param {string} type - 事件注册者的名字。
  7824. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  7825. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  7826. */
  7827. }, {
  7828. key: "registerPriority",
  7829. value: function registerPriority(type, obj, func) {
  7830. this.register(type, obj, func, true);
  7831. }
  7832. /**
  7833. * @function SuperMap.Events.prototype.un
  7834. * @description 在一个相同的范围内取消注册监听器的方法,此方法调用 unregister 函数。
  7835. * @example
  7836. * // 移除 "loadstart" 事件监听
  7837. * events.un({"loadstart": loadStartListener});
  7838. *
  7839. * // 使用 "unregister" 方法移除 "loadstart" 事件监听
  7840. * events.unregister("loadstart", undefined, loadStartListener);
  7841. *
  7842. * // 取消对象多个事件监听
  7843. * events.un({
  7844. * "loadstart": loadStartListener,
  7845. * "loadend": loadEndListener,
  7846. * scope: object
  7847. * });
  7848. *
  7849. * // 取消对象多个事件监听,多次调用unregister方法。
  7850. * events.unregister("loadstart", object, loadStartListener);
  7851. * events.unregister("loadend", object, loadEndListener);
  7852. *
  7853. * @param {Object} object - 移除监听的对象。
  7854. */
  7855. }, {
  7856. key: "un",
  7857. value: function un(object) {
  7858. for (var type in object) {
  7859. if (type !== "scope" && object.hasOwnProperty(type)) {
  7860. this.unregister(type, object.scope, object[type]);
  7861. }
  7862. }
  7863. }
  7864. /**
  7865. * @function SuperMap.Events.prototype.unregister
  7866. * @description 取消注册。
  7867. * @param {string} type - 事件类型。
  7868. * @param {Object} [obj=this.object] - 对象绑定方面的回调。
  7869. * @param {function} [func] - 回调函数,如果没有特定的回调,则这个函数不做任何事情。
  7870. */
  7871. }, {
  7872. key: "unregister",
  7873. value: function unregister(type, obj, func) {
  7874. if (obj == null) {
  7875. obj = this.object;
  7876. }
  7877. var listeners = this.listeners[type];
  7878. if (listeners != null) {
  7879. for (var i = 0, len = listeners.length; i < len; i++) {
  7880. if (listeners[i].obj === obj && listeners[i].func === func) {
  7881. listeners.splice(i, 1);
  7882. break;
  7883. }
  7884. }
  7885. }
  7886. }
  7887. /**
  7888. * @function SuperMap.Events.prototype.remove
  7889. * @description 删除某个事件类型的所有监听,如果该事件类型没有注册,则不做任何操作。
  7890. * @param {string} type - 事件类型。
  7891. */
  7892. }, {
  7893. key: "remove",
  7894. value: function remove(type) {
  7895. if (this.listeners[type] != null) {
  7896. this.listeners[type] = [];
  7897. }
  7898. }
  7899. /**
  7900. * @function SuperMap.Events.prototype.triggerEvent
  7901. * @description 触发一个特定的注册事件。
  7902. * @param {string} type - 触发事件类型。
  7903. * @param {Event} evt - 事件对象。
  7904. * @returns {boolean} 返回监听对象,如果返回是 false,则停止监听。
  7905. */
  7906. }, {
  7907. key: "triggerEvent",
  7908. value: function triggerEvent(type, evt) {
  7909. var listeners = this.listeners[type]; // fast path
  7910. if (!listeners || listeners.length == 0) {
  7911. return undefined;
  7912. } // prep evt object with object & div references
  7913. if (evt == null) {
  7914. evt = {};
  7915. }
  7916. evt.object = this.object;
  7917. evt.element = this.element;
  7918. if (!evt.type) {
  7919. evt.type = type;
  7920. } // execute all callbacks registered for specified type
  7921. // get a clone of the listeners array to
  7922. // allow for splicing during callbacks
  7923. listeners = listeners.slice();
  7924. var continueChain;
  7925. for (var i = 0, len = listeners.length; i < len; i++) {
  7926. var callback = listeners[i]; // bind the context to callback.obj
  7927. continueChain = callback.func.apply(callback.obj, [evt]);
  7928. if (continueChain != undefined && continueChain === false) {
  7929. // if callback returns false, execute no more callbacks.
  7930. break;
  7931. }
  7932. } // don't fall through to other DOM elements
  7933. if (!this.fallThrough) {
  7934. Event.stop(evt, true);
  7935. }
  7936. return continueChain;
  7937. }
  7938. /**
  7939. * @function SuperMap.Events.prototype.handleBrowserEvent
  7940. * @description 对 triggerEvent 函数的包装,给事件对象设置了 xy 属性(即当前鼠标点的 xy 坐标)。
  7941. * @param {Event} evt - 事件对象。
  7942. */
  7943. }, {
  7944. key: "handleBrowserEvent",
  7945. value: function handleBrowserEvent(evt) {
  7946. var type = evt.type,
  7947. listeners = this.listeners[type];
  7948. if (!listeners || listeners.length == 0) {
  7949. // noone's listening, bail out
  7950. return;
  7951. } // add clientX & clientY to all events - corresponds to average x, y
  7952. var touches = evt.touches;
  7953. if (touches && touches[0]) {
  7954. var x = 0;
  7955. var y = 0;
  7956. var num = touches.length;
  7957. var touch;
  7958. for (var i = 0; i < num; ++i) {
  7959. touch = touches[i];
  7960. x += touch.clientX;
  7961. y += touch.clientY;
  7962. }
  7963. evt.clientX = x / num;
  7964. evt.clientY = y / num;
  7965. }
  7966. if (this.includeXY) {
  7967. evt.xy = this.getMousePosition(evt);
  7968. }
  7969. this.triggerEvent(type, evt);
  7970. }
  7971. /**
  7972. * @function SuperMap.Events.prototype.clearMouseCache
  7973. * @description 清除鼠标缓存。
  7974. */
  7975. }, {
  7976. key: "clearMouseCache",
  7977. value: function clearMouseCache() {
  7978. this.element.scrolls = null;
  7979. this.element.lefttop = null;
  7980. var body = document.body;
  7981. if (body && !((body.scrollTop != 0 || body.scrollLeft != 0) && navigator.userAgent.match(/iPhone/i))) {
  7982. this.element.offsets = null;
  7983. }
  7984. }
  7985. /**
  7986. * @function SuperMap.Events.prototype.getMousePosition
  7987. * @param {Event} evt - 事件对象。
  7988. * @returns {SuperMap.Pixel} 当前的鼠标的 xy 坐标点。
  7989. */
  7990. }, {
  7991. key: "getMousePosition",
  7992. value: function getMousePosition(evt) {
  7993. if (!this.includeXY) {
  7994. this.clearMouseCache();
  7995. } else if (!this.element.hasScrollEvent) {
  7996. Event.observe(window, "scroll", this.clearMouseListener);
  7997. this.element.hasScrollEvent = true;
  7998. }
  7999. if (!this.element.scrolls) {
  8000. var viewportElement = Util.getViewportElement();
  8001. this.element.scrolls = [viewportElement.scrollLeft, viewportElement.scrollTop];
  8002. }
  8003. if (!this.element.lefttop) {
  8004. this.element.lefttop = [document.documentElement.clientLeft || 0, document.documentElement.clientTop || 0];
  8005. }
  8006. if (!this.element.offsets) {
  8007. this.element.offsets = Util.pagePosition(this.element);
  8008. }
  8009. 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]);
  8010. }
  8011. }]);
  8012. return Events;
  8013. }();
  8014. SuperMap.Events = Events;
  8015. SuperMap.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"];
  8016. ;// CONCATENATED MODULE: ./src/common/commontypes/Feature.js
  8017. function Feature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8018. 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); } }
  8019. function Feature_createClass(Constructor, protoProps, staticProps) { if (protoProps) Feature_defineProperties(Constructor.prototype, protoProps); if (staticProps) Feature_defineProperties(Constructor, staticProps); return Constructor; }
  8020. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8021. * This program are made available under the terms of the Apache License, Version 2.0
  8022. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8023. /**
  8024. * @class SuperMap.Feature
  8025. * @category BaseTypes Geometry
  8026. * @classdesc 要素类组合了地理和属性,Feature 类同时具有 marker 和 lonlat 属性。
  8027. * @param {SuperMap.Layer} layer - 图层。
  8028. * @param {SuperMap.LonLat} lonlat - 经纬度。
  8029. * @param {Object} data - 数据对象。
  8030. */
  8031. var Feature = /*#__PURE__*/function () {
  8032. function Feature(layer, lonlat, data) {
  8033. Feature_classCallCheck(this, Feature);
  8034. this.CLASS_NAME = "SuperMap.Feature";
  8035. /**
  8036. * @deprecated
  8037. * @member {SuperMap.Layer} SuperMap.Feature.prototype.layer
  8038. * @description 图层。
  8039. */
  8040. this.layer = layer;
  8041. /**
  8042. * @member {string} SuperMap.Feature.prototype.id
  8043. * @description 要素 ID。
  8044. */
  8045. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  8046. /**
  8047. * @member {SuperMap.LonLat} SuperMap.Feature.prototype.lonlat
  8048. * @description 经纬度。
  8049. *
  8050. */
  8051. this.lonlat = lonlat;
  8052. /**
  8053. * @member {Object} SuperMap.Feature.prototype.data
  8054. * @description 数据对象。
  8055. */
  8056. this.data = data != null ? data : {};
  8057. }
  8058. /**
  8059. * @function SuperMap.Feature.prototype.destroy
  8060. * @description 释放相关资源。
  8061. */
  8062. Feature_createClass(Feature, [{
  8063. key: "destroy",
  8064. value: function destroy() {
  8065. this.id = null;
  8066. this.lonlat = null;
  8067. this.data = null;
  8068. }
  8069. }]);
  8070. return Feature;
  8071. }();
  8072. SuperMap.Feature = Feature;
  8073. ;// CONCATENATED MODULE: ./src/common/commontypes/Vector.js
  8074. function Vector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Vector_typeof = function _typeof(obj) { return typeof obj; }; } else { Vector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Vector_typeof(obj); }
  8075. function Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8076. 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); } }
  8077. function Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Vector_defineProperties(Constructor, staticProps); return Constructor; }
  8078. function Vector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Vector_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Vector_get(target, property, receiver || target); }
  8079. function Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  8080. 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 } }); if (superClass) Vector_setPrototypeOf(subClass, superClass); }
  8081. function Vector_setPrototypeOf(o, p) { Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Vector_setPrototypeOf(o, p); }
  8082. 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); }; }
  8083. function Vector_possibleConstructorReturn(self, call) { if (call && (Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return Vector_assertThisInitialized(self); }
  8084. function Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8085. function Vector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8086. function Vector_getPrototypeOf(o) { Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Vector_getPrototypeOf(o); }
  8087. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8088. * This program are made available under the terms of the Apache License, Version 2.0
  8089. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8090. /**
  8091. * @class SuperMap.Feature.Vector
  8092. * @category BaseTypes Geometry
  8093. * @classdesc 矢量要素类。该类具有 Geometry 属性存放几何信息,
  8094. * attributes 属性存放非几何信息,另外还包含了 style 属性,用来定义矢量要素的样式,
  8095. * 其中,默认的样式在 {@link SuperMap.Feature.Vector.style} 类中定义,如果没有特别的指定将使用默认的样式。
  8096. * @extends {SuperMap.Feature}
  8097. * @param {SuperMap.Geometry} geometry - 代表要素的几何形状。
  8098. * @param {Object} [attributes] - 描述要素的任意的可序列化属性,将要映射到 attributes 属性中的对象。
  8099. * @param {Object} [style] - 样式对象。
  8100. * @example
  8101. * var geometry = new SuperMap.Geometry.Point(-115,10);
  8102. * var style = {
  8103. * strokeColor:"#339933",
  8104. * strokeOpacity:1,
  8105. * strokeWidth:3,
  8106. * pointRadius:6
  8107. * }
  8108. * var pointFeature = new SuperMap.Feature.Vector(geometry,null,style);
  8109. * vectorLayer.addFeatures(pointFeature);
  8110. */
  8111. var Vector = /*#__PURE__*/function (_Feature) {
  8112. Vector_inherits(Vector, _Feature);
  8113. var _super = Vector_createSuper(Vector);
  8114. function Vector(geometry, attributes, style) {
  8115. var _this;
  8116. Vector_classCallCheck(this, Vector);
  8117. _this = _super.call(this, null, null, attributes);
  8118. /**
  8119. * @member {string} SuperMap.Feature.Vector.prototype.fid
  8120. * @description fid
  8121. */
  8122. _this.fid = null;
  8123. /**
  8124. * @member {SuperMap.Geometry} SuperMap.Feature.Vector.prototype.geometry
  8125. * @description 该属性用于存放几何信息。
  8126. */
  8127. _this.geometry = geometry ? geometry : null;
  8128. /**
  8129. * @member {Object} SuperMap.Feature.Vector.prototype.attributes
  8130. * @description 描述要素的任意的可序列化属性。
  8131. */
  8132. _this.attributes = {};
  8133. if (attributes) {
  8134. _this.attributes = Util.extend(_this.attributes, attributes);
  8135. }
  8136. /**
  8137. * @member {SuperMap.Bounds} SuperMap.Feature.Vector.prototype.bounds
  8138. * @description The box bounding that feature's geometry, that
  8139. * property can be set by an <SuperMap.Format> object when
  8140. * deserializing the feature, so in most cases it represents an
  8141. * information set by the server.
  8142. */
  8143. _this.bounds = null;
  8144. /**
  8145. * @member {string} SuperMap.Feature.Vector.prototype.state
  8146. * @description state
  8147. */
  8148. _this.state = null;
  8149. /**
  8150. * @member {Object} SuperMap.Feature.Vector.prototype.style
  8151. * @description 要素的样式属性,地图查询返回的 feature 的 style,8C 变为null。
  8152. */
  8153. _this.style = style ? style : null;
  8154. /**
  8155. * @member {string} SuperMap.Feature.Vector.prototype.url
  8156. * @description 如果设置了这个属性,在更新或者删除要素时需要考虑 {@link SuperMap.HTTP} 。
  8157. */
  8158. _this.url = null;
  8159. _this.lonlat = null;
  8160. _this.CLASS_NAME = "SuperMap.Feature.Vector"; // TRASH THIS
  8161. SuperMap.State = {
  8162. /** states */
  8163. UNKNOWN: 'Unknown',
  8164. INSERT: 'Insert',
  8165. UPDATE: 'Update',
  8166. DELETE: 'Delete'
  8167. };
  8168. Vector.style = {
  8169. 'default': {
  8170. fillColor: "#ee9900",
  8171. fillOpacity: 0.4,
  8172. hoverFillColor: "white",
  8173. hoverFillOpacity: 0.8,
  8174. strokeColor: "#ee9900",
  8175. strokeOpacity: 1,
  8176. strokeWidth: 1,
  8177. strokeLinecap: "round",
  8178. strokeDashstyle: "solid",
  8179. hoverStrokeColor: "red",
  8180. hoverStrokeOpacity: 1,
  8181. hoverStrokeWidth: 0.2,
  8182. pointRadius: 6,
  8183. hoverPointRadius: 1,
  8184. hoverPointUnit: "%",
  8185. pointerEvents: "visiblePainted",
  8186. cursor: "inherit",
  8187. fontColor: "#000000",
  8188. labelAlign: "cm",
  8189. labelOutlineColor: "white",
  8190. labelOutlineWidth: 3
  8191. },
  8192. 'select': {
  8193. fillColor: "blue",
  8194. fillOpacity: 0.4,
  8195. hoverFillColor: "white",
  8196. hoverFillOpacity: 0.8,
  8197. strokeColor: "blue",
  8198. strokeOpacity: 1,
  8199. strokeWidth: 2,
  8200. strokeLinecap: "round",
  8201. strokeDashstyle: "solid",
  8202. hoverStrokeColor: "red",
  8203. hoverStrokeOpacity: 1,
  8204. hoverStrokeWidth: 0.2,
  8205. pointRadius: 6,
  8206. hoverPointRadius: 1,
  8207. hoverPointUnit: "%",
  8208. pointerEvents: "visiblePainted",
  8209. cursor: "pointer",
  8210. fontColor: "#000000",
  8211. labelAlign: "cm",
  8212. labelOutlineColor: "white",
  8213. labelOutlineWidth: 3
  8214. },
  8215. 'temporary': {
  8216. fillColor: "#66cccc",
  8217. fillOpacity: 0.2,
  8218. hoverFillColor: "white",
  8219. hoverFillOpacity: 0.8,
  8220. strokeColor: "#66cccc",
  8221. strokeOpacity: 1,
  8222. strokeLinecap: "round",
  8223. strokeWidth: 2,
  8224. strokeDashstyle: "solid",
  8225. hoverStrokeColor: "red",
  8226. hoverStrokeOpacity: 1,
  8227. hoverStrokeWidth: 0.2,
  8228. pointRadius: 6,
  8229. hoverPointRadius: 1,
  8230. hoverPointUnit: "%",
  8231. pointerEvents: "visiblePainted",
  8232. //cursor:"inherit",
  8233. cursor: "default",
  8234. fontColor: "#000000",
  8235. labelAlign: "cm",
  8236. labelOutlineColor: "white",
  8237. labelOutlineWidth: 3
  8238. },
  8239. 'delete': {
  8240. display: "none"
  8241. }
  8242. };
  8243. return _this;
  8244. }
  8245. /**
  8246. * @function SuperMap.Feature.Vector.prototype.destroy
  8247. * @description nullify references to prevent circular references and memory leaks
  8248. */
  8249. Vector_createClass(Vector, [{
  8250. key: "destroy",
  8251. value: function destroy() {
  8252. if (this.layer) {
  8253. this.layer.removeFeatures(this);
  8254. this.layer = null;
  8255. }
  8256. this.geometry = null;
  8257. Vector_get(Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  8258. }
  8259. /**
  8260. * @function SuperMap.Feature.Vector.prototype.clone
  8261. * @description Create a clone of this vector feature. Does not set any non-standard
  8262. * properties.
  8263. * @returns {SuperMap.Feature.Vector} An exact clone of this vector feature.
  8264. */
  8265. }, {
  8266. key: "clone",
  8267. value: function clone() {
  8268. return new Vector(this.geometry ? this.geometry.clone() : null, this.attributes, this.style);
  8269. }
  8270. /**
  8271. * @function SuperMap.Feature.Vector.prototype.toState
  8272. * @description 设置新状态。
  8273. * @param {string} state - 状态。
  8274. */
  8275. }, {
  8276. key: "toState",
  8277. value: function toState(state) {
  8278. if (state === SuperMap.State.UPDATE) {
  8279. switch (this.state) {
  8280. case SuperMap.State.UNKNOWN:
  8281. case SuperMap.State.DELETE:
  8282. this.state = state;
  8283. break;
  8284. case SuperMap.State.UPDATE:
  8285. case SuperMap.State.INSERT:
  8286. break;
  8287. }
  8288. } else if (state === SuperMap.State.INSERT) {
  8289. switch (this.state) {
  8290. case SuperMap.State.UNKNOWN:
  8291. break;
  8292. default:
  8293. this.state = state;
  8294. break;
  8295. }
  8296. } else if (state === SuperMap.State.DELETE) {
  8297. switch (this.state) {
  8298. case SuperMap.State.INSERT:
  8299. // the feature should be destroyed
  8300. break;
  8301. case SuperMap.State.DELETE:
  8302. break;
  8303. case SuperMap.State.UNKNOWN:
  8304. case SuperMap.State.UPDATE:
  8305. this.state = state;
  8306. break;
  8307. }
  8308. } else if (state === SuperMap.State.UNKNOWN) {
  8309. this.state = state;
  8310. }
  8311. }
  8312. }]);
  8313. return Vector;
  8314. }(Feature);
  8315. /**
  8316. *
  8317. * @typedef {Object} SuperMap.Feature.Vector.style
  8318. * @description SuperMap.features 有大量的样式属性,如果没有特别的指定将使用默认的样式,
  8319. * 大部分样式通过 SVG 标准定义属性。
  8320. * - fill properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#FillProperties}
  8321. * - stroke properties 资料介绍:{@link http://www.w3.org/TR/SVG/painting.html#StrokeProperties}
  8322. * @property {boolean} [fill] - 不需要填充则设置为 false。
  8323. * @property {string} [fillColor='#ee9900'] - 十六进制填充颜色。
  8324. * @property {number} [fillOpacity=0.4] - 填充不透明度。
  8325. * @property {boolean} [stroke] - 不需要描边则设为 false。
  8326. * @property {string} [strokeColor='#ee9900'] - 十六进制描边颜色。
  8327. * @property {number} [strokeOpacity=0.4] - 描边的不透明度(0-1)。
  8328. * @property {number} [strokeWidth=1] - 像素描边宽度。
  8329. * @property {string} [strokeLinecap='round'] - strokeLinecap 有三种类型 butt,round,square。
  8330. * @property {string} [strokeDashstyle='solid'] - 有 dot,dash,dashdot,longdash,longdashdot,solid 几种样式。
  8331. * @property {boolean} [graphic] - 不需要则设置为 false。
  8332. * @property {number} [pointRadius=6] - 像素点半径。
  8333. * @property {string} [pointerEvents='visiblePainted'] - pointerEvents。
  8334. * @property {string} [cursor] - cursor。
  8335. * @property {boolean} [allowRotate='false'] - 是否允许图标随着运行方向旋转。用于时空数据图层。
  8336. * @property {string} [externalGraphic] - 连接到用来渲染点的外部的图形。
  8337. * @property {number} [graphicWidth] - 外部图表的像素宽度。
  8338. * @property {number} [graphicHeight] - 外部图表的高宽度。
  8339. * @property {number} [graphicOpacity] - 外部图表的不透明度(0-1)。
  8340. * @property {number} [graphicXOffset] - 外部图表沿着x方向的偏移量。
  8341. * @property {number} [graphicYOffset] - 外部图表沿着y方向的偏移量 Pixel。
  8342. * @property {number} [rotation] - 一个图表沿着其中心点(或者偏移中心指定点)在顺时针方向旋转。
  8343. * @property {number} [graphicZIndex] - 渲染时使用的索引值。
  8344. * @property {string} [graphicName='circle'] - 渲染点时图标使用的名字。支持"circle" , "square", "star", "x", "cross", "triangle"。
  8345. * @property {string} [graphicTitle] - 外部图表的提示框。
  8346. * @property {string} [backgroundGraphic] - 外部图表的背景。
  8347. * @property {number} [backgroundGraphicZIndex] - 背景图渲染时使用的索引值。
  8348. * @property {number} [backgroundXOffset] - 背景图在 x 轴的偏移量。
  8349. * @property {number} [backgroundYOffset] - 背景图在 y 轴的偏移量。
  8350. * @property {number} [backgroundHeight] - 背景图的高度。如果没有设置,将用 graphicHeight。
  8351. * @property {number} [backgroundWidth] - 背景图的宽度。如果没有设置,将用 graphicWidth。
  8352. * @property {boolean} [isUnicode=false] - 这个属性要配合 label 属性来用,当为 true时,label 就可以使用 unicode 编码,
  8353. * 比如 "a" 的 unicode 十六进制编码为 61,则 label 属性可以为 "&#x61;",其中 "&#" 为前缀,标志这个为 unicode 编码,
  8354. * "x" 是指 16 进制,这时页面显示的是 "a";当此值为 false 的时候,label 的内容会被直接输出,
  8355. * 比如,label 为 "&#x61;",这时页面显示的也是 "&#x61;"。
  8356. * @property {string} [label] - 可选的标签文本。
  8357. * @property {string} [labelAlign='cm'] - 标签对齐,是由两个字符组成的字符串,如:"lt", "cm", "rb",
  8358. * 其中第一个字符代表水平方向上的对齐,"l"=left, "c"=center, "r"=right;
  8359. * 第二个字符代表垂直方向上的对齐,"t"=top, "m"=middle, "b"=bottom。
  8360. * @property {number} [labelXOffset] - 标签在 x 轴方向的偏移量。
  8361. * @property {number} [labelYOffset] - 标签在 y 轴方向的偏移量。
  8362. * @property {boolean} [labelSelect=false] - 如果设为 true,标签可以选用 SelectFeature 或者 similar 控件。
  8363. * @property {string} [fontColor='#000000'] - 标签字体颜色。
  8364. * @property {number} [fontOpacity] - 标签透明度 (0-1)。
  8365. * @property {string} [fontFamily] - 标签的字体类型。
  8366. * @property {string} [fontSize] - 标签的字体大小。
  8367. * @property {string} [fontStyle] - 标签的字体样式。
  8368. * @property {string} [fontWeight] - 标签的字体粗细。
  8369. * @property {string} [display] - 如果 display 属性设置为 “none”,符号将没有任何效果。
  8370. * @example
  8371. * // label的用法如下:
  8372. * function addGeoTest(){
  8373. * var geometry = new SuperMap.Geometry.Point(105, 35);
  8374. * var pointFeature = new SuperMap.Feature.Vector(geometry);
  8375. * var styleTest = {
  8376. * label:"supermap",
  8377. * fontColor:"#0000ff",
  8378. * fontOpacity:"0.5",
  8379. * fontFamily:"隶书",
  8380. * fontSize:"8em",
  8381. * fontWeight:"bold",
  8382. * fontStyle:"italic",
  8383. * labelSelect:"true",
  8384. * }
  8385. * pointFeature.style = styleTest;
  8386. * vectorLayer.addFeatures([pointFeature]);
  8387. * }
  8388. */
  8389. SuperMap.Feature.Vector = Vector;
  8390. ;// CONCATENATED MODULE: ./src/common/commontypes/index.js
  8391. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8392. * This program are made available under the terms of the Apache License, Version 2.0
  8393. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8394. ;// CONCATENATED MODULE: ./src/common/format/Format.js
  8395. function Format_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8396. 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); } }
  8397. function Format_createClass(Constructor, protoProps, staticProps) { if (protoProps) Format_defineProperties(Constructor.prototype, protoProps); if (staticProps) Format_defineProperties(Constructor, staticProps); return Constructor; }
  8398. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8399. * This program are made available under the terms of the Apache License, Version 2.0
  8400. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8401. /**
  8402. * @class SuperMap.Format
  8403. * @classdesc 读写各种格式的格式类基类。其子类应该包含并实现 read 和 write 方法。
  8404. * @category BaseTypes Format
  8405. * @param {Object} options - 可选参数。
  8406. * @param {boolean} [options.keepData=false] - 如果设置为 true, data 属性会指向被解析的对象(例如 JSON 或 xml 数据对象)。
  8407. * @param {Object} [options.data] - 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  8408. */
  8409. var Format = /*#__PURE__*/function () {
  8410. function Format(options) {
  8411. Format_classCallCheck(this, Format);
  8412. /**
  8413. * @member {Object} SuperMap.Format.prototype.data
  8414. * @description 当 keepData 属性设置为 true,这是传递给 read 操作的要被解析的字符串。
  8415. */
  8416. this.data = null;
  8417. /**
  8418. * APIProperty: keepData
  8419. * @member {Object} [SuperMap.Format.prototype.keepData=false]
  8420. * @description 保持最近读到的数据的引用(通过 <data> 属性)。
  8421. */
  8422. this.keepData = false;
  8423. Util.extend(this, options);
  8424. this.options = options;
  8425. this.CLASS_NAME = "SuperMap.Format";
  8426. }
  8427. /**
  8428. * @function SuperMap.Format.prototype.destroy
  8429. * @description 销毁该格式类,释放相关资源。
  8430. */
  8431. Format_createClass(Format, [{
  8432. key: "destroy",
  8433. value: function destroy() {//用来销毁该格式类,释放相关资源
  8434. }
  8435. /**
  8436. * @function SuperMap.Format.prototype.read
  8437. * @description 来从字符串中读取数据。
  8438. * @param {string} data - 读取的数据。
  8439. */
  8440. }, {
  8441. key: "read",
  8442. value: function read(data) {// eslint-disable-line no-unused-vars
  8443. //用来从字符串中读取数据
  8444. }
  8445. /**
  8446. * @function SuperMap.Format.prototype.write
  8447. * @description 将对象写成字符串。
  8448. * @param {Object} object - 可序列化的对象。
  8449. * @returns {string} 对象被写成字符串。
  8450. */
  8451. }, {
  8452. key: "write",
  8453. value: function write(object) {// eslint-disable-line no-unused-vars
  8454. //用来写字符串
  8455. }
  8456. }]);
  8457. return Format;
  8458. }();
  8459. SuperMap.Format = SuperMap.Format || Format;
  8460. ;// CONCATENATED MODULE: ./src/common/format/JSON.js
  8461. function JSON_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { JSON_typeof = function _typeof(obj) { return typeof obj; }; } else { JSON_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return JSON_typeof(obj); }
  8462. function JSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8463. 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); } }
  8464. function JSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) JSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) JSON_defineProperties(Constructor, staticProps); return Constructor; }
  8465. 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 } }); if (superClass) JSON_setPrototypeOf(subClass, superClass); }
  8466. function JSON_setPrototypeOf(o, p) { JSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return JSON_setPrototypeOf(o, p); }
  8467. 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); }; }
  8468. function JSON_possibleConstructorReturn(self, call) { if (call && (JSON_typeof(call) === "object" || typeof call === "function")) { return call; } return JSON_assertThisInitialized(self); }
  8469. function JSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  8470. function JSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  8471. function JSON_getPrototypeOf(o) { JSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return JSON_getPrototypeOf(o); }
  8472. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8473. * This program are made available under the terms of the Apache License, Version 2.0
  8474. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8475. /**
  8476. * @class SuperMap.Format.JSON
  8477. * @classdesc 安全的读写 JSON 的解析类。使用 {@link SuperMap.Format.JSON} 构造函数创建新实例。
  8478. * @category BaseTypes Format
  8479. * @param {Object} [options] - 参数。
  8480. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  8481. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  8482. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  8483. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  8484. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8485. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  8486. * @extends {SuperMap.Format}
  8487. */
  8488. var JSONFormat = /*#__PURE__*/function (_Format) {
  8489. JSON_inherits(JSONFormat, _Format);
  8490. var _super = JSON_createSuper(JSONFormat);
  8491. function JSONFormat(options) {
  8492. var _this;
  8493. JSON_classCallCheck(this, JSONFormat);
  8494. _this = _super.call(this, options);
  8495. /**
  8496. * @member {string} [SuperMap.Format.JSON.prototype.indent=" "]
  8497. * @description 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  8498. */
  8499. _this.indent = " ";
  8500. /**
  8501. * @member {string} [SuperMap.Format.JSON.prototype.space=" "]
  8502. * @description 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  8503. */
  8504. _this.space = " ";
  8505. /**
  8506. * @member {string} [SuperMap.Format.JSON.prototype.newline="\n"]
  8507. * @description 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  8508. */
  8509. _this.newline = "\n";
  8510. /**
  8511. * @member {integer} [SuperMap.Format.JSON.prototype.level=0]
  8512. * @description 用于格式化输出, 表示的是缩进级别。
  8513. */
  8514. _this.level = 0;
  8515. /**
  8516. * @member {boolean} [SuperMap.Format.JSON.prototype.pretty=false]
  8517. * @description 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8518. */
  8519. _this.pretty = false;
  8520. /**
  8521. * @member {boolean} SuperMap.Format.JSON.prototype.nativeJSON
  8522. * @description 判断浏览器是否原生支持 JSON 格式数据。
  8523. */
  8524. _this.nativeJSON = function () {
  8525. return !!(window.JSON && typeof JSON.parse === "function" && typeof JSON.stringify === "function");
  8526. }();
  8527. _this.CLASS_NAME = "SuperMap.Format.JSON";
  8528. /**
  8529. * @member SuperMap.Format.JSON.prototype.serialize
  8530. * @description 提供一些类型对象转 JSON 字符串的方法。
  8531. */
  8532. _this.serialize = {
  8533. /**
  8534. * @function SuperMap.Format.JSON.serialize.object
  8535. * @description 把对象转换为 JSON 字符串。
  8536. * @param {Object} object - 可序列化的对象。
  8537. * @returns {string} JSON 字符串。
  8538. */
  8539. 'object': function object(_object) {
  8540. // three special objects that we want to treat differently
  8541. if (_object == null) {
  8542. return "null";
  8543. }
  8544. if (_object.constructor === Date) {
  8545. return this.serialize.date.apply(this, [_object]);
  8546. }
  8547. if (_object.constructor === Array) {
  8548. return this.serialize.array.apply(this, [_object]);
  8549. }
  8550. var pieces = ['{'];
  8551. this.level += 1;
  8552. var key, keyJSON, valueJSON;
  8553. var addComma = false;
  8554. for (key in _object) {
  8555. if (_object.hasOwnProperty(key)) {
  8556. // recursive calls need to allow for sub-classing
  8557. keyJSON = this.write.apply(this, [key, this.pretty]);
  8558. valueJSON = this.write.apply(this, [_object[key], this.pretty]);
  8559. if (keyJSON != null && valueJSON != null) {
  8560. if (addComma) {
  8561. pieces.push(',');
  8562. }
  8563. pieces.push(this.writeNewline(), this.writeIndent(), keyJSON, ':', this.writeSpace(), valueJSON);
  8564. addComma = true;
  8565. }
  8566. }
  8567. }
  8568. this.level -= 1;
  8569. pieces.push(this.writeNewline(), this.writeIndent(), '}');
  8570. return pieces.join('');
  8571. },
  8572. /**
  8573. * @function SuperMap.Format.JSON.serialize.array
  8574. * @description 把数组转换成 JSON 字符串。
  8575. * @param {Array} array - 可序列化的数组。
  8576. * @returns {string} JSON 字符串。
  8577. */
  8578. 'array': function array(_array) {
  8579. var json;
  8580. var pieces = ['['];
  8581. this.level += 1;
  8582. for (var i = 0, len = _array.length; i < len; ++i) {
  8583. // recursive calls need to allow for sub-classing
  8584. json = this.write.apply(this, [_array[i], this.pretty]);
  8585. if (json != null) {
  8586. if (i > 0) {
  8587. pieces.push(',');
  8588. }
  8589. pieces.push(this.writeNewline(), this.writeIndent(), json);
  8590. }
  8591. }
  8592. this.level -= 1;
  8593. pieces.push(this.writeNewline(), this.writeIndent(), ']');
  8594. return pieces.join('');
  8595. },
  8596. /**
  8597. * @function SuperMap.Format.JSON.serialize.string
  8598. * @description 把字符串转换成 JSON 字符串。
  8599. * @param {string} string - 可序列化的字符串。
  8600. * @returns {string} JSON 字符串。
  8601. */
  8602. 'string': function string(_string) {
  8603. // If the string contains no control characters, no quote characters, and no
  8604. // backslash characters, then we can simply slap some quotes around it.
  8605. // Otherwise we must also replace the offending characters with safe
  8606. // sequences.
  8607. var m = {
  8608. '\b': '\\b',
  8609. '\t': '\\t',
  8610. '\n': '\\n',
  8611. '\f': '\\f',
  8612. '\r': '\\r',
  8613. '"': '\\"',
  8614. '\\': '\\\\'
  8615. };
  8616. /*eslint-disable no-control-regex*/
  8617. if (/["\\\x00-\x1f]/.test(_string)) {
  8618. return '"' + _string.replace(/([\x00-\x1f\\"])/g, function (a, b) {
  8619. var c = m[b];
  8620. if (c) {
  8621. return c;
  8622. }
  8623. c = b.charCodeAt();
  8624. return "\\u00" + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
  8625. }) + '"';
  8626. }
  8627. return '"' + _string + '"';
  8628. },
  8629. /**
  8630. * @function SuperMap.Format.JSON.serialize.number
  8631. * @description 把数字转换成 JSON 字符串。
  8632. * @param {number} number - 可序列化的数字。
  8633. * @returns {string} JSON 字符串。
  8634. */
  8635. 'number': function number(_number) {
  8636. return isFinite(_number) ? String(_number) : "null";
  8637. },
  8638. /**
  8639. * @function SuperMap.Format.JSON.serialize.boolean
  8640. * @description Transform a boolean into a JSON string.
  8641. * @param {boolean} bool - The boolean to be serialized.
  8642. * @returns {string} A JSON string representing the boolean.
  8643. */
  8644. 'boolean': function boolean(bool) {
  8645. return String(bool);
  8646. },
  8647. /**
  8648. * @function SuperMap.Format.JSON.serialize.object
  8649. * @description 将日期对象转换成 JSON 字符串。
  8650. * @param {Date} date - 可序列化的日期对象。
  8651. * @returns {string} JSON 字符串。
  8652. */
  8653. 'date': function date(_date) {
  8654. function format(number) {
  8655. // Format integers to have at least two digits.
  8656. return number < 10 ? '0' + number : number;
  8657. }
  8658. return '"' + _date.getFullYear() + '-' + format(_date.getMonth() + 1) + '-' + format(_date.getDate()) + 'T' + format(_date.getHours()) + ':' + format(_date.getMinutes()) + ':' + format(_date.getSeconds()) + '"';
  8659. }
  8660. };
  8661. return _this;
  8662. }
  8663. /**
  8664. * @function SuperMap.Format.JSON.prototype.read
  8665. * @description 将一个符合 JSON 结构的字符串进行解析。
  8666. * @param {string} json - 符合 JSON 结构的字符串。
  8667. * @param {function} filter - 过滤方法,最终结果的每一个键值对都会调用该过滤方法,并在对应的值的位置替换成该方法返回的值。
  8668. * @returns {Object} 对象,数组,字符串或数字。
  8669. */
  8670. JSON_createClass(JSONFormat, [{
  8671. key: "read",
  8672. value: function read(json, filter) {
  8673. var object;
  8674. if (this.nativeJSON) {
  8675. try {
  8676. object = JSON.parse(json, filter);
  8677. } catch (e) {// Fall through if the regexp test fails.
  8678. }
  8679. }
  8680. if (this.keepData) {
  8681. this.data = object;
  8682. }
  8683. return object;
  8684. }
  8685. /**
  8686. * @function SuperMap.Format.JSON.prototype.write
  8687. * @description 序列化一个对象到一个符合 JSON 格式的字符串。
  8688. * @param {(object|string|Array|number|boolean)} value - 需要被序列化的对象,数组,字符串,数字,布尔值。
  8689. * @param {boolean} [pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  8690. * @returns {string} 符合 JSON 格式的字符串。
  8691. *
  8692. */
  8693. }, {
  8694. key: "write",
  8695. value: function write(value, pretty) {
  8696. this.pretty = !!pretty;
  8697. var json = null;
  8698. var type = JSON_typeof(value);
  8699. if (this.serialize[type]) {
  8700. try {
  8701. json = !this.pretty && this.nativeJSON ? JSON.stringify(value) : this.serialize[type].apply(this, [value]);
  8702. } catch (err) {//SuperMap.Console.error("Trouble serializing: " + err);
  8703. }
  8704. }
  8705. return json;
  8706. }
  8707. /**
  8708. * @function SuperMap.Format.JSON.prototype.writeIndent
  8709. * @description 根据缩进级别输出一个缩进字符串。
  8710. * @private
  8711. * @returns {string} 一个适当的缩进字符串。
  8712. */
  8713. }, {
  8714. key: "writeIndent",
  8715. value: function writeIndent() {
  8716. var pieces = [];
  8717. if (this.pretty) {
  8718. for (var i = 0; i < this.level; ++i) {
  8719. pieces.push(this.indent);
  8720. }
  8721. }
  8722. return pieces.join('');
  8723. }
  8724. /**
  8725. * @function SuperMap.Format.JSON.prototype.writeNewline
  8726. * @description 在格式化输出模式情况下输出代表新一行的字符串。
  8727. * @private
  8728. * @returns {string} 代表新的一行的字符串。
  8729. */
  8730. }, {
  8731. key: "writeNewline",
  8732. value: function writeNewline() {
  8733. return this.pretty ? this.newline : '';
  8734. }
  8735. /**
  8736. * @function SuperMap.Format.JSON.prototype.writeSpace
  8737. * @private
  8738. * @description 在格式化输出模式情况下输出一个代表空格的字符串。
  8739. * @returns {string} 一个空格。
  8740. */
  8741. }, {
  8742. key: "writeSpace",
  8743. value: function writeSpace() {
  8744. return this.pretty ? this.space : '';
  8745. }
  8746. }]);
  8747. return JSONFormat;
  8748. }(Format);
  8749. SuperMap.Format.JSON = JSONFormat;
  8750. ;// CONCATENATED MODULE: ./src/common/iServer/ServerColor.js
  8751. function ServerColor_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8752. 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); } }
  8753. function ServerColor_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerColor_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerColor_defineProperties(Constructor, staticProps); return Constructor; }
  8754. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8755. * This program are made available under the terms of the Apache License, Version 2.0
  8756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8757. /**
  8758. * @class SuperMap.ServerColor
  8759. * @category iServer Map Theme
  8760. * @classdesc 颜色类。该类使用三原色( RGB )来表达颜色。
  8761. * @param {Object} options - 参数。
  8762. * @param {number} [options.red=255] - 获取或设置红色值。
  8763. * @param {number} [options.green=0] - 获取或设置绿色值。
  8764. * @param {number} [options.blue=0] - 获取或设置蓝色值。
  8765. */
  8766. var ServerColor = /*#__PURE__*/function () {
  8767. function ServerColor(red, green, blue) {
  8768. ServerColor_classCallCheck(this, ServerColor);
  8769. /**
  8770. * @member {number} [SuperMap.ServerColor.prototype.red=255]
  8771. * @description 获取或设置红色值。
  8772. */
  8773. this.red = !red && red != 0 ? 255 : red;
  8774. /**
  8775. * @member {number} [SuperMap.ServerColor.prototype.green=0]
  8776. * @description 获取或设置绿色值。
  8777. */
  8778. this.green = green || 0;
  8779. /**
  8780. * @member {number} [SuperMap.ServerColor.prototype.blue=0]
  8781. * @description 获取或设置蓝色值。
  8782. */
  8783. this.blue = blue || 0;
  8784. this.CLASS_NAME = "SuperMap.ServerColor";
  8785. }
  8786. /**
  8787. * @function SuperMap.ServerColor.prototype.destroy
  8788. * @description 释放资源,将引用资源的属性置空。
  8789. */
  8790. ServerColor_createClass(ServerColor, [{
  8791. key: "destroy",
  8792. value: function destroy() {
  8793. var me = this;
  8794. me.red = null;
  8795. me.green = null;
  8796. me.blue = null;
  8797. }
  8798. /**
  8799. * @function SuperMap.ServerColor.formJson
  8800. * @description 将 JSON 对象转化为 ServerColor 对象。
  8801. * @param {Object} jsonObject - 要转换的 JSON 对象。
  8802. * @returns {SuperMap.ServerColor} 转化后的 ServerColor 对象。
  8803. */
  8804. }], [{
  8805. key: "fromJson",
  8806. value: function fromJson(jsonObject) {
  8807. if (!jsonObject) {
  8808. return;
  8809. }
  8810. var color = new ServerColor();
  8811. var red = 255;
  8812. if (jsonObject.red !== null) {
  8813. red = Number(jsonObject.red);
  8814. }
  8815. color.red = red;
  8816. var green = 0;
  8817. if (jsonObject.green !== null) {
  8818. green = Number(jsonObject.green);
  8819. }
  8820. color.green = green;
  8821. var blue = 0;
  8822. if (jsonObject.blue !== null) {
  8823. blue = Number(jsonObject.blue);
  8824. }
  8825. color.blue = blue;
  8826. return color;
  8827. }
  8828. }]);
  8829. return ServerColor;
  8830. }();
  8831. SuperMap.ServerColor = ServerColor;
  8832. ;// CONCATENATED MODULE: ./src/common/iServer/ServerStyle.js
  8833. function ServerStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  8834. 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); } }
  8835. function ServerStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerStyle_defineProperties(Constructor, staticProps); return Constructor; }
  8836. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  8837. * This program are made available under the terms of the Apache License, Version 2.0
  8838. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  8839. /**
  8840. * @class SuperMap.ServerStyle
  8841. * @category iServer Map Theme
  8842. * @classdesc 服务端矢量要素风格类。
  8843. * @description 该类用于定义点状符号、线状符号、填充符号风格及其相关属性。
  8844. * @param {Object} options - 参数。
  8845. * @param {SuperMap.FillGradientMode} options.fillGradientMode - 渐变填充风格的渐变类型。
  8846. * @param {SuperMap.ServerColor} [options.fillBackColor=[255,255,255]] - 填充背景颜色。
  8847. * @param {boolean} [options.fillBackOpaque=false] - 背景是否不透明。
  8848. * @param {SuperMap.ServerColor} [options.fillForeColor=[255,0,0]] - 填充颜色。
  8849. * @param {number} [options.fillGradientAngle=0] - 渐变填充的旋转角度。
  8850. * @param {number} [options.fillGradientOffsetRatioX=0] - 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。
  8851. * @param {number} [options.fillGradientOffsetRatioY=0] - 填充中心点相对于填充区域范围中心点的垂直偏移百分比。
  8852. * @param {number} [options.fillOpaqueRate=100] - 填充不透明度。
  8853. * @param {number} [options.fillSymbolID=0] - 填充符号的编码。
  8854. * @param {SuperMap.ServerColor} [options.lineColor] - 矢量要素的边线颜色。默认 lineColor = new ServerColor(0, 0, 0)。
  8855. * @param {number} [options.lineSymbolID=0] - 线状符号的编码。
  8856. * @param {number} [options.lineWidth=1] - 边线的宽度。
  8857. * @param {number} [options.markerAngle=0] - 点状符号的旋转角度。
  8858. * @param {number} [options.markerSize=1] - 点状符号的大小。
  8859. * @param {number} [options.markerSymbolID=-1] - 点状符号的编码。
  8860. */
  8861. var ServerStyle = /*#__PURE__*/function () {
  8862. function ServerStyle(options) {
  8863. ServerStyle_classCallCheck(this, ServerStyle);
  8864. /**
  8865. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillBackColor
  8866. * @description 填充背景颜色。当填充模式为渐变填充时,该颜色为填充终止色。
  8867. */
  8868. this.fillBackColor = new ServerColor(255, 255, 255);
  8869. /**
  8870. * @member {boolean} [SuperMap.ServerStyle.prototype.fillBackOpaque=false]
  8871. * @description 背景是否不透明。false 表示透明。
  8872. */
  8873. this.fillBackOpaque = false;
  8874. /**
  8875. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.fillForeColor
  8876. * @description 填充颜色。当填充模式为渐变填充时,该颜色为填充起始颜色。
  8877. */
  8878. this.fillForeColor = new ServerColor(255, 0, 0);
  8879. /**
  8880. * @member {SuperMap.FillGradientMode} SuperMap.ServerStyle.prototype.fillGradientMode
  8881. * @description 渐变填充风格的渐变类型。
  8882. */
  8883. this.fillGradientMode = null;
  8884. /**
  8885. * @member {number} SuperMap.ServerStyle.prototype.fillGradientAngle -
  8886. * @description 渐变填充的旋转角度。单位为度,精确到 0.1 度,逆时针方向为正方向。
  8887. */
  8888. this.fillGradientAngle = 0;
  8889. /**
  8890. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioX
  8891. * @description 渐变填充中心点相对于填充区域范围中心点的水平偏移百分比。它们的关系如下:设填充区域范围中心点的坐标为(x0, y0),
  8892. * 填充中心点的坐标为(x, y),填充区域范围的宽度为 a,水平偏移百分比为 dx,则 x=x0 + a*dx/100。
  8893. */
  8894. this.fillGradientOffsetRatioX = 0;
  8895. /**
  8896. * @member {number} SuperMap.ServerStyle.prototype.fillGradientOffsetRatioY
  8897. * @description 填充中心点相对于填充区域范围中心点的垂直偏移百分比。它们的关系如下:<br>
  8898. * 设填充区域范围中心点的坐标为(x0, y0),填充中心点的坐标为(x, y),填充区域范围的高度为 b,垂直偏移百分比为 dy,则 y=y0 + b*dx/100。
  8899. */
  8900. this.fillGradientOffsetRatioY = 0;
  8901. /**
  8902. * @member {number} [SuperMap.ServerStyle.prototype.fillOpaqueRate=100]
  8903. * @description 填充不透明度。合法值为 0 - 100 的数值。其中为 0 表示完全透明;
  8904. * 100 表示完全不透明。赋值小于 0 时按照 0 处理,大于 100 时按照 100 处理。
  8905. */
  8906. this.fillOpaqueRate = 100;
  8907. /**
  8908. * @member {number} SuperMap.ServerStyle.prototype.fillSymbolID
  8909. * @description 填充符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  8910. * 关于填充符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  8911. */
  8912. this.fillSymbolID = 0;
  8913. /**
  8914. * @member {SuperMap.ServerColor} SuperMap.ServerStyle.prototype.lineColor
  8915. * @description 矢量要素的边线颜色。如果等级符号是点符号,点符号的颜色由 lineColor 控制。
  8916. */
  8917. this.lineColor = new ServerColor(0, 0, 0);
  8918. /**
  8919. * @member {number} [SuperMap.ServerStyle.prototype.lineSymbolID=0]
  8920. * @description 线状符号的编码。此编码用于唯一标识各普通填充风格的填充符号。
  8921. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  8922. */
  8923. this.lineSymbolID = 0;
  8924. /**
  8925. * @member {number} [SuperMap.ServerStyle.prototype.lineWidth=1.0]
  8926. * @description 边线的宽度。单位为毫米,精度到 0.1。
  8927. */
  8928. this.lineWidth = 1;
  8929. /**
  8930. * @member {number} [SuperMap.ServerStyle.prototype.markerAngle=0]
  8931. * @description 点状符号的旋转角度。以度为单位,精确到 0.1 度,逆时针方向为正方向。
  8932. */
  8933. this.markerAngle = 0;
  8934. /**
  8935. * @member {number} [SuperMap.ServerStyle.prototype.markerSize=1.0]
  8936. * @description 点状符号的大小。单位为毫米,精度为 0.1。当该属性设置为0时,采用符号默认大小 1.0 显示。
  8937. * 当该属性设置为非法值时,交由服务器默认处理。
  8938. */
  8939. this.markerSize = 1;
  8940. /**
  8941. * @member {number} [SuperMap.ServerStyle.prototype.markerSymbolID=-1]
  8942. * @description 点状符号的编码。此编码用于唯一标识各点状符号。
  8943. * 关于线状符号的样式与对应的 ID 号请在 SuperMap 桌面软件中查找。
  8944. */
  8945. this.markerSymbolID = -1;
  8946. if (options) {
  8947. Util.extend(this, options);
  8948. }
  8949. this.CLASS_NAME = "SuperMap.ServerStyle";
  8950. }
  8951. /**
  8952. * @function SuperMap.ServerStyle.prototype.destroy
  8953. * @description 释放资源,将引用资源的属性置空。
  8954. */
  8955. ServerStyle_createClass(ServerStyle, [{
  8956. key: "destroy",
  8957. value: function destroy() {
  8958. var me = this;
  8959. if (me.fillBackColor) {
  8960. me.fillBackColor.destroy();
  8961. me.fillBackColor = null;
  8962. }
  8963. me.fillBackOpaque = null;
  8964. if (me.fillForeColor) {
  8965. me.fillForeColor.destroy();
  8966. me.fillForeColor = null;
  8967. }
  8968. me.fillGradientMode = null;
  8969. me.fillGradientAngle = null;
  8970. me.fillGradientOffsetRatioX = null;
  8971. me.fillGradientOffsetRatioY = null;
  8972. me.fillOpaqueRate = null;
  8973. me.fillSymbolID = null;
  8974. if (me.lineColor) {
  8975. me.lineColor.destroy();
  8976. me.lineColor = null;
  8977. }
  8978. me.lineSymbolID = null;
  8979. me.lineWidth = null;
  8980. me.markerAngle = null;
  8981. me.markerSize = null;
  8982. me.markerSymbolID = null;
  8983. }
  8984. /**
  8985. * @function SuperMap.ServerStyle.prototype.toServerJSONObject
  8986. * @description 转换成对应的 JSON 格式对象。
  8987. * @returns {Object} 对应的 JSON 格式对象.
  8988. */
  8989. }, {
  8990. key: "toServerJSONObject",
  8991. value: function toServerJSONObject() {
  8992. var styleObj = {};
  8993. styleObj = Util.copyAttributes(styleObj, this); //暂时先忽略serverColor往Json的转换
  8994. return styleObj;
  8995. }
  8996. /**
  8997. * @function SuperMap.ServerStyle.fromJson
  8998. * @description 将JSON对象转换为 SuperMap.ServerStyle 对象。
  8999. * @param jsonObject - {Object} 要转换的 JSON 对象。
  9000. * @returns {SuperMap.ServerStyle} 转化后的 SuperMap.ServerStyle 对象。
  9001. */
  9002. }], [{
  9003. key: "fromJson",
  9004. value: function fromJson(jsonObject) {
  9005. if (!jsonObject) {
  9006. return;
  9007. }
  9008. return new ServerStyle({
  9009. fillBackColor: ServerColor.fromJson(jsonObject.fillBackColor),
  9010. fillBackOpaque: jsonObject.fillBackOpaque,
  9011. fillForeColor: ServerColor.fromJson(jsonObject.fillForeColor),
  9012. fillGradientMode: jsonObject.fillGradientMode,
  9013. fillGradientAngle: jsonObject.fillGradientAngle,
  9014. fillGradientOffsetRatioX: jsonObject.fillGradientOffsetRatioX,
  9015. fillGradientOffsetRatioY: jsonObject.fillGradientOffsetRatioY,
  9016. fillOpaqueRate: jsonObject.fillOpaqueRate,
  9017. fillSymbolID: jsonObject.fillSymbolID,
  9018. lineColor: ServerColor.fromJson(jsonObject.lineColor),
  9019. lineSymbolID: jsonObject.lineSymbolID,
  9020. lineWidth: jsonObject.lineWidth,
  9021. markerAngle: jsonObject.markerAngle,
  9022. markerSize: jsonObject.markerSize,
  9023. markerSymbolID: jsonObject.markerSymbolID
  9024. });
  9025. }
  9026. }]);
  9027. return ServerStyle;
  9028. }();
  9029. SuperMap.ServerStyle = ServerStyle;
  9030. ;// CONCATENATED MODULE: ./src/common/iServer/PointWithMeasure.js
  9031. function PointWithMeasure_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PointWithMeasure_typeof = function _typeof(obj) { return typeof obj; }; } else { PointWithMeasure_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PointWithMeasure_typeof(obj); }
  9032. function PointWithMeasure_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9033. 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); } }
  9034. function PointWithMeasure_createClass(Constructor, protoProps, staticProps) { if (protoProps) PointWithMeasure_defineProperties(Constructor.prototype, protoProps); if (staticProps) PointWithMeasure_defineProperties(Constructor, staticProps); return Constructor; }
  9035. 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 } }); if (superClass) PointWithMeasure_setPrototypeOf(subClass, superClass); }
  9036. function PointWithMeasure_setPrototypeOf(o, p) { PointWithMeasure_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PointWithMeasure_setPrototypeOf(o, p); }
  9037. 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); }; }
  9038. function PointWithMeasure_possibleConstructorReturn(self, call) { if (call && (PointWithMeasure_typeof(call) === "object" || typeof call === "function")) { return call; } return PointWithMeasure_assertThisInitialized(self); }
  9039. function PointWithMeasure_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9040. function PointWithMeasure_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9041. function PointWithMeasure_getPrototypeOf(o) { PointWithMeasure_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PointWithMeasure_getPrototypeOf(o); }
  9042. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9043. * This program are made available under the terms of the Apache License, Version 2.0
  9044. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9045. /**
  9046. * @class SuperMap.PointWithMeasure
  9047. * @category iServer SpatialAnalyst
  9048. * @classdesc 路由点类。路由点是指具有线性度量值 (Measure) 的二维地理坐标点。
  9049. * @param {Object} options - 参数。
  9050. * @param {number} options.measure - 度量值,即路由对象属性值 M。
  9051. * @param {number} options.x - 获取当前点对象在地理坐标系下的 X 坐标值。
  9052. * @param {number} options.y - 获取当前点对象在地理坐标系下的 Y 坐标值。
  9053. * @extends {SuperMap.Geometry.Point}
  9054. */
  9055. var PointWithMeasure = /*#__PURE__*/function (_Point) {
  9056. PointWithMeasure_inherits(PointWithMeasure, _Point);
  9057. var _super = PointWithMeasure_createSuper(PointWithMeasure);
  9058. function PointWithMeasure(options) {
  9059. var _this;
  9060. PointWithMeasure_classCallCheck(this, PointWithMeasure);
  9061. _this = _super.call(this, options);
  9062. /**
  9063. * @member {number} SuperMap.PointWithMeasure.prototype.measure
  9064. * @description 度量值,即路由对象属性值 M。
  9065. */
  9066. _this.measure = null;
  9067. if (options) {
  9068. Util.extend(PointWithMeasure_assertThisInitialized(_this), options);
  9069. }
  9070. _this.CLASS_NAME = "SuperMap.PointWithMeasure";
  9071. return _this;
  9072. }
  9073. /**
  9074. * @function SuperMap.PointWithMeasure.prototype.equals
  9075. * @description 判断两个路由点对象是否相等。如果两个路由点对象具有相同的坐标以及度量值,则认为是相等的。
  9076. * @param {SuperMap.PointWithMeasure} geom - 需要判断的路由点对象。
  9077. * @returns {boolean} 两个路由点对象是否相等(true 为相等,false 为不等)。
  9078. */
  9079. PointWithMeasure_createClass(PointWithMeasure, [{
  9080. key: "equals",
  9081. value: function equals(geom) {
  9082. var equals = false;
  9083. if (geom != null) {
  9084. var isValueEquals = this.x === geom.x && this.y === geom.y && this.measure === geom.measure;
  9085. var isNaNValue = isNaN(this.x) && isNaN(this.y) && isNaN(this.measure);
  9086. var isNaNGeometry = isNaN(geom.x) && isNaN(geom.y) && isNaN(geom.measure);
  9087. equals = isValueEquals || isNaNValue && isNaNGeometry;
  9088. }
  9089. return equals;
  9090. }
  9091. /**
  9092. * @function SuperMap.PointWithMeasure.prototype.toJson
  9093. * @description 转换为 JSON 对象。
  9094. * */
  9095. }, {
  9096. key: "toJson",
  9097. value: function toJson() {
  9098. var result = "{";
  9099. if (this.measure != null && this.measure != undefined) {
  9100. result += "\"measure\":" + this.measure + ",";
  9101. }
  9102. result += "\"x\":" + this.x + ",";
  9103. result += "\"y\":" + this.y;
  9104. result += "}";
  9105. return result;
  9106. }
  9107. /**
  9108. * @function SuperMap.PointWithMeasure.prototype.destroy
  9109. * @description 释放资源,将引用资源的属性置空。
  9110. */
  9111. }, {
  9112. key: "destroy",
  9113. value: function destroy() {
  9114. var me = this;
  9115. me.measure = null;
  9116. me.x = null;
  9117. me.y = null;
  9118. }
  9119. /**
  9120. * @function SuperMap.PointWithMeasure.fromJson
  9121. * @description 将 JSON 对象转换为{@link SuperMap.PointWithMeasure} 对象。
  9122. * @param {Object} jsonObject - JSON 对象表示的路由点。
  9123. * @returns {SuperMap.PointWithMeasure} 转化后的 PointWithMeasure 对象。
  9124. */
  9125. }], [{
  9126. key: "fromJson",
  9127. value: function fromJson(jsonObject) {
  9128. if (!jsonObject) {
  9129. return;
  9130. }
  9131. return new PointWithMeasure({
  9132. x: jsonObject.x,
  9133. y: jsonObject.y,
  9134. measure: jsonObject.measure
  9135. });
  9136. }
  9137. }]);
  9138. return PointWithMeasure;
  9139. }(Point);
  9140. SuperMap.PointWithMeasure = PointWithMeasure;
  9141. ;// CONCATENATED MODULE: ./src/common/iServer/Route.js
  9142. function Route_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Route_typeof = function _typeof(obj) { return typeof obj; }; } else { Route_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Route_typeof(obj); }
  9143. function Route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9144. 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); } }
  9145. function Route_createClass(Constructor, protoProps, staticProps) { if (protoProps) Route_defineProperties(Constructor.prototype, protoProps); if (staticProps) Route_defineProperties(Constructor, staticProps); return Constructor; }
  9146. 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 } }); if (superClass) Route_setPrototypeOf(subClass, superClass); }
  9147. function Route_setPrototypeOf(o, p) { Route_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Route_setPrototypeOf(o, p); }
  9148. 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); }; }
  9149. function Route_possibleConstructorReturn(self, call) { if (call && (Route_typeof(call) === "object" || typeof call === "function")) { return call; } return Route_assertThisInitialized(self); }
  9150. function Route_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9151. function Route_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9152. function Route_getPrototypeOf(o) { Route_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Route_getPrototypeOf(o); }
  9153. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9154. * This program are made available under the terms of the Apache License, Version 2.0
  9155. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9156. /**
  9157. * @class SuperMap.Route
  9158. * @category iServer SpatialAnalyst
  9159. * @classdesc 路由对象类。路由对象为一系列有序的带有属性值 M 的 x,y 坐标对,其中 M 值为该结点的距离属性(到已知点的距离)。
  9160. * @param {Array.<SuperMap.Geometry>} points - 形成路由对象的线数组。
  9161. * @param {Object} options - 参数。
  9162. * @param {number} options.id - 路由对象在数据库中的 id。
  9163. * @param {number} options.length - 路由对象的长度。单位与数据集的单位相同。
  9164. * @param {number} [options.maxM] - 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  9165. * @param {number} [options.minM] - 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  9166. * @param {string} [options.type] - 数据类型,如:"LINEM"。
  9167. * @extends {SuperMap.Geometry.Collection}
  9168. */
  9169. var Route = /*#__PURE__*/function (_Collection) {
  9170. Route_inherits(Route, _Collection);
  9171. var _super = Route_createSuper(Route);
  9172. function Route(points, options) {
  9173. var _this;
  9174. Route_classCallCheck(this, Route);
  9175. _this = _super.call(this, points, options);
  9176. /**
  9177. * @member {number} SuperMap.Route.prototype.id
  9178. * @description 路由对象在数据库中的 ID。
  9179. */
  9180. _this.id = null;
  9181. /**
  9182. * @member {number} SuperMap.Route.prototype.center
  9183. * @description 路由对象的中心点。
  9184. */
  9185. _this.center = null;
  9186. /**
  9187. * @member {string} SuperMap.Route.prototype.style
  9188. * @description 路由对象的样式。
  9189. */
  9190. _this.style = null;
  9191. /**
  9192. * @member {number} SuperMap.Route.prototype.length
  9193. * @description 路由对象的长度。单位与数据集的单位相同。
  9194. */
  9195. _this.length = null;
  9196. /**
  9197. * @member {number} SuperMap.Route.prototype.maxM
  9198. * @description 最大线性度量值,即所有结点到起始点的量算距离中最大值。
  9199. */
  9200. _this.maxM = null;
  9201. /**
  9202. * @member {number} SuperMap.Route.prototype.minM
  9203. * @description 最小线性度量值,即所有结点到起始点的量算距离中最小值。
  9204. */
  9205. _this.minM = null;
  9206. /**
  9207. * @member {Array.<number>} SuperMap.Route.prototype.parts
  9208. * @description 服务端几何对象中各个子对象所包含的节点个数。
  9209. */
  9210. _this.parts = null;
  9211. /**
  9212. * @member {Array.<Object>} SuperMap.Route.prototype.points
  9213. * @description 路由对象的所有路由点。
  9214. * @example
  9215. * (start code)
  9216. * [
  9217. * {
  9218. * "measure": 0,
  9219. * "y": -4377.027184298267,
  9220. * "x": 4020.0045221720466
  9221. * },
  9222. * {
  9223. * "measure": 37.33288381391519,
  9224. * "y": -4381.569363260499,
  9225. * "x": 4057.0600591960642
  9226. * }
  9227. * ]
  9228. * (end)
  9229. */
  9230. _this.points = null;
  9231. /**
  9232. * @member {string} SuperMap.Route.prototype.type
  9233. * @description 服务端几何对象类型。
  9234. */
  9235. _this.type = null;
  9236. /**
  9237. * @member {Array.<string>} [SuperMap.Route.prototype.componentTypes=SuperMap.Geometry.LineString]
  9238. * @description components 存储的的几何对象所支持的几何类型数组。
  9239. */
  9240. _this.componentTypes = ["SuperMap.Geometry.LinearRing", "SuperMap.Geometry.LineString"];
  9241. if (options) {
  9242. Util.extend(Route_assertThisInitialized(_this), options);
  9243. }
  9244. _this.CLASS_NAME = "SuperMap.Route";
  9245. _this.geometryType = "LINEM";
  9246. return _this;
  9247. }
  9248. /**
  9249. *
  9250. * @function SuperMap.Route.prototype.toJson
  9251. * @description 转换为 JSON 对象。
  9252. * @returns {Object} JSON 对象。
  9253. */
  9254. Route_createClass(Route, [{
  9255. key: "toJson",
  9256. value: function toJson() {
  9257. var result = "{";
  9258. if (this.id != null && this.id != undefined) {
  9259. result += "\"id\":" + this.id + ",";
  9260. }
  9261. if (this.center != null && this.center != undefined) {
  9262. result += "\"center\":" + this.center + ",";
  9263. }
  9264. if (this.style != null && this.style != undefined) {
  9265. result += "\"style\":" + this.style + ",";
  9266. }
  9267. if (this.length != null && this.length != undefined) {
  9268. result += "\"length\":" + this.length + ",";
  9269. }
  9270. if (this.maxM != null && this.maxM != undefined) {
  9271. result += "\"maxM\":" + this.maxM + ",";
  9272. }
  9273. if (this.minM != null && this.minM != undefined) {
  9274. result += "\"minM\":" + this.minM + ",";
  9275. }
  9276. if (this.type != null && this.type != undefined) {
  9277. result += "\"type\":\"" + this.type + "\",";
  9278. }
  9279. if (this.parts != null && this.parts != undefined) {
  9280. result += "\"parts\":[" + this.parts[0];
  9281. for (var i = 1; i < this.parts.length; i++) {
  9282. result += "," + this.parts[i];
  9283. }
  9284. result += "],";
  9285. }
  9286. if (this.components != null && this.components.length > 0) {
  9287. result += "\"points\":[";
  9288. for (var j = 0, len = this.components.length; j < len; j++) {
  9289. for (var k = 0, len2 = this.components[j].components.length; k < len2; k++) {
  9290. result += this.components[j].components[k].toJson() + ",";
  9291. }
  9292. }
  9293. result = result.replace(/,$/g, '');
  9294. result += "]";
  9295. }
  9296. result = result.replace(/,$/g, '');
  9297. result += "}";
  9298. return result;
  9299. }
  9300. /**
  9301. * @function SuperMap.Route.prototype.destroy
  9302. * @override
  9303. */
  9304. }, {
  9305. key: "destroy",
  9306. value: function destroy() {
  9307. var me = this;
  9308. me.id = null;
  9309. me.center = null;
  9310. me.style = null;
  9311. me.length = null;
  9312. me.maxM = null;
  9313. me.minM = null;
  9314. me.type = null;
  9315. me.parts = null;
  9316. me.components.length = 0;
  9317. me.components = null;
  9318. me.componentTypes = null;
  9319. }
  9320. /**
  9321. * @function SuperMap.Route.fromJson
  9322. * @description 将 JSON 对象转换为 SuperMap.Route 对象。
  9323. * @param {Object} [jsonObject] - JSON 对象表示的路由对象。
  9324. * @returns {SuperMap.Route} 转化后的 Route 对象。
  9325. */
  9326. }], [{
  9327. key: "fromJson",
  9328. value: function fromJson(jsonObject) {
  9329. if (!jsonObject) {
  9330. return;
  9331. }
  9332. var geoParts = jsonObject.parts || [],
  9333. geoPoints = jsonObject.points || [],
  9334. len = geoParts.length,
  9335. lineList = [];
  9336. if (len > 0) {
  9337. for (var i = 0, pointIndex = 0, pointList = []; i < len; i++) {
  9338. for (var j = 0; j < geoParts[i]; j++) {
  9339. pointList.push(PointWithMeasure.fromJson(geoPoints[pointIndex + j]));
  9340. }
  9341. pointIndex += geoParts[i]; //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  9342. if (pointList[0].equals(pointList[geoParts[i] - 1])) {
  9343. lineList.push(new LinearRing(pointList));
  9344. } else {
  9345. lineList.push(new LineString(pointList));
  9346. }
  9347. pointList = [];
  9348. }
  9349. } else {
  9350. return null;
  9351. }
  9352. return new Route(lineList, {
  9353. id: jsonObject.id,
  9354. center: jsonObject.center,
  9355. style: jsonObject.style,
  9356. length: jsonObject.length,
  9357. maxM: jsonObject.maxM,
  9358. minM: jsonObject.minM,
  9359. type: jsonObject.type,
  9360. parts: jsonObject.parts
  9361. });
  9362. }
  9363. }]);
  9364. return Route;
  9365. }(Collection);
  9366. SuperMap.Route = Route;
  9367. ;// CONCATENATED MODULE: ./src/common/iServer/ServerGeometry.js
  9368. function ServerGeometry_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9369. 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); } }
  9370. function ServerGeometry_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerGeometry_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerGeometry_defineProperties(Constructor, staticProps); return Constructor; }
  9371. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9372. * This program are made available under the terms of the Apache License, Version 2.0
  9373. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9374. /**
  9375. * @class SuperMap.ServerGeometry
  9376. * @category iServer
  9377. * @classdesc 服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。
  9378. * @param {Object} options - 参数。
  9379. * @param {string} options.id - 服务端几何对象唯一标识符。
  9380. * @param {Array.<number>} options.parts - 服务端几何对象中各个子对象所包含的节点个数。
  9381. * @param {Array.<SuperMap.Geometry.Point>} options.points - 组成几何对象的节点的坐标对数组。
  9382. * @param {SuperMap.GeometryType} options.type - 几何对象的类型。
  9383. * @param {SuperMap.ServerStyle} [options.style] - 服务端几何对象的风格。
  9384. */
  9385. var ServerGeometry = /*#__PURE__*/function () {
  9386. function ServerGeometry(options) {
  9387. ServerGeometry_classCallCheck(this, ServerGeometry);
  9388. /**
  9389. * @member {string} SuperMap.ServerGeometry.prototype.id
  9390. * @description 服务端几何对象唯一标识符。
  9391. */
  9392. this.id = 0;
  9393. /**
  9394. * @member {SuperMap.ServerStyle} [SuperMap.ServerGeometry.prototype.style]
  9395. * @description 服务端几何对象的风格(ServerStyle)。
  9396. */
  9397. this.style = null;
  9398. /**
  9399. * @member {Array.<number>} SuperMap.ServerGeometry.prototype.parts
  9400. * @description 服务端几何对象中各个子对象所包含的节点个数。<br>
  9401. * 1.几何对象从结构上可以分为简单几何对象和复杂几何对象。
  9402. * 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象,
  9403. * 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生,
  9404. * 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。<br>
  9405. * 2.通常情况,一个简单几何对象的子对象就是它本身,
  9406. * 因此对于简单对象来说的该字段为长度为1的整型数组,
  9407. * 该字段的值就是这个简单对象节点的个数。
  9408. * 如果一个几何对象是由几个简单对象组合而成的,
  9409. * 例如,一个岛状几何对象由 3 个简单的多边形组成而成,
  9410. * 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组,
  9411. * 数组中每个成员的值分别代表这三个多边形所包含的节点个数。
  9412. */
  9413. this.parts = null;
  9414. /**
  9415. * @member {Array.<SuperMap.Geometry.Point>} SuperMap.ServerGeometry.prototype.points
  9416. * @description 组成几何对象的节点的坐标对数组。<br>
  9417. * 1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的,
  9418. * 该字段存放了组成几何对象的点坐标的数组。
  9419. * 对于简单的面对象,他的起点和终点的坐标点相同。<br>
  9420. * 2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数,
  9421. * 从而确定 Points 字段中坐标对的分配归属问题。
  9422. */
  9423. this.points = null;
  9424. /**
  9425. * @member {SuperMap.GeometryType} SuperMap.ServerGeometry.prototype.type
  9426. * @description 几何对象的类型(GeometryType)。
  9427. */
  9428. this.type = null;
  9429. /**
  9430. * @member {Object} SuperMap.ServerGeometry.prototype.prjCoordSys
  9431. * @description 投影坐标参数,现仅在缓冲区分析中有效。
  9432. */
  9433. this.prjCoordSys = null;
  9434. if (options) {
  9435. Util.extend(this, options);
  9436. }
  9437. this.CLASS_NAME = 'SuperMap.ServerGeometry';
  9438. }
  9439. /**
  9440. * @function SuperMap.ServerGeometry.prototype.destroy
  9441. * @description 释放资源,将引用资源的属性置空。
  9442. */
  9443. ServerGeometry_createClass(ServerGeometry, [{
  9444. key: "destroy",
  9445. value: function destroy() {
  9446. var me = this;
  9447. me.id = null;
  9448. me.style = null;
  9449. me.parts = null;
  9450. me.partTopo = null;
  9451. me.points = null;
  9452. me.type = null;
  9453. me.prjCoordSys = null;
  9454. }
  9455. /**
  9456. * @function SuperMap.ServerGeometry.prototype.toGeometry
  9457. * @description 将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。
  9458. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9459. */
  9460. }, {
  9461. key: "toGeometry",
  9462. value: function toGeometry() {
  9463. var me = this,
  9464. geoType = me.type;
  9465. switch (geoType.toUpperCase()) {
  9466. case GeometryType.POINT:
  9467. return me.toGeoPoint();
  9468. case GeometryType.LINE:
  9469. return me.toGeoLine();
  9470. case GeometryType.LINEM:
  9471. return me.toGeoLinem();
  9472. case GeometryType.REGION:
  9473. return me.toGeoRegion();
  9474. case GeometryType.POINTEPS:
  9475. return me.toGeoPoint();
  9476. case GeometryType.LINEEPS:
  9477. return me.toGeoLineEPS();
  9478. case GeometryType.REGIONEPS:
  9479. return me.toGeoRegionEPS();
  9480. case GeometryType.GEOCOMPOUND:
  9481. return me.transformGeoCompound();
  9482. }
  9483. }
  9484. /**
  9485. * @function SuperMap.ServerGeometry.prototype.toGeoPoint
  9486. * @description 将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。
  9487. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9488. */
  9489. }, {
  9490. key: "toGeoPoint",
  9491. value: function toGeoPoint() {
  9492. var me = this,
  9493. geoParts = me.parts || [],
  9494. geoPoints = me.points || [],
  9495. len = geoParts.length;
  9496. if (len > 0) {
  9497. if (len === 1) {
  9498. return new Point(geoPoints[0].x, geoPoints[0].y);
  9499. } else {
  9500. var pointList = [];
  9501. for (var i = 0; i < len; i++) {
  9502. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  9503. }
  9504. return new MultiPoint(pointList);
  9505. }
  9506. } else {
  9507. return null;
  9508. }
  9509. }
  9510. /**
  9511. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  9512. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  9513. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9514. */
  9515. }, {
  9516. key: "toGeoLine",
  9517. value: function toGeoLine() {
  9518. var me = this,
  9519. geoParts = me.parts || [],
  9520. geoPoints = me.points || [],
  9521. len = geoParts.length;
  9522. if (len > 0) {
  9523. if (len === 1) {
  9524. var pointList = [];
  9525. for (var i = 0; i < geoParts[0]; i++) {
  9526. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  9527. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  9528. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  9529. return new LinearRing(pointList);
  9530. } else {
  9531. return new LineString(pointList);
  9532. }
  9533. } else {
  9534. var lineList = [];
  9535. for (var _i = 0; _i < len; _i++) {
  9536. var _pointList = [];
  9537. for (var j = 0; j < geoParts[_i]; j++) {
  9538. _pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  9539. }
  9540. lineList.push(new LineString(_pointList));
  9541. geoPoints.splice(0, geoParts[_i]);
  9542. }
  9543. return new MultiLineString(lineList);
  9544. }
  9545. } else {
  9546. return null;
  9547. }
  9548. }
  9549. /**
  9550. * @function SuperMap.ServerGeometry.prototype.toGeoLineEPS
  9551. * @description 将服务端的线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  9552. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9553. */
  9554. }, {
  9555. key: "toGeoLineEPS",
  9556. value: function toGeoLineEPS() {
  9557. var me = this,
  9558. geoParts = me.parts || [],
  9559. geoPoints = me.points || [],
  9560. i,
  9561. j,
  9562. pointList,
  9563. lineList,
  9564. lineEPS,
  9565. len = geoParts.length;
  9566. if (len > 0) {
  9567. if (len === 1) {
  9568. for (i = 0, pointList = []; i < geoParts[0]; i++) {
  9569. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y, geoPoints[i].type));
  9570. } //判断线是否闭合,如果闭合,则返回LinearRing,否则返回LineString
  9571. if (pointList[0].equals(pointList[geoParts[0] - 1])) {
  9572. lineEPS = LineString.createLineEPS(pointList);
  9573. return new LinearRing(lineEPS);
  9574. } else {
  9575. lineEPS = LineString.createLineEPS(pointList);
  9576. return new LineString(lineEPS);
  9577. }
  9578. } else {
  9579. for (i = 0, lineList = []; i < len; i++) {
  9580. for (j = 0, pointList = []; j < geoParts[i]; j++) {
  9581. pointList.push(new Point(geoPoints[j].x, geoPoints[j].y));
  9582. }
  9583. lineEPS = LineString.createLineEPS(pointList);
  9584. lineList.push(new LineString(lineEPS));
  9585. geoPoints.splice(0, geoParts[i]);
  9586. }
  9587. return new MultiLineString(lineList);
  9588. }
  9589. } else {
  9590. return null;
  9591. }
  9592. }
  9593. /**
  9594. * @function SuperMap.ServerGeometry.prototype.toGeoLine
  9595. * @description 将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。
  9596. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9597. */
  9598. }, {
  9599. key: "toGeoLinem",
  9600. value: function toGeoLinem() {
  9601. var me = this;
  9602. return Route.fromJson(me);
  9603. }
  9604. /**
  9605. * @function SuperMap.ServerGeometry.prototype.toGeoRegion
  9606. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  9607. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9608. */
  9609. }, {
  9610. key: "toGeoRegion",
  9611. value: function toGeoRegion() {
  9612. var me = this,
  9613. geoParts = me.parts || [],
  9614. geoTopo = me.partTopo || [],
  9615. geoPoints = me.points || [],
  9616. len = geoParts.length;
  9617. if (len <= 0) {
  9618. return null;
  9619. }
  9620. var polygonArray = [];
  9621. var pointList = [];
  9622. if (len == 1) {
  9623. for (var i = 0; i < geoPoints.length; i++) {
  9624. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  9625. }
  9626. polygonArray.push(new Polygon([new LinearRing(pointList)]));
  9627. return new MultiPolygon(polygonArray);
  9628. } //处理复杂面
  9629. var CCWArray = [];
  9630. var areaArray = [];
  9631. var polygonArrayTemp = [];
  9632. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  9633. var CCWIdent = [];
  9634. for (var _i2 = 0, pointIndex = 0; _i2 < len; _i2++) {
  9635. for (var j = 0; j < geoParts[_i2]; j++) {
  9636. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  9637. }
  9638. pointIndex += geoParts[_i2];
  9639. var polygon = new Polygon([new LinearRing(pointList)]);
  9640. pointList = [];
  9641. polygonArrayTemp.push(polygon);
  9642. if (geoTopo.length === 0) {
  9643. polygonBounds.push(polygon.getBounds());
  9644. }
  9645. CCWIdent.push(1);
  9646. areaArray.push(polygon.getArea());
  9647. } //根据面积排序
  9648. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  9649. if (geoTopo.length === 0) {
  9650. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  9651. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  9652. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  9653. //目标polygon索引列表 -1标示没有被任何polygon包含,
  9654. var targetArray = [];
  9655. for (var _i3 = 1; _i3 < polygonArrayTemp.length; _i3++) {
  9656. for (var _j = _i3 - 1; _j >= 0; _j--) {
  9657. targetArray[_i3] = -1;
  9658. if (polygonBounds[_j].containsBounds(polygonBounds[_i3])) {
  9659. CCWIdent[_i3] = CCWIdent[_j] * -1;
  9660. if (CCWIdent[_i3] < 0) {
  9661. targetArray[_i3] = _j;
  9662. }
  9663. break;
  9664. }
  9665. }
  9666. }
  9667. for (var _i4 = 0; _i4 < polygonArrayTemp.length; _i4++) {
  9668. if (CCWIdent[_i4] > 0) {
  9669. polygonArray.push(polygonArrayTemp[_i4]);
  9670. } else {
  9671. polygonArray[targetArray[_i4]].components = polygonArray[targetArray[_i4]].components.concat(polygonArrayTemp[_i4].components); //占位
  9672. polygonArray.push('');
  9673. }
  9674. }
  9675. } else {
  9676. //根据面积排序
  9677. //ServerGeometry.bubbleSort(areaArray, polygonArrayTemp,geoTopo);
  9678. polygonArray = new Array();
  9679. for (var _i5 = 0; _i5 < polygonArrayTemp.length; _i5++) {
  9680. if (geoTopo[_i5] && geoTopo[_i5] == -1) {
  9681. CCWArray = CCWArray.concat(polygonArrayTemp[_i5].components);
  9682. } else {
  9683. if (CCWArray.length > 0 && polygonArray.length > 0) {
  9684. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  9685. CCWArray = [];
  9686. }
  9687. polygonArray.push(polygonArrayTemp[_i5]);
  9688. }
  9689. if (_i5 == len - 1) {
  9690. var polyLength = polygonArray.length;
  9691. if (polyLength) {
  9692. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  9693. } else {
  9694. for (var k = 0, length = CCWArray.length; k < length; k++) {
  9695. polygonArray.push(new Polygon(CCWArray));
  9696. }
  9697. }
  9698. }
  9699. }
  9700. }
  9701. return new MultiPolygon(polygonArray);
  9702. }
  9703. /**
  9704. * @function SuperMap.ServerGeometry.prototype.toGeoRegionEPS
  9705. * @description 将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。
  9706. * @returns {SuperMap.Geometry} 转换后的客户端几何对象。
  9707. */
  9708. }, {
  9709. key: "toGeoRegionEPS",
  9710. value: function toGeoRegionEPS() {
  9711. var me = this,
  9712. geoParts = me.parts || [],
  9713. geoTopo = me.partTopo || [],
  9714. geoPoints = me.points || [],
  9715. len = geoParts.length;
  9716. if (len <= 0) {
  9717. return null;
  9718. }
  9719. var polygonArray = [];
  9720. var pointList = [];
  9721. var lineEPS;
  9722. if (len == 1) {
  9723. for (var i = 0; i < geoPoints.length; i++) {
  9724. pointList.push(new Point(geoPoints[i].x, geoPoints[i].y));
  9725. }
  9726. lineEPS = LineString.createLineEPS(pointList);
  9727. polygonArray.push(new Polygon([new LinearRing(lineEPS)]));
  9728. return new MultiPolygon(polygonArray);
  9729. } //处理复杂面
  9730. var CCWArray = [];
  9731. var areaArray = [];
  9732. var polygonArrayTemp = [];
  9733. var polygonBounds = []; //polyon岛洞标识数组,初始都是岛。
  9734. var CCWIdent = [];
  9735. for (var _i6 = 0, pointIndex = 0; _i6 < len; _i6++) {
  9736. for (var j = 0; j < geoParts[_i6]; j++) {
  9737. pointList.push(new Point(geoPoints[pointIndex + j].x, geoPoints[pointIndex + j].y));
  9738. }
  9739. pointIndex += geoParts[_i6];
  9740. lineEPS = LineString.createLineEPS(pointList);
  9741. var polygon = new Polygon([new LinearRing(lineEPS)]);
  9742. pointList = [];
  9743. polygonArrayTemp.push(polygon);
  9744. if (geoTopo.length === 0) {
  9745. polygonBounds.push(polygon.getBounds());
  9746. }
  9747. CCWIdent.push(1);
  9748. areaArray.push(polygon.getArea());
  9749. } //根据面积排序
  9750. ServerGeometry.bubbleSort(areaArray, polygonArrayTemp, geoTopo, polygonBounds); //iServer 9D新增字段
  9751. if (geoTopo.length === 0) {
  9752. //岛洞底层判断原则:将所有的子对象按照面积排序,面积最大的直接判定为岛(1),从面积次大的开始处理,
  9753. // 如果发现该对象在某个面积大于它的对象之中(即被包含),则根据包含它的对象的标识(1 or -1),指定其标识(-1 or 1),
  9754. // 依次处理完所有对象,就得到了一个标识数组,1表示岛,-1表示洞
  9755. //目标polygon索引列表 -1标示没有被任何polygon包含,
  9756. var targetArray = [];
  9757. for (var _i7 = 1; _i7 < polygonArrayTemp.length; _i7++) {
  9758. for (var _j2 = _i7 - 1; _j2 >= 0; _j2--) {
  9759. targetArray[_i7] = -1;
  9760. if (polygonBounds[_j2].containsBounds(polygonBounds[_i7])) {
  9761. CCWIdent[_i7] = CCWIdent[_j2] * -1;
  9762. if (CCWIdent[_i7] < 0) {
  9763. targetArray[_i7] = _j2;
  9764. }
  9765. break;
  9766. }
  9767. }
  9768. }
  9769. for (var _i8 = 0; _i8 < polygonArrayTemp.length; _i8++) {
  9770. if (CCWIdent[_i8] > 0) {
  9771. polygonArray.push(polygonArrayTemp[_i8]);
  9772. } else {
  9773. polygonArray[targetArray[_i8]].components = polygonArray[targetArray[_i8]].components.concat(polygonArrayTemp[_i8].components); //占位
  9774. polygonArray.push('');
  9775. }
  9776. }
  9777. } else {
  9778. //根据面积排序
  9779. polygonArray = new Array();
  9780. for (var _i9 = 0; _i9 < polygonArrayTemp.length; _i9++) {
  9781. if (geoTopo[_i9] && geoTopo[_i9] == -1) {
  9782. CCWArray = CCWArray.concat(polygonArrayTemp[_i9].components);
  9783. } else {
  9784. if (CCWArray.length > 0 && polygonArray.length > 0) {
  9785. polygonArray[polygonArray.length - 1].components = polygonArray[polygonArray.length - 1].components.concat(CCWArray);
  9786. CCWArray = [];
  9787. }
  9788. polygonArray.push(polygonArrayTemp[_i9]);
  9789. }
  9790. if (_i9 == len - 1) {
  9791. var polyLength = polygonArray.length;
  9792. if (polyLength) {
  9793. polygonArray[polyLength - 1].components = polygonArray[polyLength - 1].components.concat(CCWArray);
  9794. } else {
  9795. for (var k = 0, length = CCWArray.length; k < length; k++) {
  9796. polygonArray.push(new Polygon(CCWArray));
  9797. }
  9798. }
  9799. }
  9800. }
  9801. }
  9802. return new MultiPolygon(polygonArray);
  9803. }
  9804. }, {
  9805. key: "transformGeoCompound",
  9806. value: function transformGeoCompound() {
  9807. var me = this,
  9808. geoParts = me.geoParts || [],
  9809. len = geoParts.length;
  9810. if (len <= 0) {
  9811. return null;
  9812. }
  9813. var geometryList = [];
  9814. for (var index = 0; index < len; index++) {
  9815. var geometry = geoParts[index];
  9816. geometryList.push(new ServerGeometry(geometry).toGeometry());
  9817. }
  9818. return new Collection(geometryList);
  9819. }
  9820. /**
  9821. * @function SuperMap.ServerGeometry.prototype.fromJson
  9822. * @description 将 JSON 对象表示服务端几何对象转换为 ServerGeometry。
  9823. * @param {Object} jsonObject - 要转换的 JSON 对象。
  9824. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  9825. */
  9826. }], [{
  9827. key: "fromJson",
  9828. value: function fromJson(jsonObject) {
  9829. if (!jsonObject) {
  9830. return;
  9831. }
  9832. return new ServerGeometry({
  9833. id: jsonObject.id,
  9834. style: ServerStyle.fromJson(jsonObject.style),
  9835. parts: jsonObject.parts,
  9836. partTopo: jsonObject.partTopo,
  9837. points: jsonObject.points,
  9838. center: jsonObject.center,
  9839. length: jsonObject.length,
  9840. maxM: jsonObject.maxM,
  9841. minM: jsonObject.minM,
  9842. type: jsonObject.type
  9843. });
  9844. }
  9845. /**
  9846. * @function SuperMap.ServerGeometry.prototype.fromGeometry
  9847. * @description 将客户端 Geometry 转换成服务端 ServerGeometry。
  9848. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  9849. * @returns {SuperMap.ServerGeometry} 转换后的 ServerGeometry 对象。
  9850. */
  9851. }, {
  9852. key: "fromGeometry",
  9853. value: function fromGeometry(geometry) {
  9854. if (!geometry) {
  9855. return;
  9856. }
  9857. var id = 0,
  9858. parts = [],
  9859. points = [],
  9860. type = null,
  9861. icomponents = geometry.components,
  9862. className = geometry.CLASS_NAME,
  9863. prjCoordSys = {
  9864. epsgCode: geometry.SRID
  9865. };
  9866. if (!isNaN(geometry.id)) {
  9867. id = geometry.id;
  9868. } //坑爹的改法,没法,为了支持态势标绘,有时间就得全改
  9869. if (className != 'SuperMap.Geometry.LinearRing' && className != 'SuperMap.Geometry.LineString' && (geometry instanceof MultiPoint || geometry instanceof MultiLineString)) {
  9870. var ilen = icomponents.length;
  9871. for (var i = 0; i < ilen; i++) {
  9872. var partPointsCount = icomponents[i].getVertices().length;
  9873. parts.push(partPointsCount);
  9874. for (var j = 0; j < partPointsCount; j++) {
  9875. points.push(new Point(icomponents[i].getVertices()[j].x, icomponents[i].getVertices()[j].y));
  9876. }
  9877. } //这里className不是多点就全部是算线
  9878. type = className == 'SuperMap.Geometry.MultiPoint' ? GeometryType.POINT : GeometryType.LINE;
  9879. } else if (geometry instanceof MultiPolygon) {
  9880. var _ilen = icomponents.length;
  9881. for (var _i10 = 0; _i10 < _ilen; _i10++) {
  9882. var polygon = icomponents[_i10],
  9883. linearRingOfPolygon = polygon.components,
  9884. linearRingOfPolygonLen = linearRingOfPolygon.length;
  9885. for (var _j3 = 0; _j3 < linearRingOfPolygonLen; _j3++) {
  9886. var _partPointsCount = linearRingOfPolygon[_j3].getVertices().length + 1;
  9887. parts.push(_partPointsCount);
  9888. for (var k = 0; k < _partPointsCount - 1; k++) {
  9889. points.push(new Point(linearRingOfPolygon[_j3].getVertices()[k].x, linearRingOfPolygon[_j3].getVertices()[k].y));
  9890. }
  9891. points.push(new Point(linearRingOfPolygon[_j3].getVertices()[0].x, linearRingOfPolygon[_j3].getVertices()[0].y));
  9892. }
  9893. }
  9894. type = GeometryType.REGION;
  9895. } else if (geometry instanceof Polygon) {
  9896. var _ilen2 = icomponents.length;
  9897. for (var _i11 = 0; _i11 < _ilen2; _i11++) {
  9898. var _partPointsCount2 = icomponents[_i11].getVertices().length + 1;
  9899. parts.push(_partPointsCount2);
  9900. for (var _j4 = 0; _j4 < _partPointsCount2 - 1; _j4++) {
  9901. points.push(new Point(icomponents[_i11].getVertices()[_j4].x, icomponents[_i11].getVertices()[_j4].y));
  9902. }
  9903. points.push(new Point(icomponents[_i11].getVertices()[0].x, icomponents[_i11].getVertices()[0].y));
  9904. }
  9905. type = GeometryType.REGION;
  9906. } else {
  9907. var geometryVerticesCount = geometry.getVertices().length;
  9908. for (var _j5 = 0; _j5 < geometryVerticesCount; _j5++) {
  9909. points.push(new Point(geometry.getVertices()[_j5].x, geometry.getVertices()[_j5].y));
  9910. }
  9911. if (geometry instanceof LinearRing) {
  9912. points.push(new Point(geometry.getVertices()[0].x, geometry.getVertices()[0].y));
  9913. geometryVerticesCount++;
  9914. }
  9915. parts.push(geometryVerticesCount);
  9916. type = geometry instanceof Point ? GeometryType.POINT : GeometryType.LINE;
  9917. }
  9918. return new ServerGeometry({
  9919. id: id,
  9920. style: null,
  9921. parts: parts,
  9922. points: points,
  9923. type: type,
  9924. prjCoordSys: prjCoordSys
  9925. });
  9926. }
  9927. /**
  9928. * @function SuperMap.ServerGeometry.prototype.IsClockWise
  9929. * @description 判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。
  9930. * @param {SuperMap.Geometry} geometry - 要转换的客户端 Geometry 对象。
  9931. * @returns {number} 返回值大于 0,逆时针;小于 0,顺时针。
  9932. */
  9933. }, {
  9934. key: "IsClockWise",
  9935. value: function IsClockWise(points) {
  9936. var length = points.length;
  9937. if (length < 3) {
  9938. return 0.0;
  9939. }
  9940. var s = points[0].y * (points[length - 1].x - points[1].x);
  9941. points.push(points[0]);
  9942. for (var i = 1; i < length; i++) {
  9943. s += points[i].y * (points[i - 1].x - points[i + 1].x);
  9944. }
  9945. return s * 0.5;
  9946. }
  9947. }, {
  9948. key: "bubbleSort",
  9949. value: function bubbleSort(areaArray, pointList, geoTopo, polygonBounds) {
  9950. for (var i = 0; i < areaArray.length; i++) {
  9951. for (var j = 0; j < areaArray.length; j++) {
  9952. if (areaArray[i] > areaArray[j]) {
  9953. var d = areaArray[j];
  9954. areaArray[j] = areaArray[i];
  9955. areaArray[i] = d;
  9956. var b = pointList[j];
  9957. pointList[j] = pointList[i];
  9958. pointList[i] = b;
  9959. if (geoTopo && geoTopo.length > 0) {
  9960. var c = geoTopo[j];
  9961. geoTopo[j] = geoTopo[i];
  9962. geoTopo[i] = c;
  9963. }
  9964. if (polygonBounds && polygonBounds.length > 0) {
  9965. var f = polygonBounds[j];
  9966. polygonBounds[j] = polygonBounds[i];
  9967. polygonBounds[i] = f;
  9968. }
  9969. }
  9970. }
  9971. }
  9972. }
  9973. }]);
  9974. return ServerGeometry;
  9975. }();
  9976. SuperMap.ServerGeometry = ServerGeometry;
  9977. ;// CONCATENATED MODULE: ./src/common/format/GeoJSON.js
  9978. function GeoJSON_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoJSON_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoJSON_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoJSON_typeof(obj); }
  9979. function GeoJSON_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  9980. 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); } }
  9981. function GeoJSON_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoJSON_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoJSON_defineProperties(Constructor, staticProps); return Constructor; }
  9982. function GeoJSON_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoJSON_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeoJSON_get(target, property, receiver || target); }
  9983. function GeoJSON_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoJSON_getPrototypeOf(object); if (object === null) break; } return object; }
  9984. 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 } }); if (superClass) GeoJSON_setPrototypeOf(subClass, superClass); }
  9985. function GeoJSON_setPrototypeOf(o, p) { GeoJSON_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoJSON_setPrototypeOf(o, p); }
  9986. 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); }; }
  9987. function GeoJSON_possibleConstructorReturn(self, call) { if (call && (GeoJSON_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoJSON_assertThisInitialized(self); }
  9988. function GeoJSON_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  9989. function GeoJSON_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  9990. function GeoJSON_getPrototypeOf(o) { GeoJSON_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoJSON_getPrototypeOf(o); }
  9991. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  9992. * This program are made available under the terms of the Apache License, Version 2.0
  9993. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  9994. /**
  9995. * @class SuperMap.Format.GeoJSON
  9996. * @classdesc GeoJSON 的读和写。使用 {@link SuperMap.Format.GeoJSON} 构造器创建一个 GeoJSON 解析器。
  9997. * @category BaseTypes Format
  9998. * @param {Object} [options] - 参数。
  9999. * @param {string} [options.indent=" "] - 用于格式化输出,indent 字符串会在每次缩进的时候使用一次。
  10000. * @param {string} [options.space=" "] - 用于格式化输出,space 字符串会在名值对的 ":" 后边添加。
  10001. * @param {string} [options.newline="\n"] - 用于格式化输出, newline 字符串会用在每一个名值对或数组项末尾。
  10002. * @param {number} [options.level=0] - 用于格式化输出, 表示的是缩进级别。
  10003. * @param {boolean} [options.pretty=false] - 是否在序列化的时候使用额外的空格控制结构。在 write 方法中使用。
  10004. * @param {boolean} [options.nativeJSON] - 需要被注册的监听器对象。
  10005. * @param {boolean} [options.ignoreExtraDims=true] - 忽略维度超过 2 的几何要素。
  10006. * @extends {SuperMap.Format.JSON}
  10007. */
  10008. var GeoJSON = /*#__PURE__*/function (_JSONFormat) {
  10009. GeoJSON_inherits(GeoJSON, _JSONFormat);
  10010. var _super = GeoJSON_createSuper(GeoJSON);
  10011. function GeoJSON(options) {
  10012. var _this;
  10013. GeoJSON_classCallCheck(this, GeoJSON);
  10014. _this = _super.call(this, options);
  10015. /**
  10016. * @member {boolean} [SuperMap.Format.GeoJSON.prototype.ignoreExtraDims=true]
  10017. * @description 忽略维度超过 2 的几何要素。
  10018. */
  10019. _this.ignoreExtraDims = true;
  10020. _this.CLASS_NAME = "SuperMap.Format.GeoJSON";
  10021. /**
  10022. * @member {Object} SuperMap.Format.GeoJSON.prototype.parseCoords
  10023. * @private
  10024. * @description 一个属性名对应着 GeoJSON 对象的几何类型的对象。每个属性其实都是一个实际上做解析用的方法。
  10025. */
  10026. _this.parseCoords = {
  10027. /**
  10028. * @function SuperMap.Format.GeoJSON.parseCoords.point
  10029. * @description 将一组坐标转成一个 {@link SuperMap.Geometry} 对象。
  10030. * @param {Object} array - GeoJSON 片段中的一组坐标。
  10031. * @returns {SuperMap.Geometry} 一个几何对象。
  10032. */
  10033. "point": function point(array) {
  10034. if (this.ignoreExtraDims === false && array.length != 2) {
  10035. throw "Only 2D points are supported: " + array;
  10036. }
  10037. return new Point(array[0], array[1]);
  10038. },
  10039. /**
  10040. * @function SuperMap.Format.GeoJSON.parseCoords.multipoint
  10041. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10042. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10043. * @returns {SuperMap.Geometry} 一个几何对象。
  10044. */
  10045. "multipoint": function multipoint(array) {
  10046. var points = [];
  10047. var p = null;
  10048. for (var i = 0, len = array.length; i < len; ++i) {
  10049. try {
  10050. p = this.parseCoords["point"].apply(this, [array[i]]);
  10051. } catch (err) {
  10052. throw err;
  10053. }
  10054. points.push(p);
  10055. }
  10056. return new MultiPoint(points);
  10057. },
  10058. /**
  10059. * @function SuperMap.Format.GeoJSON.parseCoords.linestring
  10060. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10061. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10062. * @returns {SuperMap.Geometry} 一个几何对象。
  10063. */
  10064. "linestring": function linestring(array) {
  10065. var points = [];
  10066. var p = null;
  10067. for (var i = 0, len = array.length; i < len; ++i) {
  10068. try {
  10069. p = this.parseCoords["point"].apply(this, [array[i]]);
  10070. } catch (err) {
  10071. throw err;
  10072. }
  10073. points.push(p);
  10074. }
  10075. return new LineString(points);
  10076. },
  10077. /**
  10078. * @function SuperMap.Format.GeoJSON.parseCoords.multilinestring
  10079. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10080. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10081. * @returns {SuperMap.Geometry} 一个几何对象。
  10082. */
  10083. "multilinestring": function multilinestring(array) {
  10084. var lines = [];
  10085. var l = null;
  10086. for (var i = 0, len = array.length; i < len; ++i) {
  10087. try {
  10088. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  10089. } catch (err) {
  10090. throw err;
  10091. }
  10092. lines.push(l);
  10093. }
  10094. return new MultiLineString(lines);
  10095. },
  10096. /**
  10097. * @function SuperMap.Format.GeoJSON.parseCoords.polygon
  10098. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10099. * @returns {SuperMap.Geometry} 一个几何对象。
  10100. */
  10101. "polygon": function polygon(array) {
  10102. var rings = [];
  10103. var r, l;
  10104. for (var i = 0, len = array.length; i < len; ++i) {
  10105. try {
  10106. l = this.parseCoords["linestring"].apply(this, [array[i]]);
  10107. } catch (err) {
  10108. throw err;
  10109. }
  10110. r = new LinearRing(l.components);
  10111. rings.push(r);
  10112. }
  10113. return new Polygon(rings);
  10114. },
  10115. /**
  10116. * @function SuperMap.Format.GeoJSON.parseCoords.multipolygon
  10117. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10118. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10119. * @returns {SuperMap.Geometry} 一个几何对象。
  10120. */
  10121. "multipolygon": function multipolygon(array) {
  10122. var polys = [];
  10123. var p = null;
  10124. for (var i = 0, len = array.length; i < len; ++i) {
  10125. try {
  10126. p = this.parseCoords["polygon"].apply(this, [array[i]]);
  10127. } catch (err) {
  10128. throw err;
  10129. }
  10130. polys.push(p);
  10131. }
  10132. return new MultiPolygon(polys);
  10133. },
  10134. /**
  10135. * @function SuperMap.Format.GeoJSON.parseCoords.box
  10136. * @description 将坐标组数组转化成为一个 {@link SuperMap.Geometry} 对象。
  10137. * @param {Object} array - GeoJSON 片段中的坐标组数组。
  10138. * @returns {SuperMap.Geometry} 一个几何对象。
  10139. */
  10140. "box": function box(array) {
  10141. if (array.length != 2) {
  10142. throw "GeoJSON box coordinates must have 2 elements";
  10143. }
  10144. return new Polygon([new 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])])]);
  10145. }
  10146. };
  10147. /**
  10148. * @member {Object} SuperMap.Format.GeoJSON.prototype.extract
  10149. * @private
  10150. * @description 一个属性名对应着GeoJSON类型的对象。其值为相应的实际的解析方法。
  10151. */
  10152. _this.extract = {
  10153. /**
  10154. * @function SuperMap.Format.GeoJSON.extract.feature
  10155. * @description 返回一个表示单个要素对象的 GeoJSON 的一部分。
  10156. * @param {SuperMap.ServerFeature} feature - iServer 要素对象。
  10157. * @returns {Object} 一个表示点的对象。
  10158. */
  10159. 'feature': function feature(_feature) {
  10160. var geom = this.extract.geometry.apply(this, [_feature.geometry]);
  10161. var json = {
  10162. "type": "Feature",
  10163. "properties": this.createAttributes(_feature),
  10164. "geometry": geom
  10165. };
  10166. if (_feature.geometry && _feature.geometry.type === 'TEXT') {
  10167. json.properties.texts = _feature.geometry.texts;
  10168. json.properties.textStyle = _feature.geometry.textStyle;
  10169. }
  10170. if (_feature.fid) {
  10171. json.id = _feature.fid;
  10172. }
  10173. if (_feature.ID) {
  10174. json.id = _feature.ID;
  10175. }
  10176. return json;
  10177. },
  10178. /**
  10179. * @function SuperMap.Format.GeoJSON.extract.geometry
  10180. * @description 返回一个表示单个几何对象的 GeoJSON 的一部分。
  10181. * @param {Object} geometry - iServer 几何对象。
  10182. * @returns {Object} 一个表示几何体的对象。
  10183. */
  10184. 'geometry': function geometry(_geometry) {
  10185. if (_geometry == null) {
  10186. return null;
  10187. }
  10188. if (!_geometry.parts && _geometry.points) {
  10189. _geometry.parts = [_geometry.points.length];
  10190. }
  10191. var geo = _geometry.hasOwnProperty('geometryType') ? _geometry : new ServerGeometry(_geometry).toGeometry() || _geometry;
  10192. var geometryType = geo.geometryType || geo.type;
  10193. var data;
  10194. if (geometryType === "LinearRing") {
  10195. geometryType = "LineString";
  10196. }
  10197. if (geometryType === "LINEM") {
  10198. geometryType = "MultiLineString";
  10199. }
  10200. data = this.extract[geometryType.toLowerCase()].apply(this, [geo]);
  10201. geometryType = geometryType === 'TEXT' ? 'Point' : geometryType;
  10202. var json;
  10203. if (geometryType === "Collection") {
  10204. json = {
  10205. "type": "GeometryCollection",
  10206. "geometries": data
  10207. };
  10208. } else {
  10209. json = {
  10210. "type": geometryType,
  10211. "coordinates": data
  10212. };
  10213. }
  10214. return json;
  10215. },
  10216. /**
  10217. * @function SuperMap.Format.GeoJSON.extract.point
  10218. * @description 从一个点对象中返回一个坐标组。
  10219. * @param {SuperMap.Geometry.Point} point - 一个点对象。
  10220. * @returns {Array} 一个表示一个点的坐标组。
  10221. */
  10222. 'point': function point(_point) {
  10223. var p = [_point.x, _point.y];
  10224. for (var name in _point) {
  10225. if (name !== "x" && name !== "y" && _point[name] !== null && !isNaN(_point[name])) {
  10226. p.push(_point[name]);
  10227. }
  10228. }
  10229. return p;
  10230. },
  10231. /**
  10232. * @function SuperMap.Format.GeoJSON.extract.point
  10233. * @description 从一个文本对象中返回一个坐标组。
  10234. * @param {Object} geo - 一个文本对象。
  10235. * @returns {Array} 一个表示一个点的坐标组。
  10236. */
  10237. 'text': function text(geo) {
  10238. return [geo.points[0].x, geo.points[0].y];
  10239. },
  10240. /**
  10241. * @function SuperMap.Format.GeoJSON.extract.multipoint
  10242. * @description 从一个多点对象中返一个坐标组数组。
  10243. * @param {SuperMap.Geometry.MultiPoint} multipoint - 多点对象。
  10244. * @returns {Array} 一个表示多点的坐标组数组。
  10245. */
  10246. 'multipoint': function multipoint(_multipoint) {
  10247. var array = [];
  10248. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  10249. array.push(this.extract.point.apply(this, [_multipoint.components[i]]));
  10250. }
  10251. return array;
  10252. },
  10253. /**
  10254. * @function SuperMap.Format.GeoJSON.extract.linestring
  10255. * @description 从一个线对象中返回一个坐标组数组。
  10256. * @param {SuperMap.Geometry.Linestring} linestring - 线对象。
  10257. * @returns {Array} 一个表示线对象的坐标组数组。
  10258. */
  10259. 'linestring': function linestring(_linestring) {
  10260. var array = [];
  10261. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  10262. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  10263. }
  10264. return array;
  10265. },
  10266. /**
  10267. * @function SuperMap.Format.GeoJSON.extract.multilinestring
  10268. * @description 从一个多线对象中返回一个线数组。
  10269. * @param {SuperMap.Geometry.MultiLinestring} multilinestring - 多线对象。
  10270. *
  10271. * @returns {Array} 一个表示多线的线数组。
  10272. */
  10273. 'multilinestring': function multilinestring(_multilinestring) {
  10274. var array = [];
  10275. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  10276. array.push(this.extract.linestring.apply(this, [_multilinestring.components[i]]));
  10277. }
  10278. return array;
  10279. },
  10280. /**
  10281. * @function SuperMap.Format.GeoJSON.extract.polygon
  10282. * @description 从一个面对象中返回一组线环。
  10283. * @param {SuperMap.Geometry.Polygon} polygon - 面对象。
  10284. * @returns {Array} 一组表示面的线环。
  10285. */
  10286. 'polygon': function polygon(_polygon) {
  10287. var array = [];
  10288. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  10289. array.push(this.extract.linestring.apply(this, [_polygon.components[i]]));
  10290. }
  10291. return array;
  10292. },
  10293. /**
  10294. * @function SuperMap.Format.GeoJSON.extract.multipolygon
  10295. * @description 从一个多面对象中返回一组面。
  10296. * @param {SuperMap.Geometry.MultiPolygon} multipolygon - 多面对象。
  10297. * @returns {Array} 一组表示多面的面。
  10298. */
  10299. 'multipolygon': function multipolygon(_multipolygon) {
  10300. var array = [];
  10301. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  10302. array.push(this.extract.polygon.apply(this, [_multipolygon.components[i]]));
  10303. }
  10304. return array;
  10305. },
  10306. /**
  10307. * @function SuperMap.Format.GeoJSON.extract.collection
  10308. * @description 从一个几何要素集合中一组几何要素数组。
  10309. * @param {SuperMap.Geometry.Collection} collection - 几何要素集合。
  10310. * @returns {Array} 一组表示几何要素集合的几何要素数组。
  10311. */
  10312. 'collection': function collection(_collection) {
  10313. var len = _collection.components.length;
  10314. var array = new Array(len);
  10315. for (var i = 0; i < len; ++i) {
  10316. array[i] = this.extract.geometry.apply(this, [_collection.components[i]]);
  10317. }
  10318. return array;
  10319. }
  10320. };
  10321. return _this;
  10322. }
  10323. /**
  10324. * @function SuperMap.Format.GeoJSON.prototype.read
  10325. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为 SuperMap Feature 对象。
  10326. * @param {GeoJSONObject} json - GeoJSON 对象。
  10327. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  10328. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  10329. * @returns {Object} 返回值依赖于 type 参数的值。
  10330. * -如果 type 等于 "FeatureCollection",返回值将会是 {@link SuperMap.Feature.Vector} 数组。
  10331. * -如果 type 为 "Geometry",输入的 JSON 对象必须表示一个唯一的几何体,然后返回值就会是 {@link SuperMap.Feature.Geometry}。
  10332. * -如果 type 为 "Feature",输入的 JSON 对象也必须表示的一个要素,这样返回值才会是 {@link SuperMap.Feature.Vector}。
  10333. */
  10334. GeoJSON_createClass(GeoJSON, [{
  10335. key: "read",
  10336. value: function read(json, type, filter) {
  10337. type = type ? type : "FeatureCollection";
  10338. var results = null;
  10339. var obj = null;
  10340. if (typeof json == "string") {
  10341. obj = GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "read", this).call(this, json, filter);
  10342. } else {
  10343. obj = json;
  10344. }
  10345. if (!obj) {//SuperMap.Console.error("Bad JSON: " + json);
  10346. } else if (typeof obj.type != "string") {//SuperMap.Console.error("Bad GeoJSON - no type: " + json);
  10347. } else if (this.isValidType(obj, type)) {
  10348. switch (type) {
  10349. case "Geometry":
  10350. try {
  10351. results = this.parseGeometry(obj);
  10352. } catch (err) {//SuperMap.Console.error(err);
  10353. }
  10354. break;
  10355. case "Feature":
  10356. try {
  10357. results = this.parseFeature(obj);
  10358. results.type = "Feature";
  10359. } catch (err) {//SuperMap.Console.error(err);
  10360. }
  10361. break;
  10362. case "FeatureCollection":
  10363. // for type FeatureCollection, we allow input to be any type
  10364. results = [];
  10365. switch (obj.type) {
  10366. case "Feature":
  10367. try {
  10368. results.push(this.parseFeature(obj));
  10369. } catch (err) {
  10370. results = null; //SuperMap.Console.error(err);
  10371. }
  10372. break;
  10373. case "FeatureCollection":
  10374. for (var i = 0, len = obj.features.length; i < len; ++i) {
  10375. try {
  10376. results.push(this.parseFeature(obj.features[i]));
  10377. } catch (err) {
  10378. results = null; // SuperMap.Console.error(err);
  10379. }
  10380. }
  10381. break;
  10382. default:
  10383. try {
  10384. var geom = this.parseGeometry(obj);
  10385. results.push(new Vector(geom));
  10386. } catch (err) {
  10387. results = null; //SuperMap.Console.error(err);
  10388. }
  10389. }
  10390. break;
  10391. default:
  10392. break;
  10393. }
  10394. }
  10395. return results;
  10396. }
  10397. /**
  10398. * @function SuperMap.Format.GeoJSON.prototype.write
  10399. * @description iServer Geometry JSON 对象 转 GeoJSON对象字符串。
  10400. * @param {Object} obj - iServer Geometry JSON 对象。
  10401. * @param {boolean} [pretty=false] - 是否使用换行和缩进来控制输出。
  10402. * @returns {GeoJSONObject} 一个 GeoJSON 字符串,它表示了输入的几何对象,要素对象,或者要素对象数组。
  10403. */
  10404. }, {
  10405. key: "write",
  10406. value: function write(obj, pretty) {
  10407. return GeoJSON_get(GeoJSON_getPrototypeOf(GeoJSON.prototype), "write", this).call(this, this.toGeoJSON(obj), pretty);
  10408. }
  10409. /**
  10410. * @function SuperMap.Format.GeoJSON.prototype.fromGeoJSON
  10411. * @version 9.1.1
  10412. * @description 将 GeoJSON 对象或者GeoJSON 对象字符串转换为iServer Feature JSON。
  10413. * @param {GeoJSONObject} json - GeoJSON 对象。
  10414. * @param {string} [type='FeaureCollection'] - 可选的字符串,它决定了输出的格式。支持的值有:"Geometry","Feature",和 "FeatureCollection",如果此值为null。
  10415. * @param {Function} filter - 对象中每个层次每个键值对都会调用此函数得出一个结果。每个值都会被 filter 函数的结果所替换掉。这个函数可被用来将某些对象转化成某个类相应的对象,或者将日期字符串转化成Date对象。
  10416. * @returns {Object} iServer Feature JSON。
  10417. */
  10418. }, {
  10419. key: "fromGeoJSON",
  10420. value: function fromGeoJSON(json, type, filter) {
  10421. var _this2 = this;
  10422. var feature = this.read(json, type, filter);
  10423. if (!Util.isArray(feature)) {
  10424. return this._toiSevrerFeature(feature);
  10425. }
  10426. return feature.map(function (element) {
  10427. return _this2._toiSevrerFeature(element);
  10428. });
  10429. }
  10430. /**
  10431. * @function SuperMap.Format.GeoJSON.prototype.toGeoJSON
  10432. * @version 9.1.1
  10433. * @description 将 iServer Feature JSON 对象转换为 GeoJSON 对象。
  10434. * @param {Object} obj - iServer Feature JSON。
  10435. * @returns {GeoJSONObject} GeoJSON 对象。
  10436. */
  10437. }, {
  10438. key: "toGeoJSON",
  10439. value: function toGeoJSON(obj) {
  10440. var geojson = {
  10441. "type": null
  10442. };
  10443. if (Util.isArray(obj)) {
  10444. geojson.type = "FeatureCollection";
  10445. var numFeatures = obj.length;
  10446. geojson.features = new Array(numFeatures);
  10447. for (var i = 0; i < numFeatures; ++i) {
  10448. var element = obj[i];
  10449. if (isGeometry(element)) {
  10450. var feature = {};
  10451. feature.geometry = element;
  10452. geojson.features[i] = this.extract.feature.apply(this, [feature]);
  10453. } else {
  10454. geojson.features[i] = this.extract.feature.apply(this, [element]);
  10455. }
  10456. }
  10457. } else if (isGeometry(obj)) {
  10458. var _feature2 = {};
  10459. _feature2.geometry = obj;
  10460. geojson = this.extract.feature.apply(this, [_feature2]);
  10461. } else {
  10462. geojson = this.extract.feature.apply(this, [obj]);
  10463. }
  10464. function isGeometry(input) {
  10465. return input.hasOwnProperty("parts") && input.hasOwnProperty("points") || input.hasOwnProperty("geoParts");
  10466. }
  10467. return geojson;
  10468. }
  10469. /**
  10470. * @function SuperMap.Format.GeoJSON.prototype.isValidType
  10471. * @description 检查一个 GeoJSON 对象是否和给定的类型相符的合法的对象。
  10472. * @returns {boolean} GeoJSON 是否是给定类型的合法对象。
  10473. * @private
  10474. */
  10475. }, {
  10476. key: "isValidType",
  10477. value: function isValidType(obj, type) {
  10478. var valid = false;
  10479. switch (type) {
  10480. case "Geometry":
  10481. if (Util.indexOf(["Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "Box", "GeometryCollection"], obj.type) == -1) {// unsupported geometry type
  10482. //SuperMap.Console.error("Unsupported geometry type: " +
  10483. // obj.type);
  10484. } else {
  10485. valid = true;
  10486. }
  10487. break;
  10488. case "FeatureCollection":
  10489. // allow for any type to be converted to a feature collection
  10490. valid = true;
  10491. break;
  10492. default:
  10493. // for Feature types must match
  10494. if (obj.type == type) {
  10495. valid = true;
  10496. } else {//SuperMap.Console.error("Cannot convert types from " +
  10497. //obj.type + " to " + type);
  10498. }
  10499. }
  10500. return valid;
  10501. }
  10502. /**
  10503. * @function SuperMap.Format.GeoJSON.prototype.parseFeature
  10504. * @description 将一个 GeoJSON 中的 feature 转化成 {@link SuperMap.Feature.Vector}> 对象。
  10505. * @private
  10506. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  10507. * @returns {SuperMap.Feature.Vector} 一个要素。
  10508. */
  10509. }, {
  10510. key: "parseFeature",
  10511. value: function parseFeature(obj) {
  10512. var feature, geometry, attributes, bbox;
  10513. attributes = obj.properties ? obj.properties : {};
  10514. bbox = obj.geometry && obj.geometry.bbox || obj.bbox;
  10515. try {
  10516. geometry = this.parseGeometry(obj.geometry);
  10517. } catch (err) {
  10518. // deal with bad geometries
  10519. throw err;
  10520. }
  10521. feature = new Vector(geometry, attributes);
  10522. if (bbox) {
  10523. feature.bounds = Bounds.fromArray(bbox);
  10524. }
  10525. if (obj.id) {
  10526. feature.fid = obj.id;
  10527. }
  10528. return feature;
  10529. }
  10530. /**
  10531. * @function SuperMap.Format.GeoJSON.prototype.parseGeometry
  10532. * @description 将一个 GeoJSON 中的几何要素转化成 {@link SuperMap.Geometry} 对象。
  10533. * @param {GeoJSONObject} obj - 从 GeoJSON 对象中创建一个对象。
  10534. * @returns {SuperMap.Geometry} 一个几何要素。
  10535. * @private
  10536. */
  10537. }, {
  10538. key: "parseGeometry",
  10539. value: function parseGeometry(obj) {
  10540. if (obj == null) {
  10541. return null;
  10542. }
  10543. var geometry;
  10544. if (obj.type == "GeometryCollection") {
  10545. if (!Util.isArray(obj.geometries)) {
  10546. throw "GeometryCollection must have geometries array: " + obj;
  10547. }
  10548. var numGeom = obj.geometries.length;
  10549. var components = new Array(numGeom);
  10550. for (var i = 0; i < numGeom; ++i) {
  10551. components[i] = this.parseGeometry.apply(this, [obj.geometries[i]]);
  10552. }
  10553. geometry = new Collection(components);
  10554. } else {
  10555. if (!Util.isArray(obj.coordinates)) {
  10556. throw "Geometry must have coordinates array: " + obj;
  10557. }
  10558. if (!this.parseCoords[obj.type.toLowerCase()]) {
  10559. throw "Unsupported geometry type: " + obj.type;
  10560. }
  10561. try {
  10562. geometry = this.parseCoords[obj.type.toLowerCase()].apply(this, [obj.coordinates]);
  10563. } catch (err) {
  10564. // deal with bad coordinates
  10565. throw err;
  10566. }
  10567. }
  10568. return geometry;
  10569. }
  10570. /**
  10571. * @function SuperMap.Format.GeoJSON.prototype.createCRSObject
  10572. * @description 从一个要素对象中创建一个坐标参考系对象。
  10573. * @param {SuperMap.Feature.Vector} object - 要素对象。
  10574. * @private
  10575. * @returns {GeoJSONObject} 一个可作为 GeoJSON 对象的 CRS 属性使用的对象。
  10576. */
  10577. }, {
  10578. key: "createCRSObject",
  10579. value: function createCRSObject(object) {
  10580. var proj = object.layer.projection.toString();
  10581. var crs = {};
  10582. if (proj.match(/epsg:/i)) {
  10583. var code = parseInt(proj.substring(proj.indexOf(":") + 1));
  10584. if (code == 4326) {
  10585. crs = {
  10586. "type": "name",
  10587. "properties": {
  10588. "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
  10589. }
  10590. };
  10591. } else {
  10592. crs = {
  10593. "type": "name",
  10594. "properties": {
  10595. "name": "EPSG:" + code
  10596. }
  10597. };
  10598. }
  10599. }
  10600. return crs;
  10601. }
  10602. }, {
  10603. key: "_toiSevrerFeature",
  10604. value: function _toiSevrerFeature(feature) {
  10605. var attributes = feature.attributes;
  10606. var attrNames = [];
  10607. var attrValues = [];
  10608. for (var attr in attributes) {
  10609. attrNames.push(attr);
  10610. attrValues.push(attributes[attr]);
  10611. }
  10612. var newFeature = {
  10613. fieldNames: attrNames,
  10614. fieldValues: attrValues,
  10615. geometry: ServerGeometry.fromGeometry(feature.geometry)
  10616. };
  10617. newFeature.geometry.id = feature.fid;
  10618. return newFeature;
  10619. }
  10620. }, {
  10621. key: "createAttributes",
  10622. value: function createAttributes(feature) {
  10623. if (!feature) {
  10624. return null;
  10625. }
  10626. var attr = {};
  10627. processFieldsAttributes(feature, attr);
  10628. var exceptKeys = ["fieldNames", "fieldValues", "geometry", "stringID", "ID"];
  10629. for (var key in feature) {
  10630. if (exceptKeys.indexOf(key) > -1) {
  10631. continue;
  10632. }
  10633. attr[key] = feature[key];
  10634. }
  10635. function processFieldsAttributes(feature, attributes) {
  10636. if (!(feature.hasOwnProperty("fieldNames") && feature.hasOwnProperty("fieldValues"))) {
  10637. return;
  10638. }
  10639. var names = feature.fieldNames,
  10640. values = feature.fieldValues;
  10641. for (var i in names) {
  10642. attributes[names[i]] = values[i];
  10643. }
  10644. }
  10645. return attr;
  10646. }
  10647. }]);
  10648. return GeoJSON;
  10649. }(JSONFormat);
  10650. SuperMap.Format.GeoJSON = GeoJSON;
  10651. ;// CONCATENATED MODULE: ./src/common/format/WKT.js
  10652. function WKT_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WKT_typeof = function _typeof(obj) { return typeof obj; }; } else { WKT_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WKT_typeof(obj); }
  10653. function WKT_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10654. 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); } }
  10655. function WKT_createClass(Constructor, protoProps, staticProps) { if (protoProps) WKT_defineProperties(Constructor.prototype, protoProps); if (staticProps) WKT_defineProperties(Constructor, staticProps); return Constructor; }
  10656. 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 } }); if (superClass) WKT_setPrototypeOf(subClass, superClass); }
  10657. function WKT_setPrototypeOf(o, p) { WKT_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WKT_setPrototypeOf(o, p); }
  10658. 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); }; }
  10659. function WKT_possibleConstructorReturn(self, call) { if (call && (WKT_typeof(call) === "object" || typeof call === "function")) { return call; } return WKT_assertThisInitialized(self); }
  10660. function WKT_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  10661. function WKT_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  10662. function WKT_getPrototypeOf(o) { WKT_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WKT_getPrototypeOf(o); }
  10663. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10664. * This program are made available under the terms of the Apache License, Version 2.0
  10665. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10666. /**
  10667. * @class SuperMap.Format.WKT
  10668. * @classdesc 用于读写常见文本的类。通过 {@link SuperMap.Format.WKT} 构造器来创建一个新的实例。
  10669. * @category BaseTypes Format
  10670. * @extends {SuperMap.Format}
  10671. * @param {Object} options - 可选的选项对象,其属性将被设置到实例。option 具体配置项继承自 {@link SuperMap.Format}。
  10672. */
  10673. var WKT = /*#__PURE__*/function (_Format) {
  10674. WKT_inherits(WKT, _Format);
  10675. var _super = WKT_createSuper(WKT);
  10676. function WKT(options) {
  10677. var _this;
  10678. WKT_classCallCheck(this, WKT);
  10679. _this = _super.call(this, options);
  10680. _this.regExes = {
  10681. 'typeStr': /^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,
  10682. 'spaces': /\s+/,
  10683. 'parenComma': /\)\s*,\s*\(/,
  10684. 'doubleParenComma': /\)\s*\)\s*,\s*\(\s*\(/,
  10685. // can't use {2} here
  10686. 'trimParens': /^\s*\(?(.*?)\)?\s*$/
  10687. };
  10688. _this.CLASS_NAME = "SuperMap.Format.WKT";
  10689. /**
  10690. * @private
  10691. * @description Object with properties corresponding to the geometry types.
  10692. * Property values are functions that do the actual data extraction.
  10693. */
  10694. _this.extract = {
  10695. /**
  10696. * @description Return a space delimited string of point coordinates.
  10697. * @param {SuperMap.Geometry.Point} point
  10698. * @returns {string} A string of coordinates representing the point
  10699. */
  10700. 'point': function point(_point) {
  10701. return _point.x + ' ' + _point.y;
  10702. },
  10703. /**
  10704. * @description Return a comma delimited string of point coordinates from a multipoint.
  10705. * @param {SuperMap.Geometry.MultiPoint} multipoint
  10706. * @returns {string} A string of point coordinate strings representing
  10707. * the multipoint
  10708. */
  10709. 'multipoint': function multipoint(_multipoint) {
  10710. var array = [];
  10711. for (var i = 0, len = _multipoint.components.length; i < len; ++i) {
  10712. array.push('(' + this.extract.point.apply(this, [_multipoint.components[i]]) + ')');
  10713. }
  10714. return array.join(',');
  10715. },
  10716. /**
  10717. * @description Return a comma delimited string of point coordinates from a line.
  10718. * @param {SuperMap.Geometry.LineString} linestring
  10719. * @returns {string} A string of point coordinate strings representing
  10720. * the linestring
  10721. */
  10722. 'linestring': function linestring(_linestring) {
  10723. var array = [];
  10724. for (var i = 0, len = _linestring.components.length; i < len; ++i) {
  10725. array.push(this.extract.point.apply(this, [_linestring.components[i]]));
  10726. }
  10727. return array.join(',');
  10728. },
  10729. /**
  10730. * @description Return a comma delimited string of linestring strings from a multilinestring.
  10731. * @param {SuperMap.Geometry.MultiLineString} multilinestring
  10732. * @returns {string} A string of of linestring strings representing
  10733. * the multilinestring
  10734. */
  10735. 'multilinestring': function multilinestring(_multilinestring) {
  10736. var array = [];
  10737. for (var i = 0, len = _multilinestring.components.length; i < len; ++i) {
  10738. array.push('(' + this.extract.linestring.apply(this, [_multilinestring.components[i]]) + ')');
  10739. }
  10740. return array.join(',');
  10741. },
  10742. /**
  10743. * @description Return a comma delimited string of linear ring arrays from a polygon.
  10744. * @param {SuperMap.Geometry.Polygon} polygon
  10745. * @returns {string} An array of linear ring arrays representing the polygon
  10746. */
  10747. 'polygon': function polygon(_polygon) {
  10748. var array = [];
  10749. for (var i = 0, len = _polygon.components.length; i < len; ++i) {
  10750. array.push('(' + this.extract.linestring.apply(this, [_polygon.components[i]]) + ')');
  10751. }
  10752. return array.join(',');
  10753. },
  10754. /**
  10755. * @description Return an array of polygon arrays from a multipolygon.
  10756. * @param {SuperMap.Geometry.MultiPolygon} multipolygon
  10757. * @returns {string} An array of polygon arrays representing
  10758. * the multipolygon
  10759. */
  10760. 'multipolygon': function multipolygon(_multipolygon) {
  10761. var array = [];
  10762. for (var i = 0, len = _multipolygon.components.length; i < len; ++i) {
  10763. array.push('(' + this.extract.polygon.apply(this, [_multipolygon.components[i]]) + ')');
  10764. }
  10765. return array.join(',');
  10766. },
  10767. /**
  10768. * @description Return the WKT portion between 'GEOMETRYCOLLECTION(' and ')' for an <SuperMap.Geometry.Collection>
  10769. * @param {SuperMap.Geometry.Collection} collection
  10770. * @returns {string} internal WKT representation of the collection
  10771. */
  10772. 'collection': function collection(_collection) {
  10773. var array = [];
  10774. for (var i = 0, len = _collection.components.length; i < len; ++i) {
  10775. array.push(this.extractGeometry.apply(this, [_collection.components[i]]));
  10776. }
  10777. return array.join(',');
  10778. }
  10779. };
  10780. /**
  10781. * @private
  10782. * @description Object with properties corresponding to the geometry types.
  10783. * Property values are functions that do the actual parsing.
  10784. */
  10785. _this.parse = {
  10786. /**
  10787. * @private
  10788. * @description Return point feature given a point WKT fragment.
  10789. * @param {string} str A WKT fragment representing the point
  10790. * @returns {SuperMap.Feature.Vector} A point feature
  10791. *
  10792. */
  10793. 'point': function point(str) {
  10794. var coords = StringExt.trim(str).split(this.regExes.spaces);
  10795. return new Vector(new Point(coords[0], coords[1]));
  10796. },
  10797. /**
  10798. * @description Return a multipoint feature given a multipoint WKT fragment.
  10799. * @param {string} A WKT fragment representing the multipoint
  10800. * @returns {SuperMap.Feature.Vector} A multipoint feature
  10801. * @private
  10802. */
  10803. 'multipoint': function multipoint(str) {
  10804. var point;
  10805. var points = StringExt.trim(str).split(',');
  10806. var components = [];
  10807. for (var i = 0, len = points.length; i < len; ++i) {
  10808. point = points[i].replace(this.regExes.trimParens, '$1');
  10809. components.push(this.parse.point.apply(this, [point]).geometry);
  10810. }
  10811. return new Vector(new MultiPoint(components));
  10812. },
  10813. /**
  10814. * @description Return a linestring feature given a linestring WKT fragment.
  10815. * @param {string} A WKT fragment representing the linestring
  10816. * @returns {SuperMap.Feature.Vector} A linestring feature
  10817. * @private
  10818. */
  10819. 'linestring': function linestring(str) {
  10820. var points = StringExt.trim(str).split(',');
  10821. var components = [];
  10822. for (var i = 0, len = points.length; i < len; ++i) {
  10823. components.push(this.parse.point.apply(this, [points[i]]).geometry);
  10824. }
  10825. return new Vector(new LineString(components));
  10826. },
  10827. /**
  10828. * @description Return a multilinestring feature given a multilinestring WKT fragment.
  10829. * @param {string} A WKT fragment representing the multilinestring
  10830. * @returns {SuperMap.Feature.Vector} A multilinestring feature
  10831. * @private
  10832. */
  10833. 'multilinestring': function multilinestring(str) {
  10834. var line;
  10835. var lines = StringExt.trim(str).split(this.regExes.parenComma);
  10836. var components = [];
  10837. for (var i = 0, len = lines.length; i < len; ++i) {
  10838. line = lines[i].replace(this.regExes.trimParens, '$1');
  10839. components.push(this.parse.linestring.apply(this, [line]).geometry);
  10840. }
  10841. return new Vector(new MultiLineString(components));
  10842. },
  10843. /**
  10844. * @description Return a polygon feature given a polygon WKT fragment.
  10845. * @param {string} A WKT fragment representing the polygon
  10846. * @returns {SuperMap.Feature.Vector} A polygon feature
  10847. * @private
  10848. */
  10849. 'polygon': function polygon(str) {
  10850. var ring, linestring, linearring;
  10851. var rings = StringExt.trim(str).split(this.regExes.parenComma);
  10852. var components = [];
  10853. for (var i = 0, len = rings.length; i < len; ++i) {
  10854. ring = rings[i].replace(this.regExes.trimParens, '$1');
  10855. linestring = this.parse.linestring.apply(this, [ring]).geometry;
  10856. linearring = new LinearRing(linestring.components);
  10857. components.push(linearring);
  10858. }
  10859. return new Vector(new Polygon(components));
  10860. },
  10861. /**
  10862. * @private
  10863. * @description Return a multipolygon feature given a multipolygon WKT fragment.
  10864. * @param {string} A WKT fragment representing the multipolygon
  10865. * @returns {SuperMap.Feature.Vector} A multipolygon feature
  10866. *
  10867. */
  10868. 'multipolygon': function multipolygon(str) {
  10869. var polygon;
  10870. var polygons = StringExt.trim(str).split(this.regExes.doubleParenComma);
  10871. var components = [];
  10872. for (var i = 0, len = polygons.length; i < len; ++i) {
  10873. polygon = polygons[i].replace(this.regExes.trimParens, '$1');
  10874. components.push(this.parse.polygon.apply(this, [polygon]).geometry);
  10875. }
  10876. return new Vector(new MultiPolygon(components));
  10877. },
  10878. /**
  10879. * @description Return an array of features given a geometrycollection WKT fragment.
  10880. * @param {string} A WKT fragment representing the geometrycollection
  10881. * @returns {Array} An array of SuperMap.Feature.Vector
  10882. * @private
  10883. */
  10884. 'geometrycollection': function geometrycollection(str) {
  10885. // separate components of the collection with |
  10886. str = str.replace(/,\s*([A-Za-z])/g, '|$1');
  10887. var wktArray = StringExt.trim(str).split('|');
  10888. var components = [];
  10889. for (var i = 0, len = wktArray.length; i < len; ++i) {
  10890. components.push(this.read(wktArray[i]));
  10891. }
  10892. return components;
  10893. }
  10894. };
  10895. return _this;
  10896. }
  10897. /**
  10898. * @function SuperMap.Format.WKT.prototype.read
  10899. * @description Deserialize a WKT string and return a vector feature or an
  10900. * array of vector features. Supports WKT for POINT, MULTIPOINT,
  10901. * LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
  10902. * GEOMETRYCOLLECTION.
  10903. * @param {string} wkt - A WKT string
  10904. * @returns {SuperMap.Feature.Vector|Array} A feature or array of features for
  10905. * GEOMETRYCOLLECTION WKT.
  10906. */
  10907. WKT_createClass(WKT, [{
  10908. key: "read",
  10909. value: function read(wkt) {
  10910. var features, type, str;
  10911. wkt = wkt.replace(/[\n\r]/g, " ");
  10912. var matches = this.regExes.typeStr.exec(wkt);
  10913. if (matches) {
  10914. type = matches[1].toLowerCase();
  10915. str = matches[2];
  10916. if (this.parse[type]) {
  10917. features = this.parse[type].apply(this, [str]);
  10918. }
  10919. }
  10920. return features;
  10921. }
  10922. /**
  10923. * @function SuperMap.Format.WKT.prototype.write
  10924. * @description Serialize a feature or array of features into a WKT string.
  10925. * @param {(SuperMap.Feature.Vector|Array)} features - A feature or array of features
  10926. * @returns {string} The WKT string representation of the input geometries
  10927. */
  10928. }, {
  10929. key: "write",
  10930. value: function write(features) {
  10931. var collection, geometry, isCollection;
  10932. if (features.constructor === Array) {
  10933. collection = features;
  10934. isCollection = true;
  10935. } else {
  10936. collection = [features];
  10937. isCollection = false;
  10938. }
  10939. var pieces = [];
  10940. if (isCollection) {
  10941. pieces.push('GEOMETRYCOLLECTION(');
  10942. }
  10943. for (var i = 0, len = collection.length; i < len; ++i) {
  10944. if (isCollection && i > 0) {
  10945. pieces.push(',');
  10946. }
  10947. geometry = collection[i].geometry;
  10948. pieces.push(this.extractGeometry(geometry));
  10949. }
  10950. if (isCollection) {
  10951. pieces.push(')');
  10952. }
  10953. return pieces.join('');
  10954. }
  10955. /**
  10956. * @function SuperMap.Format.WKT.prototype.extractGeometry
  10957. * @description Entry point to construct the WKT for a single Geometry object.
  10958. * @param {SuperMap.Geometry} geometry
  10959. * @returns {string} A WKT string of representing the geometry
  10960. */
  10961. }, {
  10962. key: "extractGeometry",
  10963. value: function extractGeometry(geometry) {
  10964. var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  10965. if (!this.extract[type]) {
  10966. return null;
  10967. }
  10968. var wktType = type === 'collection' ? 'GEOMETRYCOLLECTION' : type.toUpperCase();
  10969. var data = wktType + '(' + this.extract[type].apply(this, [geometry]) + ')';
  10970. return data;
  10971. }
  10972. }]);
  10973. return WKT;
  10974. }(Format);
  10975. SuperMap.Format.WKT = WKT;
  10976. ;// CONCATENATED MODULE: ./src/common/format/index.js
  10977. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10978. * This program are made available under the terms of the Apache License, Version 2.0
  10979. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10980. ;// CONCATENATED MODULE: ./src/common/control/TimeControlBase.js
  10981. function TimeControlBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10982. 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); } }
  10983. function TimeControlBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeControlBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeControlBase_defineProperties(Constructor, staticProps); return Constructor; }
  10984. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  10985. * This program are made available under the terms of the Apache License, Version 2.0
  10986. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  10987. /**
  10988. * @class SuperMap.TimeControlBase
  10989. * @classdesc 时间控制基类类。
  10990. * @category Control
  10991. * @param {Object} options - 该类开放的可选属性。
  10992. * @param {number} [options.speed=1] - 速度。不能小于 0,(每帧渲染的数据之间的间隔为1),设置越大速度越快。
  10993. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms),服务器刷新的时间间隔。
  10994. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  10995. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时以当前时间进行设置,建议设置。
  10996. * @param {boolean} [options.repeat=true] - 是否重复循环。
  10997. * @param {boolean} [options.reverse=false] - 是否反向。
  10998. */
  10999. var TimeControlBase = /*#__PURE__*/function () {
  11000. function TimeControlBase(options) {
  11001. TimeControlBase_classCallCheck(this, TimeControlBase);
  11002. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  11003. var me = this;
  11004. options = options || {};
  11005. /**
  11006. * @member {number} [SuperMap.TimeControlBase.prototype.speed=1]
  11007. * @description 步长,必须为非负数,默认为1(表示前后两次渲染的数据之间的间隔为1)
  11008. */
  11009. this.speed = options.speed && options.speed >= 0 ? options.speed : 1;
  11010. /**
  11011. * @member {number} [SuperMap.TimeControlBase.prototype.frequency=1000]
  11012. * @description 刷新频率(单位ms),服务器刷新的时间间隔。
  11013. */
  11014. this.frequency = options.speed && options.frequency >= 0 ? options.frequency : 1000;
  11015. /**
  11016. * @member {number} [SuperMap.TimeControlBase.prototype.startTime=0]
  11017. * @description 记录的起始时间,必须为数字,
  11018. * 如果不设置,初始化时为0,建议设置
  11019. */
  11020. this.startTime = options.startTime && options.startTime != null ? options.startTime : 0;
  11021. /**
  11022. * @member {number} SuperMap.TimeControlBase.prototype.endTime
  11023. * @description 记录的结束时间,必须为数字,
  11024. * 如果不设置,初始化时以当前时间进行设置,建议设置
  11025. */
  11026. this.endTime = options.endTime && options.endTime != null && options.endTime >= me.startTime ? options.endTime : +new Date();
  11027. /**
  11028. * @member {boolean} [SuperMap.TimeControlBase.prototype.repeat=true]
  11029. * @description 是否重复循环。
  11030. */
  11031. this.repeat = options.repeat !== undefined ? options.repeat : true;
  11032. /**
  11033. * @member {boolean} [SuperMap.TimeControlBase.prototype.reverse=false]
  11034. * @description 是否反向。
  11035. */
  11036. this.reverse = options.reverse !== undefined ? options.reverse : false;
  11037. /**
  11038. * @member {number} SuperMap.TimeControlBase.prototype.currentTime
  11039. * @description 记录近期的时间,也就是当前帧运行到的时间。
  11040. */
  11041. this.currentTime = null;
  11042. /**
  11043. * @member {number} SuperMap.TimeControlBase.prototype.oldTime
  11044. * @description 记录上一帧的时间,也就是之前运行到的时间。
  11045. */
  11046. this.oldTime = null;
  11047. /**
  11048. * @member {boolean} [SuperMap.TimeControlBase.prototype.running=false]
  11049. * @description 记录当前是否处于运行中。
  11050. */
  11051. this.running = false;
  11052. /**
  11053. * @private
  11054. * @member {Array.<string>} SuperMap.TimeControlBase.prototype.EVENT_TYPES
  11055. * @description 此类支持的事件类型。
  11056. *
  11057. */
  11058. this.EVENT_TYPES = ["start", "pause", "stop"];
  11059. /**
  11060. * @private
  11061. * @member {SuperMap.Events} SuperMap.TimeControlBase.prototype.events
  11062. * @description 事件
  11063. */
  11064. me.events = new Events(this, null, this.EVENT_TYPES);
  11065. me.speed = Number(me.speed);
  11066. me.frequency = Number(me.frequency);
  11067. me.startTime = Number(me.startTime);
  11068. me.endTime = Number(me.endTime);
  11069. me.startTime = Date.parse(new Date(me.startTime));
  11070. me.endTime = Date.parse(new Date(me.endTime)); //初始化当前时间
  11071. me.currentTime = me.startTime;
  11072. this.CLASS_NAME = "SuperMap.TimeControlBase";
  11073. }
  11074. /**
  11075. * @function SuperMap.TimeControlBase.prototype.updateOptions
  11076. * @param {Object} options - 设置参数得可选参数。设置步长,刷新频率、开始结束时间、是否循环、是否反向。
  11077. */
  11078. TimeControlBase_createClass(TimeControlBase, [{
  11079. key: "updateOptions",
  11080. value: function updateOptions(options) {
  11081. //设置步长,刷新频率、开始结束时间、是否循环、是否反向
  11082. var me = this;
  11083. options = options || {};
  11084. if (options.speed && options.speed >= 0) {
  11085. me.speed = options.speed;
  11086. me.speed = Number(me.speed);
  11087. }
  11088. if (options.speed && options.frequency >= 0) {
  11089. me.frequency = options.frequency;
  11090. me.frequency = Number(me.frequency);
  11091. }
  11092. if (options.startTime && options.startTime != null) {
  11093. me.startTime = options.startTime;
  11094. me.startTime = Date.parse(new Date(me.startTime));
  11095. }
  11096. if (options.endTime && options.endTime != null && options.endTime >= me.startTime) {
  11097. me.endTime = options.endTime;
  11098. me.endTime = Date.parse(new Date(me.endTime));
  11099. }
  11100. if (options.repeat != null) {
  11101. me.repeat = options.repeat;
  11102. }
  11103. if (options.reverse != null) {
  11104. me.reverse = options.reverse;
  11105. }
  11106. }
  11107. /**
  11108. * @function SuperMap.TimeControlBase.prototype.start
  11109. * @description 开始。
  11110. */
  11111. }, {
  11112. key: "start",
  11113. value: function start() {
  11114. var me = this;
  11115. if (!me.running) {
  11116. me.running = true;
  11117. me.tick();
  11118. me.events.triggerEvent('start', me.currentTime);
  11119. }
  11120. }
  11121. /**
  11122. * @function SuperMap.TimeControlBase.prototype.pause
  11123. * @description 暂停。
  11124. */
  11125. }, {
  11126. key: "pause",
  11127. value: function pause() {
  11128. var me = this;
  11129. me.running = false;
  11130. me.events.triggerEvent('pause', me.currentTime);
  11131. }
  11132. /**
  11133. * @function SuperMap.TimeControlBase.prototype.stop
  11134. * @description 停止,停止后返回起始状态。
  11135. */
  11136. }, {
  11137. key: "stop",
  11138. value: function stop() {
  11139. var me = this; //停止时 时间设置为开始时间
  11140. me.currentTime = me.startTime; //如果正在运行,修改为初始时间即可绘制一帧
  11141. if (me.running) {
  11142. me.running = false;
  11143. }
  11144. me.events.triggerEvent('stop', me.currentTime);
  11145. }
  11146. /**
  11147. * @function SuperMap.TimeControlBase.prototype.toggle
  11148. * @description 开关切换,切换的是开始和暂停。
  11149. */
  11150. }, {
  11151. key: "toggle",
  11152. value: function toggle() {
  11153. var me = this;
  11154. if (me.running) {
  11155. me.pause();
  11156. } else {
  11157. me.start();
  11158. }
  11159. }
  11160. /**
  11161. * @function SuperMap.TimeControlBase.prototype.setSpeed
  11162. * @description 设置步长。
  11163. * @param {number} [speed=1] - 步长,必须为非负数。
  11164. * @returns {boolean} true 代表设置成功,false 设置失败(speed 小于 0 时失败)。
  11165. */
  11166. }, {
  11167. key: "setSpeed",
  11168. value: function setSpeed(speed) {
  11169. var me = this;
  11170. if (speed >= 0) {
  11171. me.speed = speed;
  11172. return true;
  11173. }
  11174. return false;
  11175. }
  11176. /**
  11177. * @function SuperMap.TimeControlBase.prototype.getSpeed
  11178. * @description 获取步长。
  11179. * @returns {number} 返回当前的步长
  11180. */
  11181. }, {
  11182. key: "getSpeed",
  11183. value: function getSpeed() {
  11184. return this.speed;
  11185. }
  11186. /**
  11187. * @function SuperMap.TimeControlBase.prototype.setFrequency
  11188. * @description 设置刷新频率。
  11189. * @param {number} [frequency=1000] - 刷新频率,单位为 ms。
  11190. * @returns {boolean} true 代表设置成功,false 设置失败(frequency 小于 0 时失败)。
  11191. */
  11192. }, {
  11193. key: "setFrequency",
  11194. value: function setFrequency(frequency) {
  11195. var me = this;
  11196. if (frequency >= 0) {
  11197. me.frequency = frequency;
  11198. return true;
  11199. }
  11200. return false;
  11201. }
  11202. /**
  11203. * @function SuperMap.TimeControlBase.prototype.getFrequency
  11204. * @description 获取刷新频率。
  11205. * @returns {number} 返回当前的刷新频率。
  11206. */
  11207. }, {
  11208. key: "getFrequency",
  11209. value: function getFrequency() {
  11210. return this.frequency;
  11211. }
  11212. /**
  11213. * @function SuperMap.TimeControlBase.prototype.setStartTime
  11214. * @description 设置起始时间,设置完成后如果当前时间小于起始时间,则从起始时间开始。
  11215. * @param {number} startTime - 需要设置的起始时间。
  11216. * @returns {boolean} true 代表设置成功,false 设置失败(startTime 大于结束时间时失败)。
  11217. */
  11218. }, {
  11219. key: "setStartTime",
  11220. value: function setStartTime(startTime) {
  11221. var me = this;
  11222. startTime = Date.parse(new Date(startTime)); //起始时间不得大于结束时间
  11223. if (startTime > me.endTime) {
  11224. return false;
  11225. }
  11226. me.startTime = startTime; //如果当前时间小于了起始时间,则从当前起始时间开始
  11227. if (me.currentTime < me.startTime) {
  11228. me.currentTime = me.startTime;
  11229. me.tick();
  11230. }
  11231. return true;
  11232. }
  11233. /**
  11234. * @function SuperMap.TimeControlBase.prototype.getStartTime
  11235. * @description 获取起始时间。
  11236. * @returns {number} 返回当前的起始时间。
  11237. */
  11238. }, {
  11239. key: "getStartTime",
  11240. value: function getStartTime() {
  11241. return this.startTime;
  11242. }
  11243. /**
  11244. * @function SuperMap.TimeControlBase.prototype.setEndTime
  11245. * @description 设置结束时间,设置完成后如果当前时间大于结束,则从起始时间开始。
  11246. * @param {number} endTime - 需要设置的结束时间。
  11247. * @returns {boolean} true 代表设置成功,false 设置失败(endTime 小于开始时间时失败)。
  11248. */
  11249. }, {
  11250. key: "setEndTime",
  11251. value: function setEndTime(endTime) {
  11252. var me = this;
  11253. me.endTime = Date.parse(new Date(me.endTime)); //结束时间不得小于开始时间
  11254. if (endTime < me.startTime) {
  11255. return false;
  11256. }
  11257. me.endTime = endTime; //如果当前时间大于了结束时间,则从起始时间开始
  11258. if (me.currentTime >= me.endTime) {
  11259. me.currentTime = me.startTime;
  11260. me.tick();
  11261. }
  11262. return true;
  11263. }
  11264. /**
  11265. * @function SuperMap.TimeControlBase.prototype.getEndTime
  11266. * @description 获取结束时间。
  11267. * @returns {number} 返回当前的结束时间。
  11268. */
  11269. }, {
  11270. key: "getEndTime",
  11271. value: function getEndTime() {
  11272. return this.endTime;
  11273. }
  11274. /**
  11275. * @function SuperMap.TimeControlBase.prototype.setCurrentTime
  11276. * @description 设置当前时间。
  11277. * @param {number} currentTime - 需要设置的当前时间。
  11278. * @returns {boolean} true 代表设置成功,false 设置失败。
  11279. */
  11280. }, {
  11281. key: "setCurrentTime",
  11282. value: function setCurrentTime(currentTime) {
  11283. var me = this;
  11284. me.currentTime = Date.parse(new Date(me.currentTime)); //结束时间不得小于开始时间
  11285. if (currentTime >= me.startTime && currentTime <= me.endTime) {
  11286. me.currentTime = currentTime;
  11287. me.startTime = me.currentTime;
  11288. me.tick();
  11289. return true;
  11290. }
  11291. return false;
  11292. }
  11293. /**
  11294. * @function SuperMap.TimeControlBase.prototype.getCurrentTime
  11295. * @description 获取当前时间。
  11296. * @returns {number} 返回当前时间。
  11297. */
  11298. }, {
  11299. key: "getCurrentTime",
  11300. value: function getCurrentTime() {
  11301. return this.currentTime;
  11302. }
  11303. /**
  11304. * @function SuperMap.TimeControlBase.prototype.setRepeat
  11305. * @description 设置是否重复循环。
  11306. * @param {boolean} [repeat=true] - 是否重复循环。
  11307. */
  11308. }, {
  11309. key: "setRepeat",
  11310. value: function setRepeat(repeat) {
  11311. this.repeat = repeat;
  11312. }
  11313. /**
  11314. * @function SuperMap.TimeControlBase.prototype.getRepeat
  11315. * @description 获取是否重复循环,默认是 true。
  11316. * @returns {boolean} 返回是否重复循环。
  11317. */
  11318. }, {
  11319. key: "getRepeat",
  11320. value: function getRepeat() {
  11321. return this.repeat;
  11322. }
  11323. /**
  11324. * @function SuperMap.TimeControlBase.prototype.setReverse
  11325. * @description 设置是否反向。
  11326. * @param {boolean} [reverse=false] - 是否反向。
  11327. */
  11328. }, {
  11329. key: "setReverse",
  11330. value: function setReverse(reverse) {
  11331. this.reverse = reverse;
  11332. }
  11333. /**
  11334. * @function SuperMap.TimeControlBase.prototype.getReverse
  11335. * @description 获取是否反向,默认是false。
  11336. * @returns {boolean} 返回是否反向。
  11337. */
  11338. }, {
  11339. key: "getReverse",
  11340. value: function getReverse() {
  11341. return this.reverse;
  11342. }
  11343. /**
  11344. * @function SuperMap.TimeControlBase.prototype.getRunning
  11345. * @description 获取运行状态。
  11346. * @returns {boolean} true 代表正在运行,false 发表没有运行。
  11347. */
  11348. }, {
  11349. key: "getRunning",
  11350. value: function getRunning() {
  11351. return this.running;
  11352. }
  11353. /**
  11354. * @function SuperMap.TimeControlBase.prototype.destroy
  11355. * @description 销毁 Animator 对象,释放资源。
  11356. */
  11357. }, {
  11358. key: "destroy",
  11359. value: function destroy() {
  11360. var me = this;
  11361. me.speed = null;
  11362. me.frequency = null;
  11363. me.startTime = null;
  11364. me.endTime = null;
  11365. me.currentTime = null;
  11366. me.repeat = null;
  11367. me.running = false;
  11368. me.reverse = null;
  11369. }
  11370. }, {
  11371. key: "tick",
  11372. value: function tick() {//TODO 每次刷新执行的操作。子类实现
  11373. }
  11374. }]);
  11375. return TimeControlBase;
  11376. }();
  11377. SuperMap.TimeControlBase = TimeControlBase;
  11378. ;// CONCATENATED MODULE: ./src/common/control/TimeFlowControl.js
  11379. function TimeFlowControl_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TimeFlowControl_typeof = function _typeof(obj) { return typeof obj; }; } else { TimeFlowControl_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TimeFlowControl_typeof(obj); }
  11380. function TimeFlowControl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11381. 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); } }
  11382. function TimeFlowControl_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimeFlowControl_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimeFlowControl_defineProperties(Constructor, staticProps); return Constructor; }
  11383. function TimeFlowControl_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TimeFlowControl_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TimeFlowControl_get(target, property, receiver || target); }
  11384. function TimeFlowControl_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TimeFlowControl_getPrototypeOf(object); if (object === null) break; } return object; }
  11385. 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 } }); if (superClass) TimeFlowControl_setPrototypeOf(subClass, superClass); }
  11386. function TimeFlowControl_setPrototypeOf(o, p) { TimeFlowControl_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TimeFlowControl_setPrototypeOf(o, p); }
  11387. 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); }; }
  11388. function TimeFlowControl_possibleConstructorReturn(self, call) { if (call && (TimeFlowControl_typeof(call) === "object" || typeof call === "function")) { return call; } return TimeFlowControl_assertThisInitialized(self); }
  11389. function TimeFlowControl_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  11390. function TimeFlowControl_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  11391. function TimeFlowControl_getPrototypeOf(o) { TimeFlowControl_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TimeFlowControl_getPrototypeOf(o); }
  11392. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11393. * This program are made available under the terms of the Apache License, Version 2.0
  11394. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11395. /**
  11396. * @class SuperMap.TimeFlowControl
  11397. * @classdesc 时间管理类。
  11398. * @category Control
  11399. * @description 此类只负责时间上的控制,具体执行的操作需要用户在初始化时的回调函数内部进行实现。
  11400. * 如设置起始时间为 1000,结束时间是 2000,步长设置为 1,
  11401. * 那么表示按照每次1年(可以通过 setSpeed 进行修改)的变化从公元 1000 年开始到公元 2000 年为止,默认每 1 秒会 1 次(通过 setFrequency 修改)
  11402. * @extends {SuperMap.TimeControlBase}
  11403. * @param {function} callback - 每次刷新回调函数。具体的效果需要用户在此回调函数里面实现。
  11404. * @param {Object} options - 该类开放的可选属性。
  11405. * @param {number} [options.speed=1] - 步长(单位 ms)。不能小于 0,(每次刷新的数据之间的间隔为 1ms)。
  11406. * @param {number} [options.frequency=1000] - 刷新频率(单位 ms)。
  11407. * @param {number} [options.startTime=0] - 起始时间,必须为数字,且小于等于 endTime。如果不设置,初始化时为 0,建议设置。
  11408. * @param {number} [options.endTime] - 结束时间,必须为数字,且大于等于 startTime。如果不设置,初始化时使用 new Date() 以当前时间进行设置,建议设置。
  11409. * @param {boolean} [options.repeat=true] - 是否重复循环。
  11410. * @param {boolean} [options.reverse=false] - 是否反向。
  11411. */
  11412. var TimeFlowControl = /*#__PURE__*/function (_TimeControlBase) {
  11413. TimeFlowControl_inherits(TimeFlowControl, _TimeControlBase);
  11414. var _super = TimeFlowControl_createSuper(TimeFlowControl);
  11415. function TimeFlowControl(callback, options) {
  11416. var _this;
  11417. TimeFlowControl_classCallCheck(this, TimeFlowControl);
  11418. _this = _super.call(this, options);
  11419. var me = TimeFlowControl_assertThisInitialized(_this);
  11420. /**
  11421. * @member SuperMap.TimeFlowControl.prototype.callback -{function}
  11422. * @description 每次刷新执行的回调函数。
  11423. */
  11424. me.callback = callback; //先让IE下支持bind方法
  11425. if (!Function.prototype.bind) {
  11426. Function.prototype.bind = function (oThis) {
  11427. if (typeof this !== "function") {
  11428. throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
  11429. }
  11430. var aArgs = Array.prototype.slice.call(arguments, 1),
  11431. fToBind = this,
  11432. fNOP = function fNOP() {//empty Function
  11433. },
  11434. fBound = function fBound() {
  11435. return fToBind.apply(this instanceof fNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
  11436. };
  11437. fNOP.prototype = this.prototype;
  11438. fBound.prototype = new fNOP();
  11439. return fBound;
  11440. };
  11441. } //保证 this.tick 的上下文还是 TimeControl 这个对象
  11442. me.update = me.update.bind(me);
  11443. me.oldTime = me.currentTime;
  11444. me.CLASS_NAME = "SuperMap.TimeFlowControl";
  11445. return _this;
  11446. }
  11447. /**
  11448. * @function SuperMap.TimeFlowControl.prototype.updateOptions
  11449. * @override
  11450. */
  11451. TimeFlowControl_createClass(TimeFlowControl, [{
  11452. key: "updateOptions",
  11453. value: function updateOptions(options) {
  11454. options = options || {};
  11455. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "updateOptions", this).call(this, options);
  11456. }
  11457. /**
  11458. * @function SuperMap.TimeFlowControl.prototype.start
  11459. * @override
  11460. */
  11461. }, {
  11462. key: "start",
  11463. value: function start() {
  11464. var me = this;
  11465. if (me.running) {
  11466. return;
  11467. }
  11468. me.running = true;
  11469. if (me.reverse) {
  11470. if (me.currentTime === me.startTime) {
  11471. me.oldTime = me.endTime;
  11472. me.currentTime = me.oldTime;
  11473. }
  11474. } else {
  11475. if (me.oldTime === me.endTime) {
  11476. me.currentTime = me.startTime;
  11477. me.oldTime = me.currentTime;
  11478. }
  11479. }
  11480. me.tick();
  11481. }
  11482. /**
  11483. * @function SuperMap.TimeFlowControl.prototype.stop
  11484. * @override
  11485. */
  11486. }, {
  11487. key: "stop",
  11488. value: function stop() {
  11489. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "stop", this).call(this);
  11490. var me = this;
  11491. me.oldTime = me.currentTime;
  11492. if (me.running) {
  11493. me.running = false;
  11494. } //清除定时tick
  11495. me.intervalId && window.clearTimeout(me.intervalId);
  11496. }
  11497. /**
  11498. * @function SuperMap.TimeFlowControl.prototype.destroy
  11499. * @override
  11500. */
  11501. }, {
  11502. key: "destroy",
  11503. value: function destroy() {
  11504. TimeFlowControl_get(TimeFlowControl_getPrototypeOf(TimeFlowControl.prototype), "destroy", this).call(this);
  11505. var me = this;
  11506. me.oldTime = null;
  11507. me.callback = null;
  11508. }
  11509. /**
  11510. * @function SuperMap.TimeFlowControl.prototype.tick
  11511. * @description 定时刷新。
  11512. */
  11513. }, {
  11514. key: "tick",
  11515. value: function tick() {
  11516. var me = this;
  11517. me.intervalId && window.clearInterval(me.intervalId);
  11518. me.intervalId = null;
  11519. me.update();
  11520. me.intervalId = window.setInterval(me.update, me.frequency);
  11521. }
  11522. /**
  11523. * @function SuperMap.TimeFlowControl.prototype.update
  11524. * @override
  11525. */
  11526. }, {
  11527. key: "update",
  11528. value: function update() {
  11529. var me = this; //判定是否还需要继续
  11530. if (!me.running) {
  11531. return;
  11532. } //调用回调函数
  11533. me.callback && me.callback(me.currentTime); //destroy之后callback就为空,所以需要判定一下
  11534. if (!me.reverse) {
  11535. //如果相等,则代表上一帧已经运行到了最后,下一帧运行初始化的状态
  11536. if (me.currentTime === me.endTime) {
  11537. //不循环时
  11538. if (!me.repeat) {
  11539. me.running = false;
  11540. me.stop();
  11541. return null;
  11542. }
  11543. me.stop();
  11544. me.currentTime = me.startTime;
  11545. me.oldTime = me.currentTime;
  11546. me.start();
  11547. } else {
  11548. //否则时间递增
  11549. me.oldTime = me.currentTime;
  11550. me.currentTime += me.speed;
  11551. }
  11552. if (me.currentTime >= me.endTime) {
  11553. me.currentTime = me.endTime;
  11554. }
  11555. } else {
  11556. //如果相等,则代表上一帧已经运行到了最前,下一帧运行结束的状态
  11557. if (me.currentTime === me.startTime) {
  11558. //不循环时
  11559. if (!me.repeat) {
  11560. me.running = false;
  11561. return null;
  11562. }
  11563. me.oldTime = me.endTime;
  11564. me.currentTime = me.oldTime;
  11565. } else {
  11566. //否则时间递减
  11567. me.currentTime = me.oldTime;
  11568. me.oldTime -= me.speed;
  11569. }
  11570. if (me.oldTime <= me.startTime) {
  11571. me.oldTime = me.startTime;
  11572. }
  11573. }
  11574. }
  11575. }]);
  11576. return TimeFlowControl;
  11577. }(TimeControlBase);
  11578. SuperMap.TimeFlowControl = TimeFlowControl;
  11579. ;// CONCATENATED MODULE: ./src/common/control/index.js
  11580. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11581. * This program are made available under the terms of the Apache License, Version 2.0
  11582. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11583. // EXTERNAL MODULE: ./node_modules/promise-polyfill/dist/polyfill.js
  11584. var polyfill = __webpack_require__(957);
  11585. // EXTERNAL MODULE: ./node_modules/fetch-ie8/fetch.js
  11586. var fetch = __webpack_require__(937);
  11587. // EXTERNAL MODULE: ./node_modules/fetch-jsonp/build/fetch-jsonp.js
  11588. var fetch_jsonp = __webpack_require__(238);
  11589. var fetch_jsonp_default = /*#__PURE__*/__webpack_require__.n(fetch_jsonp);
  11590. ;// CONCATENATED MODULE: ./src/common/util/FetchRequest.js
  11591. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11592. * This program are made available under the terms of the Apache License, Version 2.0
  11593. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  11594. var FetchRequest_fetch = window.fetch;
  11595. var setFetch = function setFetch(newFetch) {
  11596. FetchRequest_fetch = newFetch;
  11597. };
  11598. /**
  11599. * @function SuperMap.setCORS
  11600. * @description 设置是否允许跨域请求,全局配置,优先级低于 service 下的 crossOring 参数。
  11601. * @param {boolean} cors - 是否允许跨域请求。
  11602. */
  11603. var setCORS = SuperMap.setCORS = function (cors) {
  11604. SuperMap.CORS = cors;
  11605. };
  11606. /**
  11607. * @function SuperMap.isCORS
  11608. * @description 是是否允许跨域请求。
  11609. * @returns {boolean} 是否允许跨域请求。
  11610. */
  11611. var isCORS = SuperMap.isCORS = function () {
  11612. if (SuperMap.CORS != undefined) {
  11613. return SuperMap.CORS;
  11614. }
  11615. return window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest();
  11616. };
  11617. /**
  11618. * @function SuperMap.setRequestTimeout
  11619. * @description 设置请求超时时间。
  11620. * @param {number} [timeout=45] - 请求超时时间,单位秒。
  11621. */
  11622. var setRequestTimeout = SuperMap.setRequestTimeout = function (timeout) {
  11623. return SuperMap.RequestTimeout = timeout;
  11624. };
  11625. /**
  11626. * @function SuperMap.getRequestTimeout
  11627. * @description 获取请求超时时间。
  11628. * @returns {number} 请求超时时间。
  11629. */
  11630. var getRequestTimeout = SuperMap.getRequestTimeout = function () {
  11631. return SuperMap.RequestTimeout || 45000;
  11632. };
  11633. var FetchRequest = SuperMap.FetchRequest = {
  11634. commit: function commit(method, url, params, options) {
  11635. method = method ? method.toUpperCase() : method;
  11636. switch (method) {
  11637. case 'GET':
  11638. return this.get(url, params, options);
  11639. case 'POST':
  11640. return this.post(url, params, options);
  11641. case 'PUT':
  11642. return this.put(url, params, options);
  11643. case 'DELETE':
  11644. return this["delete"](url, params, options);
  11645. default:
  11646. return this.get(url, params, options);
  11647. }
  11648. },
  11649. supportDirectRequest: function supportDirectRequest(url, options) {
  11650. if (Util.isInTheSameDomain(url)) {
  11651. return true;
  11652. }
  11653. if (options.crossOrigin != undefined) {
  11654. return options.crossOrigin;
  11655. } else {
  11656. return isCORS() || options.proxy;
  11657. }
  11658. },
  11659. get: function get(url, params, options) {
  11660. options = options || {};
  11661. var type = 'GET';
  11662. url = Util.urlAppend(url, this._getParameterString(params || {}));
  11663. url = this._processUrl(url, options);
  11664. if (!this.supportDirectRequest(url, options)) {
  11665. url = url.replace('.json', '.jsonp');
  11666. var config = {
  11667. url: url,
  11668. data: params
  11669. };
  11670. return SuperMap.Util.RequestJSONPPromise.GET(config);
  11671. }
  11672. if (!this.urlIsLong(url)) {
  11673. return this._fetch(url, params, options, type);
  11674. } else {
  11675. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  11676. }
  11677. },
  11678. "delete": function _delete(url, params, options) {
  11679. options = options || {};
  11680. var type = 'DELETE';
  11681. url = Util.urlAppend(url, this._getParameterString(params || {}));
  11682. url = this._processUrl(url, options);
  11683. if (!this.supportDirectRequest(url, options)) {
  11684. url = url.replace('.json', '.jsonp');
  11685. var config = {
  11686. url: url += "&_method=DELETE",
  11687. data: params
  11688. };
  11689. return SuperMap.Util.RequestJSONPPromise.DELETE(config);
  11690. }
  11691. if (this.urlIsLong(url)) {
  11692. return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
  11693. }
  11694. return this._fetch(url, params, options, type);
  11695. },
  11696. post: function post(url, params, options) {
  11697. options = options || {};
  11698. if (!this.supportDirectRequest(url, options)) {
  11699. url = url.replace('.json', '.jsonp');
  11700. var config = {
  11701. url: url += "&_method=POST",
  11702. data: params
  11703. };
  11704. return SuperMap.Util.RequestJSONPPromise.POST(config);
  11705. }
  11706. return this._fetch(this._processUrl(url, options), params, options, 'POST');
  11707. },
  11708. put: function put(url, params, options) {
  11709. options = options || {};
  11710. url = this._processUrl(url, options);
  11711. if (!this.supportDirectRequest(url, options)) {
  11712. url = url.replace('.json', '.jsonp');
  11713. var config = {
  11714. url: url += "&_method=PUT",
  11715. data: params
  11716. };
  11717. return SuperMap.Util.RequestJSONPPromise.PUT(config);
  11718. }
  11719. return this._fetch(url, params, options, 'PUT');
  11720. },
  11721. urlIsLong: function urlIsLong(url) {
  11722. //当前url的字节长度。
  11723. var totalLength = 0,
  11724. charCode = null;
  11725. for (var i = 0, len = url.length; i < len; i++) {
  11726. //转化为Unicode编码
  11727. charCode = url.charCodeAt(i);
  11728. if (charCode < 0x007f) {
  11729. totalLength++;
  11730. } else if (0x0080 <= charCode && charCode <= 0x07ff) {
  11731. totalLength += 2;
  11732. } else if (0x0800 <= charCode && charCode <= 0xffff) {
  11733. totalLength += 3;
  11734. }
  11735. }
  11736. return totalLength < 2000 ? false : true;
  11737. },
  11738. _postSimulatie: function _postSimulatie(type, url, params, options) {
  11739. var separator = url.indexOf('?') > -1 ? '&' : '?';
  11740. url += separator + '_method=' + type;
  11741. if (typeof params !== 'string') {
  11742. params = JSON.stringify(params);
  11743. }
  11744. return this.post(url, params, options);
  11745. },
  11746. _processUrl: function _processUrl(url, options) {
  11747. if (this._isMVTRequest(url)) {
  11748. return url;
  11749. }
  11750. if (url.indexOf('.json') === -1 && !options.withoutFormatSuffix) {
  11751. if (url.indexOf('?') < 0) {
  11752. url += '.json';
  11753. } else {
  11754. var urlArrays = url.split('?');
  11755. if (urlArrays.length === 2) {
  11756. url = urlArrays[0] + '.json?' + urlArrays[1];
  11757. }
  11758. }
  11759. }
  11760. if (options && options.proxy) {
  11761. if (typeof options.proxy === 'function') {
  11762. url = options.proxy(url);
  11763. } else {
  11764. url = decodeURIComponent(url);
  11765. url = options.proxy + encodeURIComponent(url);
  11766. }
  11767. }
  11768. return url;
  11769. },
  11770. _fetch: function _fetch(url, params, options, type) {
  11771. options = options || {};
  11772. options.headers = options.headers || {};
  11773. if (!options.headers['Content-Type']) {
  11774. options.headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
  11775. }
  11776. if (options.timeout) {
  11777. return this._timeout(options.timeout, FetchRequest_fetch(url, {
  11778. method: type,
  11779. headers: options.headers,
  11780. body: type === 'PUT' || type === 'POST' ? params : undefined,
  11781. credentials: this._getWithCredentials(options),
  11782. mode: 'cors',
  11783. timeout: getRequestTimeout()
  11784. }).then(function (response) {
  11785. return response;
  11786. }));
  11787. }
  11788. return FetchRequest_fetch(url, {
  11789. method: type,
  11790. body: type === 'PUT' || type === 'POST' ? params : undefined,
  11791. headers: options.headers,
  11792. credentials: this._getWithCredentials(options),
  11793. mode: 'cors',
  11794. timeout: getRequestTimeout()
  11795. }).then(function (response) {
  11796. return response;
  11797. });
  11798. },
  11799. _getWithCredentials: function _getWithCredentials(options) {
  11800. if (options.withCredentials === true) {
  11801. return 'include';
  11802. }
  11803. if (options.withCredentials === false) {
  11804. return 'omit';
  11805. }
  11806. return 'same-origin';
  11807. },
  11808. _fetchJsonp: function _fetchJsonp(url, options) {
  11809. options = options || {};
  11810. return fetch_jsonp_default()(url, {
  11811. method: 'GET',
  11812. timeout: options.timeout
  11813. }).then(function (response) {
  11814. return response;
  11815. });
  11816. },
  11817. _timeout: function _timeout(seconds, promise) {
  11818. return new Promise(function (resolve, reject) {
  11819. setTimeout(function () {
  11820. reject(new Error('timeout'));
  11821. }, seconds);
  11822. promise.then(resolve, reject);
  11823. });
  11824. },
  11825. _getParameterString: function _getParameterString(params) {
  11826. var paramsArray = [];
  11827. for (var key in params) {
  11828. var value = params[key];
  11829. if (value != null && typeof value !== 'function') {
  11830. var encodedValue;
  11831. if (Array.isArray(value) || value.toString() === '[object Object]') {
  11832. encodedValue = encodeURIComponent(JSON.stringify(value));
  11833. } else {
  11834. encodedValue = encodeURIComponent(value);
  11835. }
  11836. paramsArray.push(encodeURIComponent(key) + '=' + encodedValue);
  11837. }
  11838. }
  11839. return paramsArray.join('&');
  11840. },
  11841. _isMVTRequest: function _isMVTRequest(url) {
  11842. return url.indexOf('.mvt') > -1 || url.indexOf('.pbf') > -1;
  11843. }
  11844. };
  11845. SuperMap.Util.RequestJSONPPromise = {
  11846. limitLength: 1500,
  11847. queryKeys: [],
  11848. queryValues: [],
  11849. supermap_callbacks: {},
  11850. addQueryStrings: function addQueryStrings(values) {
  11851. var me = this;
  11852. for (var key in values) {
  11853. me.queryKeys.push(key);
  11854. if (typeof values[key] !== 'string') {
  11855. values[key] = SuperMap.Util.toJSON(values[key]);
  11856. }
  11857. var tempValue = encodeURIComponent(values[key]);
  11858. me.queryValues.push(tempValue);
  11859. }
  11860. },
  11861. issue: function issue(config) {
  11862. var me = this,
  11863. uid = me.getUid(),
  11864. url = config.url,
  11865. splitQuestUrl = [];
  11866. var p = new Promise(function (resolve) {
  11867. me.supermap_callbacks[uid] = function (response) {
  11868. delete me.supermap_callbacks[uid];
  11869. resolve(response);
  11870. };
  11871. }); // me.addQueryStrings({
  11872. // callback: "SuperMap.Util.RequestJSONPPromise.supermap_callbacks[" + uid + "]"
  11873. // });
  11874. var sectionURL = url,
  11875. keysCount = 0; //此次sectionURL中有多少个key
  11876. var length = me.queryKeys ? me.queryKeys.length : 0;
  11877. for (var i = 0; i < length; i++) {
  11878. if (sectionURL.length + me.queryKeys[i].length + 2 >= me.limitLength) {
  11879. //+2 for ("&"or"?")and"="
  11880. if (keysCount == 0) {
  11881. return false;
  11882. }
  11883. splitQuestUrl.push(sectionURL);
  11884. sectionURL = url;
  11885. keysCount = 0;
  11886. i--;
  11887. } else {
  11888. if (sectionURL.length + me.queryKeys[i].length + 2 + me.queryValues[i].length > me.limitLength) {
  11889. var leftValue = me.queryValues[i];
  11890. while (leftValue.length > 0) {
  11891. var leftLength = me.limitLength - sectionURL.length - me.queryKeys[i].length - 2; //+2 for ("&"or"?")and"="
  11892. if (sectionURL.indexOf('?') > -1) {
  11893. sectionURL += '&';
  11894. } else {
  11895. sectionURL += '?';
  11896. }
  11897. var tempLeftValue = leftValue.substring(0, leftLength); //避免 截断sectionURL时,将类似于%22这样的符号截成两半,从而导致服务端组装sectionURL时发生错误
  11898. if (tempLeftValue.substring(leftLength - 1, leftLength) === '%') {
  11899. leftLength -= 1;
  11900. tempLeftValue = leftValue.substring(0, leftLength);
  11901. } else if (tempLeftValue.substring(leftLength - 2, leftLength - 1) === '%') {
  11902. leftLength -= 2;
  11903. tempLeftValue = leftValue.substring(0, leftLength);
  11904. }
  11905. sectionURL += me.queryKeys[i] + '=' + tempLeftValue;
  11906. leftValue = leftValue.substring(leftLength);
  11907. if (tempLeftValue.length > 0) {
  11908. splitQuestUrl.push(sectionURL);
  11909. sectionURL = url;
  11910. keysCount = 0;
  11911. }
  11912. }
  11913. } else {
  11914. keysCount++;
  11915. if (sectionURL.indexOf('?') > -1) {
  11916. sectionURL += '&';
  11917. } else {
  11918. sectionURL += '?';
  11919. }
  11920. sectionURL += me.queryKeys[i] + '=' + me.queryValues[i];
  11921. }
  11922. }
  11923. }
  11924. splitQuestUrl.push(sectionURL);
  11925. me.send(splitQuestUrl, 'SuperMap.Util.RequestJSONPPromise.supermap_callbacks[' + uid + ']', config && config.proxy);
  11926. return p;
  11927. },
  11928. getUid: function getUid() {
  11929. var uid = new Date().getTime(),
  11930. random = Math.floor(Math.random() * 1e17);
  11931. return uid * 1000 + random;
  11932. },
  11933. send: function send(splitQuestUrl, callback, proxy) {
  11934. var len = splitQuestUrl.length;
  11935. if (len > 0) {
  11936. var jsonpUserID = new Date().getTime();
  11937. for (var i = 0; i < len; i++) {
  11938. var url = splitQuestUrl[i];
  11939. if (url.indexOf('?') > -1) {
  11940. url += '&';
  11941. } else {
  11942. url += '?';
  11943. }
  11944. url += 'sectionCount=' + len;
  11945. url += '&sectionIndex=' + i;
  11946. url += '&jsonpUserID=' + jsonpUserID;
  11947. if (proxy) {
  11948. url = decodeURIComponent(url);
  11949. url = proxy + encodeURIComponent(url);
  11950. }
  11951. fetch_jsonp_default()(url, {
  11952. jsonpCallbackFunction: callback,
  11953. timeout: 30000
  11954. });
  11955. }
  11956. }
  11957. },
  11958. GET: function GET(config) {
  11959. var me = this;
  11960. me.queryKeys.length = 0;
  11961. me.queryValues.length = 0;
  11962. me.addQueryStrings(config.params);
  11963. return me.issue(config);
  11964. },
  11965. POST: function POST(config) {
  11966. var me = this;
  11967. me.queryKeys.length = 0;
  11968. me.queryValues.length = 0;
  11969. me.addQueryStrings({
  11970. requestEntity: config.data
  11971. });
  11972. return me.issue(config);
  11973. },
  11974. PUT: function PUT(config) {
  11975. var me = this;
  11976. me.queryKeys.length = 0;
  11977. me.queryValues.length = 0;
  11978. me.addQueryStrings({
  11979. requestEntity: config.data
  11980. });
  11981. return me.issue(config);
  11982. },
  11983. DELETE: function DELETE(config) {
  11984. var me = this;
  11985. me.queryKeys.length = 0;
  11986. me.queryValues.length = 0;
  11987. me.addQueryStrings({
  11988. requestEntity: config.data
  11989. });
  11990. return me.issue(config);
  11991. }
  11992. };
  11993. ;// CONCATENATED MODULE: ./src/common/security/SecurityManager.js
  11994. function SecurityManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  11995. 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); } }
  11996. function SecurityManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) SecurityManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) SecurityManager_defineProperties(Constructor, staticProps); return Constructor; }
  11997. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  11998. * This program are made available under the terms of the Apache License, Version 2.0
  11999. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12000. /**
  12001. * @name SecurityManager
  12002. * @memberOf SuperMap
  12003. * @namespace
  12004. * @category Security
  12005. * @description 安全管理中心,提供 iServer,iPortal,Online 统一权限认证管理。
  12006. * > 使用说明:
  12007. * > 创建任何一个服务之前调用 {@link SuperMap.SecurityManager.registerToken}或
  12008. * > {@link SuperMap.SecurityManager.registerKey}注册凭据。
  12009. * > 发送请求时根据 url 或者服务 id 获取相应的 key 或者 token 并自动添加到服务地址中。
  12010. */
  12011. var SecurityManager = /*#__PURE__*/function () {
  12012. function SecurityManager() {
  12013. SecurityManager_classCallCheck(this, SecurityManager);
  12014. }
  12015. SecurityManager_createClass(SecurityManager, null, [{
  12016. key: "generateToken",
  12017. /**
  12018. * @description 从服务器获取一个token,在此之前要注册服务器信息。
  12019. * @function SuperMap.SecurityManager.generateToken
  12020. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12021. * @param {SuperMap.TokenServiceParameter} tokenParam - token 申请参数。
  12022. * @returns {Promise} 返回包含 token 信息的 Promise 对象。
  12023. */
  12024. value: function generateToken(url, tokenParam) {
  12025. var serverInfo = this.servers[url];
  12026. if (!serverInfo) {
  12027. return;
  12028. }
  12029. return FetchRequest.post(serverInfo.tokenServiceUrl, JSON.stringify(tokenParam.toJSON())).then(function (response) {
  12030. return response.text();
  12031. });
  12032. }
  12033. /**
  12034. * @description 注册安全服务器相关信息。
  12035. * @function SuperMap.SecurityManager.registerServers
  12036. * @param {SuperMap.ServerInfo} serverInfos - 服务器信息。
  12037. */
  12038. }, {
  12039. key: "registerServers",
  12040. value: function registerServers(serverInfos) {
  12041. this.servers = this.servers || {};
  12042. if (!Util.isArray(serverInfos)) {
  12043. serverInfos = [serverInfos];
  12044. }
  12045. for (var i = 0; i < serverInfos.length; i++) {
  12046. var serverInfo = serverInfos[i];
  12047. this.servers[serverInfo.server] = serverInfo;
  12048. }
  12049. }
  12050. /**
  12051. * @description 服务请求都会自动带上这个 token。
  12052. * @function SuperMap.SecurityManager.registerToken
  12053. * @param {string} url -服务器域名+端口:如http://localhost:8090。
  12054. * @param {string} token - token
  12055. */
  12056. }, {
  12057. key: "registerToken",
  12058. value: function registerToken(url, token) {
  12059. this.tokens = this.tokens || {};
  12060. if (!url || !token) {
  12061. return;
  12062. }
  12063. var domain = this._getTokenStorageKey(url);
  12064. this.tokens[domain] = token;
  12065. }
  12066. /**
  12067. * @description 注册 key,ids 为数组(存在一个 key 对应多个服务)。
  12068. * @function SuperMap.SecurityManager.registerKey
  12069. * @param {Array} ids - 可以是服务 id 数组或者 url 地址数组或者 webAPI 类型数组。
  12070. * @param {string} key - key
  12071. */
  12072. }, {
  12073. key: "registerKey",
  12074. value: function registerKey(ids, key) {
  12075. this.keys = this.keys || {};
  12076. if (!ids || ids.length < 1 || !key) {
  12077. return;
  12078. }
  12079. ids = Util.isArray(ids) ? ids : [ids];
  12080. for (var i = 0; i < ids.length; i++) {
  12081. var id = this._getUrlRestString(ids[0]) || ids[0];
  12082. this.keys[id] = key;
  12083. }
  12084. }
  12085. /**
  12086. * @description 获取服务器信息。
  12087. * @function SuperMap.SecurityManager.getServerInfo
  12088. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12089. * @returns {SuperMap.ServerInfo} 服务器信息。
  12090. */
  12091. }, {
  12092. key: "getServerInfo",
  12093. value: function getServerInfo(url) {
  12094. this.servers = this.servers || {};
  12095. return this.servers[url];
  12096. }
  12097. /**
  12098. * @description 根据 Url 获取token。
  12099. * @function SuperMap.SecurityManager.getToken
  12100. * @param {string} url - 服务器域名+端口,如:http://localhost:8092。
  12101. * @returns {string} token
  12102. */
  12103. }, {
  12104. key: "getToken",
  12105. value: function getToken(url) {
  12106. if (!url) {
  12107. return;
  12108. }
  12109. this.tokens = this.tokens || {};
  12110. var domain = this._getTokenStorageKey(url);
  12111. return this.tokens[domain];
  12112. }
  12113. /**
  12114. * @description 根据 Url 获取 key。
  12115. * @function SuperMap.SecurityManager.getKey
  12116. * @param {string} id - id
  12117. * @returns {string} key
  12118. */
  12119. }, {
  12120. key: "getKey",
  12121. value: function getKey(id) {
  12122. this.keys = this.keys || {};
  12123. var key = this._getUrlRestString(id) || id;
  12124. return this.keys[key];
  12125. }
  12126. /**
  12127. * @description iServer 登录验证。
  12128. * @function SuperMap.SecurityManager.loginiServer
  12129. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  12130. * @param {string} username - 用户名。
  12131. * @param {string} password - 密码。
  12132. * @param {boolean} [rememberme=false] - 是否记住。
  12133. * @returns {Promise} 返回包含 iServer 登录请求结果的 Promise 对象。
  12134. */
  12135. }, {
  12136. key: "loginiServer",
  12137. value: function loginiServer(url, username, password, rememberme) {
  12138. url = Util.urlPathAppend(url, 'services/security/login');
  12139. var loginInfo = {
  12140. username: username && username.toString(),
  12141. password: password && password.toString(),
  12142. rememberme: rememberme
  12143. };
  12144. loginInfo = JSON.stringify(loginInfo);
  12145. var requestOptions = {
  12146. headers: {
  12147. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12148. }
  12149. };
  12150. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  12151. return response.json();
  12152. });
  12153. }
  12154. /**
  12155. * @description iServer登出。
  12156. * @function SuperMap.SecurityManager.logoutiServer
  12157. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  12158. * @returns {Promise} 是否登出成功。
  12159. */
  12160. }, {
  12161. key: "logoutiServer",
  12162. value: function logoutiServer(url) {
  12163. url = Util.urlPathAppend(url, 'services/security/logout');
  12164. var requestOptions = {
  12165. headers: {
  12166. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12167. },
  12168. withoutFormatSuffix: true
  12169. };
  12170. return FetchRequest.get(url, "", requestOptions).then(function () {
  12171. return true;
  12172. })["catch"](function () {
  12173. return false;
  12174. });
  12175. }
  12176. /**
  12177. * @description Online 登录验证。
  12178. * @function SuperMap.SecurityManager.loginOnline
  12179. * @param {string} callbackLocation - 跳转位置。
  12180. * @param {boolean} [newTab=true] - 是否新窗口打开。
  12181. */
  12182. }, {
  12183. key: "loginOnline",
  12184. value: function loginOnline(callbackLocation, newTab) {
  12185. var loginUrl = SecurityManager.SSO + "/login?service=" + callbackLocation;
  12186. this._open(loginUrl, newTab);
  12187. }
  12188. /**
  12189. * @description iPortal登录验证。
  12190. * @function SuperMap.SecurityManager.loginiPortal
  12191. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  12192. * @param {string} username - 用户名。
  12193. * @param {string} password - 密码。
  12194. * @returns {Promise} 返回包含 iPortal 登录请求结果的 Promise 对象。
  12195. */
  12196. }, {
  12197. key: "loginiPortal",
  12198. value: function loginiPortal(url, username, password) {
  12199. url = Util.urlPathAppend(url, 'web/login');
  12200. var loginInfo = {
  12201. username: username && username.toString(),
  12202. password: password && password.toString()
  12203. };
  12204. loginInfo = JSON.stringify(loginInfo);
  12205. var requestOptions = {
  12206. headers: {
  12207. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12208. },
  12209. withCredentials: true
  12210. };
  12211. return FetchRequest.post(url, loginInfo, requestOptions).then(function (response) {
  12212. return response.json();
  12213. });
  12214. }
  12215. /**
  12216. * @description iPortal 登出。
  12217. * @function SuperMap.SecurityManager.logoutiPortal
  12218. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  12219. * @returns {Promise} 如果登出成功,返回 true;否则返回 false。
  12220. */
  12221. }, {
  12222. key: "logoutiPortal",
  12223. value: function logoutiPortal(url) {
  12224. url = Util.urlPathAppend(url, 'services/security/logout');
  12225. var requestOptions = {
  12226. headers: {
  12227. 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
  12228. },
  12229. withCredentials: true,
  12230. withoutFormatSuffix: true
  12231. };
  12232. return FetchRequest.get(url, "", requestOptions).then(function () {
  12233. return true;
  12234. })["catch"](function () {
  12235. return false;
  12236. });
  12237. }
  12238. /**
  12239. * @description iManager 登录验证。
  12240. * @function SuperMap.SecurityManager.loginManager
  12241. * @param {string} url - iManager 地址。地址参数为 iManager 首页地址,如: http://localhost:8390/imanager。
  12242. * @param {Object} [loginInfoParams] - iManager 登录参数。
  12243. * @param {string} loginInfoParams.userName - 用户名。
  12244. * @param {string} loginInfoParams.password - 密码。
  12245. * @param {Object} options
  12246. * @param {boolean} [options.isNewTab=true] - 不同域时是否在新窗口打开登录页面。
  12247. * @returns {Promise} 返回包含 iManager 登录请求结果的 Promise 对象。
  12248. */
  12249. }, {
  12250. key: "loginManager",
  12251. value: function loginManager(url, loginInfoParams, options) {
  12252. if (!Util.isInTheSameDomain(url)) {
  12253. var isNewTab = options ? options.isNewTab : true;
  12254. this._open(url, isNewTab);
  12255. return;
  12256. }
  12257. var requestUrl = Util.urlPathAppend(url, 'icloud/security/tokens');
  12258. var params = loginInfoParams || {};
  12259. var loginInfo = {
  12260. username: params.userName && params.userName.toString(),
  12261. password: params.password && params.password.toString()
  12262. };
  12263. loginInfo = JSON.stringify(loginInfo);
  12264. var requestOptions = {
  12265. headers: {
  12266. 'Accept': '*/*',
  12267. 'Content-Type': 'application/json'
  12268. }
  12269. };
  12270. var me = this;
  12271. return FetchRequest.post(requestUrl, loginInfo, requestOptions).then(function (response) {
  12272. response.text().then(function (result) {
  12273. me.imanagerToken = result;
  12274. return result;
  12275. });
  12276. });
  12277. }
  12278. /**
  12279. * @description 清空全部验证信息。
  12280. * @function SuperMap.SecurityManager.destroyAllCredentials
  12281. */
  12282. }, {
  12283. key: "destroyAllCredentials",
  12284. value: function destroyAllCredentials() {
  12285. this.keys = null;
  12286. this.tokens = null;
  12287. this.servers = null;
  12288. }
  12289. /**
  12290. * @description 清空令牌信息。
  12291. * @function SuperMap.SecurityManager.destroyToken
  12292. * @param {string} url - iportal 首页地址,如:http://localhost:8092/iportal.
  12293. */
  12294. }, {
  12295. key: "destroyToken",
  12296. value: function destroyToken(url) {
  12297. if (!url) {
  12298. return;
  12299. }
  12300. var domain = this._getTokenStorageKey(url);
  12301. this.tokens = this.tokens || {};
  12302. if (this.tokens[domain]) {
  12303. delete this.tokens[domain];
  12304. }
  12305. }
  12306. /**
  12307. * @description 清空服务授权码。
  12308. * @function SuperMap.SecurityManager.destroyKey
  12309. * @param {string} url - iServer 首页地址,如:http://localhost:8090/iserver。
  12310. */
  12311. }, {
  12312. key: "destroyKey",
  12313. value: function destroyKey(url) {
  12314. if (!url) {
  12315. return;
  12316. }
  12317. this.keys = this.keys || {};
  12318. var key = this._getUrlRestString(url) || url;
  12319. if (this.keys[key]) {
  12320. delete this.keys[key];
  12321. }
  12322. }
  12323. }, {
  12324. key: "_open",
  12325. value: function _open(url, newTab) {
  12326. newTab = newTab != null ? newTab : true;
  12327. var offsetX = window.screen.availWidth / 2 - this.INNER_WINDOW_WIDTH / 2;
  12328. var offsetY = window.screen.availHeight / 2 - this.INNER_WINDOW_HEIGHT / 2;
  12329. 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";
  12330. if (newTab) {
  12331. window.open(url, 'login');
  12332. } else {
  12333. window.open(url, 'login', options);
  12334. }
  12335. }
  12336. }, {
  12337. key: "_getTokenStorageKey",
  12338. value: function _getTokenStorageKey(url) {
  12339. var patten = /(.*?):\/\/([^\/]+)/i;
  12340. var result = url.match(patten);
  12341. if (!result) {
  12342. return url;
  12343. }
  12344. return result[0];
  12345. }
  12346. }, {
  12347. key: "_getUrlRestString",
  12348. value: function _getUrlRestString(url) {
  12349. if (!url) {
  12350. return url;
  12351. } // var patten = /http:\/\/(.*\/rest)/i;
  12352. var patten = /(http|https):\/\/(.*\/rest)/i;
  12353. var result = url.match(patten);
  12354. if (!result) {
  12355. return url;
  12356. }
  12357. return result[0];
  12358. }
  12359. }]);
  12360. return SecurityManager;
  12361. }();
  12362. SecurityManager.INNER_WINDOW_WIDTH = 600;
  12363. SecurityManager.INNER_WINDOW_HEIGHT = 600;
  12364. SecurityManager.SSO = "https://sso.supermap.com";
  12365. SecurityManager.ONLINE = "https://www.supermapol.com";
  12366. SuperMap.SecurityManager = SecurityManager;
  12367. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerServiceBase.js
  12368. function iManagerServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12369. 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); } }
  12370. function iManagerServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManagerServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManagerServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  12371. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12372. * This program are made available under the terms of the Apache License, Version 2.0
  12373. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12374. /**
  12375. * @class SuperMap.iManagerServiceBase
  12376. * @classdesc iManager 服务基类(有权限限制的类需要实现此类)。
  12377. * @category iManager
  12378. * @param {string} url - iManager 首页地址,如:http://localhost:8390/imanager。
  12379. * @param {Object} options - 服务参数。
  12380. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  12381. * @param {Object} [options.headers] - 请求头。
  12382. */
  12383. var IManagerServiceBase = /*#__PURE__*/function () {
  12384. function IManagerServiceBase(url, options) {
  12385. iManagerServiceBase_classCallCheck(this, IManagerServiceBase);
  12386. if (url) {
  12387. var end = url.substr(url.length - 1, 1);
  12388. this.serviceUrl = end === "/" ? url.substr(0, url.length - 2) : url;
  12389. }
  12390. this.options = options || {};
  12391. this.CLASS_NAME = "SuperMap.iManagerServiceBase";
  12392. }
  12393. /**
  12394. * @function SuperMap.iManagerServiceBase.prototype.request
  12395. * @description 子类统一通过该方法发送请求。
  12396. * @param {string} url - 请求 URL。
  12397. * @param {string} [method='GET'] - 请求类型。
  12398. * @param {Object} [requestOptions] - 请求选项。
  12399. * @param {Object} param - 请求参数。
  12400. * @description 发送请求。
  12401. * @returns {Promise} Promise 对象。
  12402. */
  12403. iManagerServiceBase_createClass(IManagerServiceBase, [{
  12404. key: "request",
  12405. value: function request(method, url, param, requestOptions) {
  12406. requestOptions = requestOptions || {
  12407. headers: {
  12408. 'Accept': '*/*',
  12409. 'Content-Type': 'application/json'
  12410. }
  12411. };
  12412. if (!requestOptions.hasOwnProperty("withCredentials")) {
  12413. requestOptions['withCredentials'] = true;
  12414. }
  12415. requestOptions['crossOrigin'] = this.options.crossOrigin;
  12416. requestOptions['headers'] = this.options.headers;
  12417. var token = SecurityManager.imanagerToken;
  12418. if (token) {
  12419. if (!requestOptions.headers) {
  12420. requestOptions.headers = [];
  12421. }
  12422. requestOptions.headers['X-Auth-Token'] = token;
  12423. }
  12424. if (param) {
  12425. param = JSON.stringify(param);
  12426. }
  12427. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  12428. return response.json();
  12429. });
  12430. }
  12431. }]);
  12432. return IManagerServiceBase;
  12433. }();
  12434. SuperMap.iManagerServiceBase = IManagerServiceBase;
  12435. ;// CONCATENATED MODULE: ./src/common/iManager/iManagerCreateNodeParam.js
  12436. function iManagerCreateNodeParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12437. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12438. * This program are made available under the terms of the Apache License, Version 2.0
  12439. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12440. /**
  12441. * @class SuperMap.iManagerCreateNodeParam
  12442. * @classdesc iManager 创建节点参数。
  12443. * @category iManager
  12444. * @param {Object} [params] - iManager 创建节点参数。
  12445. *
  12446. */
  12447. var IManagerCreateNodeParam = function IManagerCreateNodeParam(params) {
  12448. iManagerCreateNodeParam_classCallCheck(this, IManagerCreateNodeParam);
  12449. params = params || {};
  12450. this.nodeSpec = 'SMALL'; //取值范围: ['SMALL','MEDIUM','LARGE'] 以及自定义的环境规格名称
  12451. this.nodeCount = 1; //要创建vm的个数
  12452. this.nodeName = ''; //vm名称
  12453. this.password = ''; //vm的密码,空表示随机分配
  12454. this.description = ''; //描述信息
  12455. this.physicalMachineName = ''; //vm所属的物理机名称.
  12456. this.ips = []; //vm的ip,空数组表示随机分配
  12457. this.userName = ''; //vm所属用户
  12458. Util.extend(this, params);
  12459. };
  12460. SuperMap.iManagerCreateNodeParam = IManagerCreateNodeParam;
  12461. ;// CONCATENATED MODULE: ./src/common/iManager/iManager.js
  12462. function iManager_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iManager_typeof = function _typeof(obj) { return typeof obj; }; } else { iManager_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iManager_typeof(obj); }
  12463. function iManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12464. 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); } }
  12465. function iManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) iManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) iManager_defineProperties(Constructor, staticProps); return Constructor; }
  12466. 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 } }); if (superClass) iManager_setPrototypeOf(subClass, superClass); }
  12467. function iManager_setPrototypeOf(o, p) { iManager_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iManager_setPrototypeOf(o, p); }
  12468. 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); }; }
  12469. function iManager_possibleConstructorReturn(self, call) { if (call && (iManager_typeof(call) === "object" || typeof call === "function")) { return call; } return iManager_assertThisInitialized(self); }
  12470. function iManager_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12471. function iManager_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12472. function iManager_getPrototypeOf(o) { iManager_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iManager_getPrototypeOf(o); }
  12473. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12474. * This program are made available under the terms of the Apache License, Version 2.0
  12475. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12476. /**
  12477. * @class SuperMap.iManager
  12478. * @classdesc iManager 服务类。
  12479. * @category iManager
  12480. * @param {string} serviceUrl - iManager 首页地址。
  12481. *
  12482. */
  12483. var IManager = /*#__PURE__*/function (_IManagerServiceBase) {
  12484. iManager_inherits(IManager, _IManagerServiceBase);
  12485. var _super = iManager_createSuper(IManager);
  12486. function IManager(iManagerUrl) {
  12487. iManager_classCallCheck(this, IManager);
  12488. return _super.call(this, iManagerUrl);
  12489. }
  12490. /**
  12491. * @function SuperMap.iManager.prototype.load
  12492. * @description 获取所有服务接口,验证是否已登录授权。
  12493. * @returns {Promise} Promise 对象。
  12494. */
  12495. iManager_createClass(IManager, [{
  12496. key: "load",
  12497. value: function load() {
  12498. return this.request("GET", this.serviceUrl + '/web/api/service.json');
  12499. }
  12500. /**
  12501. * @function SuperMap.iManager.prototype.createIServer
  12502. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  12503. * @description 创建 iServer。
  12504. * @returns {Promise} Promise 对象。
  12505. */
  12506. }, {
  12507. key: "createIServer",
  12508. value: function createIServer(createParam) {
  12509. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/server.json', new IManagerCreateNodeParam(createParam));
  12510. }
  12511. /**
  12512. * @function SuperMap.iManager.prototype.createIPortal
  12513. * @param {SuperMap.iManagerCreateNodeParam} createParam - 创建参数。
  12514. * @description 创建 iPortal。
  12515. * @returns {Promise} Promise 对象。
  12516. */
  12517. }, {
  12518. key: "createIPortal",
  12519. value: function createIPortal(createParam) {
  12520. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/portal.json', new IManagerCreateNodeParam(createParam));
  12521. }
  12522. /**
  12523. * @function SuperMap.iManager.prototype.iServerList
  12524. * @description 获取所有创建的 iServer。
  12525. * @returns {Promise} Promise 对象。
  12526. */
  12527. }, {
  12528. key: "iServerList",
  12529. value: function iServerList() {
  12530. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/server.json');
  12531. }
  12532. /**
  12533. * @function SuperMap.iManager.prototype.iPortalList
  12534. * @description 获取所有创建的 iPortal。
  12535. * @returns {Promise} Promise 对象。
  12536. */
  12537. }, {
  12538. key: "iPortalList",
  12539. value: function iPortalList() {
  12540. return this.request("GET", this.serviceUrl + '/icloud/web/nodes/portal.json');
  12541. }
  12542. /**
  12543. * @function SuperMap.iManager.prototype.startNodes
  12544. * @param {Array} ids - 需要启动节点的 ID 数组。e.g:['1']。
  12545. * @description 启动节点。
  12546. * @returns {Promise} Promise 对象。
  12547. */
  12548. }, {
  12549. key: "startNodes",
  12550. value: function startNodes(ids) {
  12551. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/started.json', ids);
  12552. }
  12553. /**
  12554. * @function SuperMap.iManager.prototype.stopNodes
  12555. * @param {Array} ids - 需要停止节点的 ID 数组。e.g:['1']。
  12556. * @description 停止节点。
  12557. * @returns {Promise} Promise 对象。
  12558. */
  12559. }, {
  12560. key: "stopNodes",
  12561. value: function stopNodes(ids) {
  12562. return this.request("POST", this.serviceUrl + '/icloud/web/nodes/stopped.json', ids);
  12563. }
  12564. }]);
  12565. return IManager;
  12566. }(IManagerServiceBase);
  12567. SuperMap.iManager = IManager;
  12568. ;// CONCATENATED MODULE: ./src/common/iManager/index.js
  12569. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12570. * This program are made available under the terms of the Apache License, Version 2.0
  12571. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12572. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalServiceBase.js
  12573. function iPortalServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12574. 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); } }
  12575. function iPortalServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  12576. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12577. * This program are made available under the terms of the Apache License, Version 2.0
  12578. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12579. /**
  12580. * @class SuperMap.iPortalServiceBase
  12581. * @classdesc iPortal 服务基类(有权限限制的类需要实现此类)。
  12582. * @category iPortal/Online
  12583. * @param {string} url - iPortal 服务地址。
  12584. * @param {Object} options - 可选参数。
  12585. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  12586. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  12587. * @param {Object} [options.headers] - 请求头。
  12588. */
  12589. var IPortalServiceBase = /*#__PURE__*/function () {
  12590. function IPortalServiceBase(url, options) {
  12591. iPortalServiceBase_classCallCheck(this, IPortalServiceBase);
  12592. options = options || {};
  12593. this.serviceUrl = url;
  12594. this.serverType = ServerType.iPortal;
  12595. this.CLASS_NAME = "SuperMap.iPortalServiceBase";
  12596. this.withCredentials = options.withCredentials || false;
  12597. this.crossOrigin = options.crossOrigin;
  12598. this.headers = options.headers;
  12599. }
  12600. /**
  12601. * @function SuperMap.iPortalServiceBase.prototype.request
  12602. * @description 子类统一通过该方法发送请求。
  12603. * @param {string} [method='GET'] - 请求类型。
  12604. * @param {string} url - 服务地址。
  12605. * @param {Object} param - 请求参数。
  12606. * @param {Object} [requestOptions] - fetch 请求配置项。
  12607. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  12608. */
  12609. iPortalServiceBase_createClass(IPortalServiceBase, [{
  12610. key: "request",
  12611. value: function request(method, url, param) {
  12612. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
  12613. headers: this.headers,
  12614. crossOrigin: this.crossOrigin,
  12615. withCredentials: this.withCredentials
  12616. };
  12617. url = this.createCredentialUrl(url);
  12618. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  12619. return response.json();
  12620. });
  12621. }
  12622. /**
  12623. * @function SuperMap.iPortalServiceBase.prototype.createCredentialUrl
  12624. * @description 追加授权信息。
  12625. * @param {string} url - 创建证书 URL 地址。
  12626. * @returns {string} 携带 token 或 key 的新地址。
  12627. */
  12628. }, {
  12629. key: "createCredentialUrl",
  12630. value: function createCredentialUrl(url) {
  12631. var newUrl = url,
  12632. credential = this.getCredential();
  12633. if (credential) {
  12634. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  12635. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  12636. newUrl += credential.getUrlParameters();
  12637. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  12638. newUrl += "&" + credential.getUrlParameters();
  12639. } else {
  12640. newUrl += "?" + credential.getUrlParameters();
  12641. }
  12642. }
  12643. return newUrl;
  12644. }
  12645. /**
  12646. * @function SuperMap.iPortalServiceBase.prototype.getCredential
  12647. * @description 获取 token。
  12648. * @returns {string} 返回获取的 token。
  12649. *
  12650. */
  12651. }, {
  12652. key: "getCredential",
  12653. value: function getCredential() {
  12654. var credential,
  12655. value = SecurityManager.getToken(this.serviceUrl);
  12656. credential = value ? new Credential(value, "token") : null;
  12657. if (!credential) {
  12658. value = this.getKey();
  12659. credential = value ? new Credential(value, "key") : null;
  12660. }
  12661. return credential;
  12662. }
  12663. /**
  12664. * @function SuperMap.iPortalServiceBase.prototype.getKey
  12665. * @description 其子类需要重写该方法,修改其中获取 key 的字段,存储 key 可能是服务 ID 字段,可能是 URL。
  12666. */
  12667. }, {
  12668. key: "getKey",
  12669. value: function getKey() {//return SuperMap.SecurityManager.getKey(this.id);
  12670. //或
  12671. //return SuperMap.SecurityManager.getKey(this.serviceUrl);
  12672. }
  12673. }]);
  12674. return IPortalServiceBase;
  12675. }();
  12676. SuperMap.iPortalServiceBase = IPortalServiceBase;
  12677. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryParam.js
  12678. function iPortalQueryParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12679. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12680. * This program are made available under the terms of the Apache License, Version 2.0
  12681. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12682. /**
  12683. * @class SuperMap.iPortalQueryParam
  12684. * @classdesc iPortal 资源查询参数。
  12685. * @version 10.0.1
  12686. * @category iPortal/Online
  12687. * @param {Object} params - iPortal 资源查询具体参数。
  12688. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型
  12689. * @param {number} [params.pageSize] - 分页中每页大小。
  12690. * @param {number} [params.currentPage] - 分页页码。
  12691. * @param {SuperMap.OrderBy} [params.orderBy] - 排序字段。
  12692. * @param {SuperMap.OrderType} [params.orderType] - 根据升序还是降序过滤。
  12693. * @param {SuperMap.SearchType} [params.searchType] - 根据查询的范围进行过滤。
  12694. * @param {Array} [params.tags] - 标签。
  12695. * @param {Array} [params.dirIds] - 目录 id
  12696. * @param {Array} [params.resourceSubTypes] - 根据资源的子类型进行过滤。
  12697. * @param {SuperMap.AggregationTypes} [params.aggregationTypes] - 聚合查询的类型。
  12698. * @param {string} [params.text] - 搜索的关键词。
  12699. * @param {Array} [params.groupIds] - 根据群组进行过滤。
  12700. * @param {Array} [params.departmentIds] - 根据部门进行过滤。
  12701. */
  12702. var IPortalQueryParam = function IPortalQueryParam(params) {
  12703. iPortalQueryParam_classCallCheck(this, IPortalQueryParam);
  12704. params = params || {};
  12705. this.resourceType = ""; // 空为全部 MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  12706. this.pageSize = 12; // 每页多少条
  12707. this.currentPage = 1; // 第几页
  12708. this.orderBy = "UPDATETIME"; // UPDATETIME HEATLEVEL
  12709. this.orderType = "DESC"; // DESC ASC
  12710. this.searchType = "PUBLIC"; // PUBLIC SHARETOME_RES MYDEPARTMENT_RES MYGROUP_RES MY_RES
  12711. this.tags = []; // 标签
  12712. this.dirIds = []; // 类别
  12713. this.resourceSubTypes = []; // 类型
  12714. this.aggregationTypes = []; // TAG TYPE SUBTYPE
  12715. this.text = ""; // 搜索字段
  12716. this.groupIds = []; // 群组Id过滤
  12717. this.departmentIds = []; // 部门Id过滤
  12718. Util.extend(this, params);
  12719. };
  12720. SuperMap.iPortalQueryParam = IPortalQueryParam;
  12721. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalQueryResult.js
  12722. function iPortalQueryResult_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12723. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12724. * This program are made available under the terms of the Apache License, Version 2.0
  12725. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12726. /**
  12727. * @class SuperMap.iPortalQueryResult
  12728. * @classdesc iPortal 资源结果集封装类。
  12729. * @version 10.0.1
  12730. * @category iPortal/Online
  12731. * @param {Object} queryResult - 资源参数。
  12732. * @param {Array} [queryResult.content] - 页面内容。
  12733. * @param {number} [queryResult.total] - 总记录数。
  12734. * @param {number} [queryResult.currentPage] - 当前第几页。
  12735. * @param {number} [queryResult.pageSize] - 每页大小。
  12736. * @param {Object} [queryResult.aggregations] - 聚合查询的结果。
  12737. */
  12738. var IPortalQueryResult = function IPortalQueryResult(queryResult) {
  12739. iPortalQueryResult_classCallCheck(this, IPortalQueryResult);
  12740. queryResult = queryResult || {};
  12741. this.content = [];
  12742. this.total = 0;
  12743. this.currentPage = 1;
  12744. this.pageSize = 12;
  12745. this.aggregations = null;
  12746. Util.extend(this, queryResult);
  12747. };
  12748. SuperMap.iPortalQueryResult = IPortalQueryResult;
  12749. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalResource.js
  12750. function iPortalResource_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortalResource_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortalResource_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortalResource_typeof(obj); }
  12751. function iPortalResource_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12752. 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); } }
  12753. function iPortalResource_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalResource_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalResource_defineProperties(Constructor, staticProps); return Constructor; }
  12754. 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 } }); if (superClass) iPortalResource_setPrototypeOf(subClass, superClass); }
  12755. function iPortalResource_setPrototypeOf(o, p) { iPortalResource_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalResource_setPrototypeOf(o, p); }
  12756. 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); }; }
  12757. function iPortalResource_possibleConstructorReturn(self, call) { if (call && (iPortalResource_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalResource_assertThisInitialized(self); }
  12758. function iPortalResource_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12759. function iPortalResource_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12760. function iPortalResource_getPrototypeOf(o) { iPortalResource_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalResource_getPrototypeOf(o); }
  12761. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12762. * This program are made available under the terms of the Apache License, Version 2.0
  12763. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12764. /**
  12765. * @class SuperMap.iPortalResource
  12766. * @classdesc iPortal 资源详情类。
  12767. * @version 10.0.1
  12768. * @category iPortal/Online
  12769. * @param {string} portalUrl - 资源地址。
  12770. * @param {Object} resourceInfo - 资源详情参数。
  12771. * @param {Array} [resourceInfo.authorizeSetting] - 资源的授权信息
  12772. * @param {string} [resourceInfo.bounds] - 资源的坐标范围
  12773. * @param {string} [resourceInfo.bounds4326] - 资源的坐标范围,转换为EPSG 4326坐标系统后的地理范围。
  12774. * @param {string} [resourceInfo.checkStatus] - 资源的审核状态,可以是:空,SUCCESSFUL,UNCHECKED,FAILED
  12775. * @param {Date} [resourceInfo.createTime] - 资源的创建时间
  12776. * @param {string} [resourceInfo.description] - 资源描述
  12777. * @param {number} [resourceInfo.dirId] - 资源所在的门户目录的id
  12778. * @param {number} [resourceInfo.epsgCode] - 门户资源基于的坐标系的EPSG值。
  12779. * @param {number} [resourceInfo.heatLevel] - 记录资源的访问量或下载量。
  12780. * @param {string} [resourceInfo.id] - 资源存储到ElasticSearch中的文档id
  12781. * @param {string} [resourceInfo.name] - 资源名称
  12782. * @param {number} [resourceInfo.personalDirId] - 资源所在的个人目录的id
  12783. * @param {number} [resourceInfo.resourceId] - 资源表(maps,services等)里的id
  12784. * @param {string} [resourceInfo.resourceSubType] - 某类资源的具体子类型。
  12785. * @param {SuperMap.ResourceType} [resourceInfo.resourceType] - 资源类型
  12786. * @param {number} [resourceInfo.serviceRootUrlId] - 批量注册服务时,服务根地址的ID
  12787. * @param {Array} [resourceInfo.tags] - 资源的标签
  12788. * @param {string} [resourceInfo.thumbnail] - 资源的缩略图
  12789. * @param {Date} [resourceInfo.updateTime] - 资源的更新时间
  12790. * @param {string} [resourceInfo.userName] - 搜索的关键词
  12791. * @param {Object} [resourceInfo.sourceJSON] - 提供了门户项目返回的所有信息。
  12792. * @extends {SuperMap.iPortalServiceBase}
  12793. */
  12794. var IPortalResource = /*#__PURE__*/function (_IPortalServiceBase) {
  12795. iPortalResource_inherits(IPortalResource, _IPortalServiceBase);
  12796. var _super = iPortalResource_createSuper(IPortalResource);
  12797. function IPortalResource(portalUrl, resourceInfo) {
  12798. var _this;
  12799. iPortalResource_classCallCheck(this, IPortalResource);
  12800. _this = _super.call(this, portalUrl);
  12801. resourceInfo = resourceInfo || {};
  12802. _this.authorizeSetting = [];
  12803. _this.bounds = "";
  12804. _this.bounds4326 = "";
  12805. _this.checkStatus = "";
  12806. _this.createTime = 0;
  12807. _this.description = null;
  12808. _this.dirId = null;
  12809. _this.epsgCode = 0;
  12810. _this.heatLevel = 0;
  12811. _this.id = 0;
  12812. _this.name = "";
  12813. _this.personalDirId = null;
  12814. _this.resourceId = 0;
  12815. _this.resourceSubType = null;
  12816. _this.resourceType = null;
  12817. _this.serviceRootUrlId = null;
  12818. _this.tags = null;
  12819. _this.thumbnail = null;
  12820. _this.updateTime = 0;
  12821. _this.userName = "";
  12822. _this.sourceJSON = {}; //返回门户资源详细信息
  12823. Util.extend(iPortalResource_assertThisInitialized(_this), resourceInfo); // INSIGHTS_WORKSPACE MAP_DASHBOARD
  12824. _this.resourceUrl = portalUrl + "/web/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  12825. if (_this.withCredentials) {
  12826. _this.resourceUrl = portalUrl + "/web/mycontent/" + _this.resourceType.replace("_", "").toLowerCase() + "s/" + _this.resourceId;
  12827. } // if (this.id) {
  12828. // this.mapUrl = mapUrl + "/" + this.id;
  12829. // }
  12830. return _this;
  12831. }
  12832. /**
  12833. * @function SuperMap.iPortalResource.prototype.load
  12834. * @description 加载资源信息。
  12835. * @returns {Promise} 返回 Promise 对象。如果成功,Promise 没有返回值,请求返回结果自动填充到该类的属性中;如果失败,Promise 返回值包含错误信息。
  12836. */
  12837. iPortalResource_createClass(IPortalResource, [{
  12838. key: "load",
  12839. value: function load() {
  12840. var me = this;
  12841. return me.request("GET", me.resourceUrl + ".json").then(function (resourceInfo) {
  12842. if (resourceInfo.error) {
  12843. return resourceInfo;
  12844. }
  12845. me.sourceJSON = resourceInfo;
  12846. });
  12847. }
  12848. /**
  12849. * @function SuperMap.iPortalResource.prototype.update
  12850. * @description 更新资源属性信息。
  12851. * @returns {Promise} 返回包含更新操作状态的 Promise 对象。
  12852. */
  12853. }, {
  12854. key: "update",
  12855. value: function update() {
  12856. var resourceName = this.resourceType.replace("_", "").toLowerCase();
  12857. var options = {
  12858. headers: {
  12859. 'Content-Type': 'application/x-www-form-urlencoded'
  12860. }
  12861. };
  12862. if (resourceName === 'data') {
  12863. this.resourceUrl = this.resourceUrl + "/attributes.json";
  12864. }
  12865. var entity = JSON.stringify(this.sourceJSON); //对服务资源进行编辑时,请求体内容只留关键字字段(目前如果是全部字段 更新返回成功 但其实没有真正的更新)
  12866. if (resourceName === 'service') {
  12867. var serviceInfo = {
  12868. authorizeSetting: this.sourceJSON.authorizeSetting,
  12869. metadata: this.sourceJSON.metadata,
  12870. tags: this.sourceJSON.tags,
  12871. thumbnail: this.sourceJSON.thumbnail,
  12872. tokenRefreshUrl: this.sourceJSON.tokenRefreshUrl
  12873. };
  12874. entity = JSON.stringify(serviceInfo);
  12875. }
  12876. return this.request("PUT", this.resourceUrl, entity, options);
  12877. }
  12878. }]);
  12879. return IPortalResource;
  12880. }(IPortalServiceBase);
  12881. SuperMap.iPortalResource = IPortalResource;
  12882. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareParam.js
  12883. function iPortalShareParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12884. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12885. * This program are made available under the terms of the Apache License, Version 2.0
  12886. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12887. /**
  12888. * @class SuperMap.iPortalShareParam
  12889. * @classdesc iPortal 资源共享参数。
  12890. * @version 10.0.1
  12891. * @category iPortal/Online
  12892. * @param {Object} params - iPortal 资源共享具体参数。
  12893. * @param {SuperMap.ResourceType} [params.resourceType] - 资源类型。
  12894. * @param {Array} [params.ids] - 资源的id数组。
  12895. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  12896. */
  12897. var IPortalShareParam = function IPortalShareParam(params) {
  12898. iPortalShareParam_classCallCheck(this, IPortalShareParam);
  12899. params = params || {};
  12900. this.ids = [];
  12901. this.entities = [];
  12902. this.resourceType = ""; // MAP SERVICE SCENE DATA INSIGHTS_WORKSPACE MAP_DASHBOARD
  12903. Util.extend(this, params);
  12904. };
  12905. SuperMap.iPortalShareParam = IPortalShareParam;
  12906. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortal.js
  12907. function iPortal_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortal_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortal_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortal_typeof(obj); }
  12908. function iPortal_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  12909. 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); } }
  12910. function iPortal_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortal_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortal_defineProperties(Constructor, staticProps); return Constructor; }
  12911. 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 } }); if (superClass) iPortal_setPrototypeOf(subClass, superClass); }
  12912. function iPortal_setPrototypeOf(o, p) { iPortal_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortal_setPrototypeOf(o, p); }
  12913. 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); }; }
  12914. function iPortal_possibleConstructorReturn(self, call) { if (call && (iPortal_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortal_assertThisInitialized(self); }
  12915. function iPortal_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  12916. function iPortal_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  12917. function iPortal_getPrototypeOf(o) { iPortal_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortal_getPrototypeOf(o); }
  12918. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  12919. * This program are made available under the terms of the Apache License, Version 2.0
  12920. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  12921. /**
  12922. * @class SuperMap.iPortal
  12923. * @classdesc 对接 SuperMap iPortal 基础服务。
  12924. * @category iPortal/Online
  12925. * @extends {SuperMap.iPortalServiceBase}
  12926. * @param {string} iportalUrl - 地址。
  12927. * @param {Object} options - 参数。
  12928. * @param {boolean} [options.withCredentials] - 请求是否携带 cookie。
  12929. */
  12930. var IPortal = /*#__PURE__*/function (_IPortalServiceBase) {
  12931. iPortal_inherits(IPortal, _IPortalServiceBase);
  12932. var _super = iPortal_createSuper(IPortal);
  12933. function IPortal(iportalUrl, options) {
  12934. var _this;
  12935. iPortal_classCallCheck(this, IPortal);
  12936. _this = _super.call(this, iportalUrl, options);
  12937. _this.iportalUrl = iportalUrl;
  12938. options = options || {};
  12939. _this.withCredentials = options.withCredentials || false;
  12940. return _this;
  12941. }
  12942. /**
  12943. * @function SuperMap.iPortal.prototype.load
  12944. * @description 加载页面。
  12945. * @returns {Promise} 返回包含 iportal web 资源信息的 Promise 对象。
  12946. */
  12947. iPortal_createClass(IPortal, [{
  12948. key: "load",
  12949. value: function load() {
  12950. return FetchRequest.get(this.iportalUrl + "/web");
  12951. }
  12952. /**
  12953. * @function SuperMap.iPortal.prototype.queryResources
  12954. * @description 查询资源。
  12955. * @version 10.0.1
  12956. * @param {SuperMap.iPortalQueryParam} queryParams - 查询参数。
  12957. * @returns {Promise} 返回包含所有资源结果的 Promise 对象。
  12958. */
  12959. }, {
  12960. key: "queryResources",
  12961. value: function queryResources(queryParams) {
  12962. if (!(queryParams instanceof IPortalQueryParam)) {
  12963. return new Promise(function (resolve) {
  12964. resolve("queryParams is not instanceof iPortalQueryParam !");
  12965. });
  12966. }
  12967. var me = this;
  12968. var resourceUrl = this.iportalUrl + "/gateway/catalog/resource/search.json";
  12969. queryParams.t = new Date().getTime();
  12970. return this.request("GET", resourceUrl, queryParams).then(function (result) {
  12971. var content = [];
  12972. result.content.forEach(function (item) {
  12973. content.push(new IPortalResource(me.iportalUrl, item));
  12974. });
  12975. var queryResult = new IPortalQueryResult();
  12976. queryResult.content = content;
  12977. queryResult.total = result.total;
  12978. queryResult.currentPage = result.currentPage;
  12979. queryResult.pageSize = result.pageSize;
  12980. queryResult.aggregations = result.aggregations;
  12981. return queryResult;
  12982. });
  12983. }
  12984. /**
  12985. * @function SuperMap.iPortal.prototype.updateResourcesShareSetting
  12986. * @description 更新共享设置。
  12987. * @version 10.0.1
  12988. * @param {SuperMap.iPortalShareParam} shareParams - 共享的参数。
  12989. * @returns {Promise} 返回包含共享资源结果的 Promise 对象。
  12990. */
  12991. }, {
  12992. key: "updateResourcesShareSetting",
  12993. value: function updateResourcesShareSetting(shareParams) {
  12994. if (!(shareParams instanceof IPortalShareParam)) {
  12995. return new Promise(function (resolve) {
  12996. resolve("shareParams is not instanceof iPortalShareParam !");
  12997. });
  12998. }
  12999. var resourceUrlName = shareParams.resourceType.replace("_", "").toLowerCase() + "s";
  13000. if (resourceUrlName === "datas") {
  13001. resourceUrlName = "mycontent/" + resourceUrlName;
  13002. }
  13003. var cloneShareParams = {
  13004. ids: shareParams.ids,
  13005. entities: shareParams.entities
  13006. };
  13007. var shareUrl = this.iportalUrl + "/web/" + resourceUrlName + "/sharesetting.json";
  13008. return this.request("PUT", shareUrl, JSON.stringify(cloneShareParams)).then(function (result) {
  13009. return result;
  13010. });
  13011. }
  13012. }]);
  13013. return IPortal;
  13014. }(IPortalServiceBase);
  13015. SuperMap.iPortal = IPortal;
  13016. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalShareEntity.js
  13017. function iPortalShareEntity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13018. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13019. * This program are made available under the terms of the Apache License, Version 2.0
  13020. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13021. /**
  13022. * @class SuperMap.iPortalShareEntity
  13023. * @classdesc iPortal 资源共享实体参数。
  13024. * @version 10.0.1
  13025. * @category iPortal/Online
  13026. * @param {Object} shareEntity - iPortal 资源共享实体具体参数。
  13027. * @param {SuperMap.PermissionType} [shareEntity.permissionType] - 权限类型。
  13028. * @param {SuperMap.EntityType} [shareEntity.entityType] - 实体类型
  13029. * @param {string} [shareEntity.entityName] - 实体 Name。对应的 USER(用户)、 ROLE(角色)、GROUP(用户组)、IPORTALGROUP(群组)的名称。
  13030. * @param {number} [shareEntity.entityId] - 实体的 id。用于群组的授权。
  13031. */
  13032. var IPortalShareEntity = function IPortalShareEntity(shareEntity) {
  13033. iPortalShareEntity_classCallCheck(this, IPortalShareEntity);
  13034. shareEntity = shareEntity || {};
  13035. this.permissionType = ""; // SEARCH READ READWRITE DOWNLOAD
  13036. this.entityType = ""; // USER DEPARTMENT IPORTALGROUP
  13037. this.entityName = "GUEST"; // GUEST or 具体用户 name
  13038. this.entityId = null;
  13039. Util.extend(this, shareEntity);
  13040. };
  13041. SuperMap.iPortalShareEntity = IPortalShareEntity;
  13042. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddResourceParam.js
  13043. function iPortalAddResourceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13044. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13045. * This program are made available under the terms of the Apache License, Version 2.0
  13046. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13047. /**
  13048. * @class SuperMap.iPortalAddResourceParam
  13049. * @classdesc iPortal 添加资源参数。
  13050. * @version 10.0.1
  13051. * @category iPortal/Online
  13052. * @param {Object} params - iPortal 添加资源具体参数。
  13053. * @param {String} [params.rootUrl] - 服务地址。
  13054. * @param {Array} [params.tags] - 标签。
  13055. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  13056. */
  13057. var IPortalAddResourceParam = function IPortalAddResourceParam(params) {
  13058. iPortalAddResourceParam_classCallCheck(this, IPortalAddResourceParam);
  13059. params = params || {};
  13060. this.rootUrl = "";
  13061. this.tags = [];
  13062. this.entities = [];
  13063. Util.extend(this, params);
  13064. };
  13065. SuperMap.iPortalAddResourceParam = IPortalAddResourceParam;
  13066. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalRegisterServiceParam.js
  13067. function iPortalRegisterServiceParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13068. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13069. * This program are made available under the terms of the Apache License, Version 2.0
  13070. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13071. /**
  13072. * @class SuperMap.iPortalRegisterServiceParam
  13073. * @classdesc iPortal 注册服务参数。
  13074. * @version 10.0.1
  13075. * @category iPortal/Online
  13076. * @param {Object} params - iPortal 注册服务具体参数。
  13077. * @param {String} [params.type] - 服务类型。
  13078. * @param {Array} [params.tags] - 服务标签。
  13079. * @param {SuperMap.iPortalShareEntity} [params.entities] - 资源的实体共享参数
  13080. * @param {Object} [params.metadata] - 服务元信息。
  13081. * @param {Array} [params.addedMapNames] - 地图服务列表。
  13082. * @param {Array} [params.addedSceneNames] - 场景服务列表。
  13083. */
  13084. var IPortalRegisterServiceParam = function IPortalRegisterServiceParam(params) {
  13085. iPortalRegisterServiceParam_classCallCheck(this, IPortalRegisterServiceParam);
  13086. params = params || {};
  13087. this.type = ""; // SUPERMAP_REST ARCGIS_REST WMS WFS WCS WPS WMTS OTHERS
  13088. this.tags = [];
  13089. this.entities = [];
  13090. this.metadata = {};
  13091. this.addedMapNames = [];
  13092. this.addedSceneNames = [];
  13093. Util.extend(this, params);
  13094. };
  13095. SuperMap.iPortalRegisterServiceParam = IPortalRegisterServiceParam;
  13096. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalAddDataParam.js
  13097. function iPortalAddDataParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13098. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13099. * This program are made available under the terms of the Apache License, Version 2.0
  13100. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13101. /**
  13102. * @class SuperMap.iPortalAddDataParam
  13103. * @classdesc iPortal 上传/注册数据所需的参数。
  13104. * @version 10.0.1
  13105. * @category iPortal/Online
  13106. * @param {Object} params - iPortal 上传/注册数据所需的具体参数。
  13107. * @param {string} params.fileName - 文件名称
  13108. * @param {SuperMap.DataItemType} params.type - 数据类型。
  13109. * @param {Array} [params.tags] - 数据的标签
  13110. * @param {SuperMap.iPortalDataMetaInfoParam} [params.dataMetaInfo] - 数据元信息
  13111. */
  13112. var IPortalAddDataParam = function IPortalAddDataParam(params) {
  13113. iPortalAddDataParam_classCallCheck(this, IPortalAddDataParam);
  13114. params = params || {};
  13115. this.fileName = "";
  13116. this.type = "";
  13117. this.tags = [];
  13118. this.dataMetaInfo = {};
  13119. Util.extend(this, params);
  13120. };
  13121. SuperMap.iPortalAddDataParam = IPortalAddDataParam;
  13122. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataMetaInfoParam.js
  13123. function iPortalDataMetaInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13124. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13125. * This program are made available under the terms of the Apache License, Version 2.0
  13126. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13127. /**
  13128. * @class SuperMap.iPortalDataMetaInfoParam
  13129. * @classdesc iPortal 上传数据/注册数据元信息所需的参数。
  13130. * @version 10.0.1
  13131. * @category iPortal/Online
  13132. * @param {Object} params - iPortal 获取数据项id excel csv类型的数据所需数据元信息具体参数。
  13133. * @param {string} params.xField - X 坐标字段
  13134. * @param {string} params.yField - Y 坐标字段
  13135. * @param {number} params.xIndex - x所在列(关系型存储下CSV或EXCEL数据时必填)
  13136. * @param {number} params.yIndex - y所在列(关系型存储下CSV或EXCEL数据时必填)
  13137. * @param {array} [params.fieldTypes] - 设置字段类型(关系型存储下CSV或EXCEL数据时可选填)。默认类型为:WTEXT。该参数按照CSV文件字段顺序从左到右依次设置,其中默认字段类型可省略不设置。例如,CSV文件中有10个字段,如果只需设定第1,2,4个字段,可设置为[a,b,,c]。
  13138. * @param {string} params.separator - 分隔符(关系型存储下CSV数据时必填)
  13139. * @param {boolean} params.firstRowIsHead - 是否带表头(关系型存储下CSV数据时必填)
  13140. * @param {boolean} params.url - HDFS注册目录地址
  13141. * @param {SuperMap.iPortalDataStoreInfoParam} params.dataStoreInfo - 注册数据时的数据存储信息
  13142. */
  13143. var IPortalDataMetaInfoParam = function IPortalDataMetaInfoParam(params) {
  13144. iPortalDataMetaInfoParam_classCallCheck(this, IPortalDataMetaInfoParam);
  13145. params = params || {};
  13146. this.xField = "";
  13147. this.yField = "";
  13148. this.fileEncoding = "UTF-8";
  13149. this.xIndex = 1;
  13150. this.yIndex = 1;
  13151. this.fieldTypes = [];
  13152. this.separator = "";
  13153. this.firstRowIsHead = true;
  13154. this.url = "";
  13155. this.dataStoreInfo = {};
  13156. Util.extend(this, params);
  13157. };
  13158. SuperMap.iPortalDataMetaInfoParam = IPortalDataMetaInfoParam;
  13159. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataStoreInfoParam.js
  13160. function iPortalDataStoreInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13161. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13162. * This program are made available under the terms of the Apache License, Version 2.0
  13163. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13164. /**
  13165. * @class SuperMap.iPortalDataStoreInfoParam
  13166. * @classdesc iPortal 注册一个HBASE HDFS数据存储类。
  13167. * @version 10.0.1
  13168. * @category iPortal/Online
  13169. * @param {Object} params - iPortal 注册一个HBASE HDFS数据存储类具体参数。
  13170. * @param {string} params.type - 大数据文件共享类型和空间数据库类型,包括大数据文件共享HDFS 目录(HDFS)和空间数据库HBASE
  13171. * @param {string} params.url - HDFS数据存储目录地址
  13172. * @param {SuperMap.iPortalDataConnectionInfoParam} [params.connectionInfo] - HBASE空间数据库服务的连接信息
  13173. */
  13174. var IPortalDataStoreInfoParam = function IPortalDataStoreInfoParam(params) {
  13175. iPortalDataStoreInfoParam_classCallCheck(this, IPortalDataStoreInfoParam);
  13176. params = params || {};
  13177. this.type = "";
  13178. this.url = "";
  13179. this.connectionInfo = {};
  13180. Util.extend(this, params);
  13181. };
  13182. SuperMap.iPortalDataStoreInfoParam = IPortalDataStoreInfoParam;
  13183. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalDataConnectionInfoParam.js
  13184. function iPortalDataConnectionInfoParam_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13185. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13186. * This program are made available under the terms of the Apache License, Version 2.0
  13187. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13188. /**
  13189. * @class SuperMap.iPortalDataConnectionInfoParam
  13190. * @classdesc iPortal HBASE数据源连接信息类。
  13191. * @version 10.0.1
  13192. * @category iPortal/Online
  13193. * @param {Object} params - iPortal HBASE数据源连接信息类具体参数。
  13194. * @param {string} params.dataBase - 数据源连接的数据库名。
  13195. * @param {string} params.server - 服务地址。
  13196. */
  13197. var IPortalDataConnectionInfoParam = function IPortalDataConnectionInfoParam(params) {
  13198. iPortalDataConnectionInfoParam_classCallCheck(this, IPortalDataConnectionInfoParam);
  13199. params = params || {};
  13200. this.dataBase = "";
  13201. this.server = "";
  13202. Util.extend(this, params);
  13203. };
  13204. SuperMap.iPortalDataConnectionInfoParam = IPortalDataConnectionInfoParam;
  13205. ;// CONCATENATED MODULE: ./src/common/iPortal/iPortalUser.js
  13206. function iPortalUser_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iPortalUser_typeof = function _typeof(obj) { return typeof obj; }; } else { iPortalUser_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iPortalUser_typeof(obj); }
  13207. function iPortalUser_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13208. 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); } }
  13209. function iPortalUser_createClass(Constructor, protoProps, staticProps) { if (protoProps) iPortalUser_defineProperties(Constructor.prototype, protoProps); if (staticProps) iPortalUser_defineProperties(Constructor, staticProps); return Constructor; }
  13210. 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 } }); if (superClass) iPortalUser_setPrototypeOf(subClass, superClass); }
  13211. function iPortalUser_setPrototypeOf(o, p) { iPortalUser_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iPortalUser_setPrototypeOf(o, p); }
  13212. 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); }; }
  13213. function iPortalUser_possibleConstructorReturn(self, call) { if (call && (iPortalUser_typeof(call) === "object" || typeof call === "function")) { return call; } return iPortalUser_assertThisInitialized(self); }
  13214. function iPortalUser_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  13215. function iPortalUser_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  13216. function iPortalUser_getPrototypeOf(o) { iPortalUser_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iPortalUser_getPrototypeOf(o); }
  13217. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13218. * This program are made available under the terms of the Apache License, Version 2.0
  13219. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13220. /**
  13221. * @class SuperMap.iPortalUser
  13222. * @classdesc iPortal 门户中用户信息的封装类。用于管理用户资源,包括可删除,添加资源。
  13223. * @version 10.0.1
  13224. * @category iPortal/Online
  13225. * @param {string} iportalUrl - iportal根地址。
  13226. * @extends {SuperMap.iPortalServiceBase}
  13227. *
  13228. */
  13229. var IPortalUser = /*#__PURE__*/function (_IPortalServiceBase) {
  13230. iPortalUser_inherits(IPortalUser, _IPortalServiceBase);
  13231. var _super = iPortalUser_createSuper(IPortalUser);
  13232. function IPortalUser(iportalUrl) {
  13233. var _this;
  13234. iPortalUser_classCallCheck(this, IPortalUser);
  13235. _this = _super.call(this, iportalUrl);
  13236. _this.iportalUrl = iportalUrl;
  13237. return _this;
  13238. }
  13239. /**
  13240. * @function SuperMap.iPortalUser.prototype.deleteResources
  13241. * @description 删除资源。
  13242. * @param {Object} params - 删除资源所需的参数对象:{ids,resourceType}。
  13243. * @returns {Promise} 返回包含删除操作状态的 Promise 对象。
  13244. */
  13245. iPortalUser_createClass(IPortalUser, [{
  13246. key: "deleteResources",
  13247. value: function deleteResources(params) {
  13248. var resourceName = params.resourceType.replace("_", "").toLowerCase();
  13249. var deleteResourceUrl = this.iportalUrl + "/web/" + resourceName + "s.json?ids=" + encodeURI(JSON.stringify(params.ids));
  13250. if (resourceName === 'data') {
  13251. deleteResourceUrl = this.iportalUrl + "/web/mycontent/datas/delete.json";
  13252. return this.request("POST", deleteResourceUrl, JSON.stringify(params.ids));
  13253. }
  13254. return this.request("DELETE", deleteResourceUrl);
  13255. }
  13256. /**
  13257. * @function SuperMap.iPortalUser.prototype.addMap
  13258. * @description 添加地图。
  13259. * @version 10.1.0
  13260. * @param {SuperMap.iPortalAddResourceParam} addMapParams - 添加地图的参数。
  13261. * @returns {Promise} 返回包含添加地图结果的 Promise 对象。
  13262. */
  13263. }, {
  13264. key: "addMap",
  13265. value: function addMap(addMapParams) {
  13266. if (!(addMapParams instanceof IPortalAddResourceParam)) {
  13267. return this.getErrMsgPromise("addMapParams is not instanceof IPortalAddResourceParam !");
  13268. }
  13269. var cloneAddMapParams = {
  13270. rootUrl: addMapParams.rootUrl,
  13271. tags: addMapParams.tags,
  13272. authorizeSetting: addMapParams.entities
  13273. };
  13274. var addMapUrl = this.iportalUrl + "/web/maps/batchaddmaps.json";
  13275. return this.request("POST", addMapUrl, JSON.stringify(cloneAddMapParams)).then(function (result) {
  13276. return result;
  13277. });
  13278. }
  13279. /**
  13280. * @function SuperMap.iPortalUser.prototype.addScene
  13281. * @description 添加场景。
  13282. * @version 10.1.0
  13283. * @param {SuperMap.iPortalAddResourceParam} addSceneParams - 添加场景的参数。
  13284. * @returns {Promise} 返回包含添加场景结果的 Promise 对象。
  13285. */
  13286. }, {
  13287. key: "addScene",
  13288. value: function addScene(addSceneParams) {
  13289. if (!(addSceneParams instanceof IPortalAddResourceParam)) {
  13290. return this.getErrMsgPromise("addSceneParams is not instanceof IPortalAddResourceParam !");
  13291. }
  13292. var cloneAddSceneParams = {
  13293. rootUrl: addSceneParams.rootUrl,
  13294. tags: addSceneParams.tags,
  13295. authorizeSetting: addSceneParams.entities
  13296. };
  13297. var addSceneUrl = this.iportalUrl + "/web/scenes/batchaddscenes.json";
  13298. return this.request("POST", addSceneUrl, JSON.stringify(cloneAddSceneParams)).then(function (result) {
  13299. return result;
  13300. });
  13301. }
  13302. /**
  13303. * @function SuperMap.iPortalUser.prototype.registerService
  13304. * @description 注册服务。
  13305. * @version 10.1.0
  13306. * @param {SuperMap.iPortalRegisterServiceParam} registerParams - 注册服务的参数。
  13307. * @returns {Promise} 返回包含注册服务结果的 Promise 对象。
  13308. */
  13309. }, {
  13310. key: "registerService",
  13311. value: function registerService(registerParams) {
  13312. if (!(registerParams instanceof IPortalRegisterServiceParam)) {
  13313. return this.getErrMsgPromise("registerParams is not instanceof IPortalRegisterServiceParam !");
  13314. }
  13315. var cloneRegisterParams = {
  13316. type: registerParams.type,
  13317. tags: registerParams.tags,
  13318. authorizeSetting: registerParams.entities,
  13319. metadata: registerParams.metadata,
  13320. addedMapNames: registerParams.addedMapNames,
  13321. addedSceneNames: registerParams.addedSceneNames
  13322. };
  13323. var registerUrl = this.iportalUrl + "/web/services.json";
  13324. return this.request("POST", registerUrl, JSON.stringify(cloneRegisterParams)).then(function (result) {
  13325. return result;
  13326. });
  13327. }
  13328. /**
  13329. * @function SuperMap.iPortalUser.prototype.getErrMsgPromise
  13330. * @description 获取包含错误信息的Promise对象。
  13331. * @version 10.1.0
  13332. * @param {String} errMsg - 传入的错误信息。
  13333. * @returns {Promise} 返回包含错误信息的 Promise 对象。
  13334. */
  13335. }, {
  13336. key: "getErrMsgPromise",
  13337. value: function getErrMsgPromise(errMsg) {
  13338. return new Promise(function (resolve) {
  13339. resolve(errMsg);
  13340. });
  13341. }
  13342. /**
  13343. * @function SuperMap.iPortalUser.prototype.uploadDataRequest
  13344. * @description 上传数据。
  13345. * @version 10.1.0
  13346. * @param {number} id - 上传数据的资源id。
  13347. * @param {Object} formData - 请求体为文本数据流。
  13348. * @returns {Promise} 返回包含上传数据操作的 Promise 对象。
  13349. */
  13350. }, {
  13351. key: "uploadDataRequest",
  13352. value: function uploadDataRequest(id, formData) {
  13353. var uploadDataUrl = this.iportalUrl + "/web/mycontent/datas/" + id + "/upload.json";
  13354. return this.request("POST", uploadDataUrl, formData);
  13355. }
  13356. /**
  13357. * @function SuperMap.iPortalUser.prototype.addData
  13358. * @description 上传/注册数据。
  13359. * @version 10.1.0
  13360. * @param {SuperMap.iPortalAddDataParam} params - 上传/注册数据所需的参数。
  13361. * @param {Object} [formData] - 请求体为文本数据流(上传数据时传入)。
  13362. * @returns {Promise} 返回上传/注册数据的 Promise 对象。
  13363. */
  13364. }, {
  13365. key: "addData",
  13366. value: function addData(params, formData) {
  13367. var _this2 = this;
  13368. if (!(params instanceof IPortalAddDataParam)) {
  13369. return this.getErrMsgPromise("params is not instanceof iPortalAddDataParam !");
  13370. }
  13371. var datasUrl = this.iportalUrl + "/web/mycontent/datas.json";
  13372. var entity = {
  13373. fileName: params.fileName,
  13374. tags: params.tags,
  13375. type: params.type
  13376. };
  13377. var type = params.type.toLowerCase();
  13378. var dataMetaInfo;
  13379. if (type === "excel" || type === "csv") {
  13380. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  13381. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  13382. }
  13383. dataMetaInfo = {
  13384. xField: params.dataMetaInfo.xField,
  13385. yField: params.dataMetaInfo.yField
  13386. };
  13387. if (type === 'csv') {
  13388. dataMetaInfo.fileEncoding = params.dataMetaInfo.fileEncoding;
  13389. }
  13390. entity.coordType = "WGS84";
  13391. entity.dataMetaInfo = dataMetaInfo;
  13392. } else if (type === "hdfs" || type === "hbase") {
  13393. if (!(params.dataMetaInfo instanceof IPortalDataMetaInfoParam)) {
  13394. return this.getErrMsgPromise("params.dataMetaInfo is not instanceof iPortalDataMetaInfoParam !");
  13395. }
  13396. if (!(params.dataMetaInfo.dataStoreInfo instanceof IPortalDataStoreInfoParam)) {
  13397. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo is not instanceof iPortalDataStoreInfoParam !");
  13398. }
  13399. var dataStoreInfo = {
  13400. type: params.dataMetaInfo.dataStoreInfo.type
  13401. };
  13402. switch (type) {
  13403. case "hdfs":
  13404. dataStoreInfo.url = params.dataMetaInfo.dataStoreInfo.url;
  13405. dataMetaInfo = {
  13406. url: params.dataMetaInfo.url,
  13407. dataStoreInfo: dataStoreInfo
  13408. };
  13409. break;
  13410. case "hbase":
  13411. if (!(params.dataMetaInfo.dataStoreInfo.connectionInfo instanceof IPortalDataConnectionInfoParam)) {
  13412. return this.getErrMsgPromise("params.dataMetaInfo.dataStoreInfo.connectionInfo is not instanceof iPortalDataConnectionInfoParam !");
  13413. }
  13414. dataStoreInfo.connectionInfo = {
  13415. dataBase: params.dataMetaInfo.dataStoreInfo.connectionInfo.dataBase,
  13416. server: params.dataMetaInfo.dataStoreInfo.connectionInfo.server,
  13417. engineType: 'HBASE'
  13418. };
  13419. dataStoreInfo.datastoreType = "SPATIAL"; //该字段SPATIAL表示HBASE注册
  13420. dataMetaInfo = {
  13421. dataStoreInfo: dataStoreInfo
  13422. };
  13423. break;
  13424. }
  13425. entity.dataMetaInfo = dataMetaInfo;
  13426. }
  13427. return this.request("POST", datasUrl, JSON.stringify(entity)).then(function (res) {
  13428. if (type === "hdfs" || type === "hbase") {
  13429. return res;
  13430. } else {
  13431. if (res.childID) {
  13432. return _this2.uploadDataRequest(res.childID, formData);
  13433. } else {
  13434. return res.customResult;
  13435. }
  13436. }
  13437. });
  13438. }
  13439. /**
  13440. * @function SuperMap.iPortalUser.prototype.publishOrUnpublish
  13441. * @description 发布/取消发布。
  13442. * @version 10.1.0
  13443. * @param {object} options - 发布/取消发布数据服务所需的参数。
  13444. * @param {object} options.dataId - 数据项id。
  13445. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  13446. * @param {object} [options.dataServiceId] - 发布的服务 id。
  13447. * @param {boolean} forPublish - 是否取消发布。
  13448. * @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
  13449. */
  13450. }, {
  13451. key: "publishOrUnpublish",
  13452. value: function publishOrUnpublish(option, forPublish) {
  13453. if (!option.dataId || !option.serviceType) {
  13454. return this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
  13455. }
  13456. var dataId = option.dataId;
  13457. var dataServiceId = option.dataServiceId;
  13458. var serviceType = option.serviceType;
  13459. var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
  13460. if (dataServiceId) {
  13461. publishUrl += "&dataServiceId=" + dataServiceId;
  13462. }
  13463. return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
  13464. // 发起服务状态查询
  13465. if (forPublish) {
  13466. // 发布服务的结果异步处理
  13467. // var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
  13468. if (!dataServiceId) {
  13469. // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
  13470. dataServiceId = res.customResult;
  13471. }
  13472. return dataServiceId;
  13473. } else {
  13474. // 取消发布的结果同步处理
  13475. return res;
  13476. }
  13477. });
  13478. }
  13479. /**
  13480. * @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
  13481. * @description 查询服务状态,发起服务状态查询。
  13482. * @version 10.1.0
  13483. * @param {number} dataId - 查询服务状态的数据项id。
  13484. * @param {string} dataServiceId - 发布的服务id。
  13485. * @returns {Promise} 返回查询服务状态的 Promise 对象。
  13486. */
  13487. }, {
  13488. key: "getDataPublishedStatus",
  13489. value: function getDataPublishedStatus(dataId, dataServiceId) {
  13490. var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
  13491. return this.request("GET", publishStateUrl);
  13492. }
  13493. /**
  13494. * @function SuperMap.iPortalUser.prototype.unPublishedDataService
  13495. * @description 取消发布。
  13496. * @version 10.1.0
  13497. * @param {object} options - 取消发布服务具体参数。
  13498. * @param {object} options.dataId - 数据项id。
  13499. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  13500. * @param {object} [options.dataServiceId] - 发布的服务 id。
  13501. * @returns {Promise} 返回取消发布数据服务的 Promise 对象。
  13502. */
  13503. }, {
  13504. key: "unPublishDataService",
  13505. value: function unPublishDataService(option) {
  13506. return this.publishOrUnpublish(option, false);
  13507. }
  13508. /**
  13509. * @function SuperMap.iPortalUser.prototype.publishedDataService
  13510. * @description 发布数据服务。
  13511. * @version 10.1.0
  13512. * @param {object} options - 发布数据服务具体参数。
  13513. * @param {object} options.dataId - 数据项id。
  13514. * @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
  13515. * @param {object} [options.dataServiceId] - 发布的服务 id。
  13516. * @returns {Promise} 返回发布数据服务的 Promise 对象。
  13517. */
  13518. }, {
  13519. key: "publishDataService",
  13520. value: function publishDataService(option) {
  13521. return this.publishOrUnpublish(option, true);
  13522. }
  13523. }]);
  13524. return IPortalUser;
  13525. }(IPortalServiceBase);
  13526. SuperMap.iPortalUser = IPortalUser;
  13527. ;// CONCATENATED MODULE: ./src/common/iPortal/index.js
  13528. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13529. * This program are made available under the terms of the Apache License, Version 2.0
  13530. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13531. ;// CONCATENATED MODULE: ./src/common/iServer/CommonServiceBase.js
  13532. function CommonServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13533. 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); } }
  13534. function CommonServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  13535. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13536. * This program are made available under the terms of the Apache License, Version 2.0
  13537. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13538. /**
  13539. * @class SuperMap.CommonServiceBase
  13540. * @category iServer
  13541. * @classdesc 对接 iServer 各种服务的 Service 的基类。
  13542. * @param {string} url - 服务地址。
  13543. * @param {Object} options - 参数。
  13544. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  13545. * @param {string} [options.proxy] - 服务代理地址。
  13546. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  13547. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  13548. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  13549. * @param {Object} [options.headers] - 请求头。
  13550. */
  13551. var CommonServiceBase = /*#__PURE__*/function () {
  13552. function CommonServiceBase(url, options) {
  13553. CommonServiceBase_classCallCheck(this, CommonServiceBase);
  13554. var me = this;
  13555. this.EVENT_TYPES = ["processCompleted", "processFailed"];
  13556. this.events = null;
  13557. this.eventListeners = null;
  13558. this.url = null;
  13559. this.urls = null;
  13560. this.proxy = null;
  13561. this.serverType = null;
  13562. this.index = null;
  13563. this.length = null;
  13564. this.options = null;
  13565. this.totalTimes = null;
  13566. this.POLLING_TIMES = 3;
  13567. this._processSuccess = null;
  13568. this._processFailed = null;
  13569. this.isInTheSameDomain = null;
  13570. this.withCredentials = false;
  13571. if (Util.isArray(url)) {
  13572. me.urls = url;
  13573. me.length = url.length;
  13574. me.totalTimes = me.length;
  13575. if (me.length === 1) {
  13576. me.url = url[0];
  13577. } else {
  13578. me.index = parseInt(Math.random() * me.length);
  13579. me.url = url[me.index];
  13580. }
  13581. } else {
  13582. me.totalTimes = 1;
  13583. me.url = url;
  13584. }
  13585. if (Util.isArray(url) && !me.isServiceSupportPolling()) {
  13586. me.url = url[0];
  13587. me.totalTimes = 1;
  13588. }
  13589. me.serverType = me.serverType || ServerType.ISERVER;
  13590. options = options || {};
  13591. this.crossOrigin = options.crossOrigin;
  13592. this.headers = options.headers;
  13593. Util.extend(this, options);
  13594. me.isInTheSameDomain = Util.isInTheSameDomain(me.url);
  13595. me.events = new Events(me, null, me.EVENT_TYPES, true);
  13596. if (me.eventListeners instanceof Object) {
  13597. me.events.on(me.eventListeners);
  13598. }
  13599. this.CLASS_NAME = "SuperMap.CommonServiceBase";
  13600. }
  13601. /**
  13602. * @function SuperMap.CommonServiceBase.prototype.destroy
  13603. * @description 释放资源,将引用的资源属性置空。
  13604. */
  13605. CommonServiceBase_createClass(CommonServiceBase, [{
  13606. key: "destroy",
  13607. value: function destroy() {
  13608. var me = this;
  13609. if (Util.isArray(me.urls)) {
  13610. me.urls = null;
  13611. me.index = null;
  13612. me.length = null;
  13613. me.totalTimes = null;
  13614. }
  13615. me.url = null;
  13616. me.options = null;
  13617. me._processSuccess = null;
  13618. me._processFailed = null;
  13619. me.isInTheSameDomain = null;
  13620. me.EVENT_TYPES = null;
  13621. if (me.events) {
  13622. me.events.destroy();
  13623. me.events = null;
  13624. }
  13625. if (me.eventListeners) {
  13626. me.eventListeners = null;
  13627. }
  13628. }
  13629. /**
  13630. * @function SuperMap.CommonServiceBase.prototype.request
  13631. * @description: 该方法用于向服务发送请求。
  13632. * @param {Object} options - 参数。
  13633. * @param {string} [options.method='GET'] - 请求方式,包括 "GET","POST","PUT","DELETE"。
  13634. * @param {string} [options.url] - 发送请求的地址。
  13635. * @param {Object} [options.params] - 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
  13636. * @param {string} [options.data] - 发送到服务器的数据。
  13637. * @param {function} options.success - 请求成功后的回调函数。
  13638. * @param {function} options.failure - 请求失败后的回调函数。
  13639. * @param {Object} [options.scope] - 如果回调函数是对象的一个公共方法,设定该对象的范围。
  13640. * @param {boolean} [options.isInTheSameDomain] - 请求是否在当前域中。
  13641. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  13642. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  13643. * @param {Object} [options.headers] - 请求头。
  13644. */
  13645. }, {
  13646. key: "request",
  13647. value: function request(options) {
  13648. var me = this;
  13649. options.url = options.url || me.url;
  13650. options.proxy = options.proxy || me.proxy;
  13651. options.withCredentials = options.withCredentials != undefined ? options.withCredentials : me.withCredentials;
  13652. options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
  13653. options.headers = options.headers || me.headers;
  13654. options.isInTheSameDomain = me.isInTheSameDomain; //为url添加安全认证信息片段
  13655. var credential = this.getCredential(options.url);
  13656. if (credential) {
  13657. options.url = Util.urlAppend(options.url, credential.getUrlParameters());
  13658. }
  13659. me.calculatePollingTimes();
  13660. me._processSuccess = options.success;
  13661. me._processFailed = options.failure;
  13662. options.scope = me;
  13663. options.success = me.getUrlCompleted;
  13664. options.failure = me.getUrlFailed;
  13665. me.options = options;
  13666. me._commit(me.options);
  13667. }
  13668. /**
  13669. * @function SuperMap.CommonServiceBase.prototype.getCredential
  13670. * @description 获取凭据信息
  13671. * @param {string} url - 服务地址。
  13672. * @returns {SuperMap.Credential} 凭据信息对象。
  13673. */
  13674. }, {
  13675. key: "getCredential",
  13676. value: function getCredential(url) {
  13677. var keyUrl = url,
  13678. credential,
  13679. value;
  13680. switch (this.serverType) {
  13681. case ServerType.IPORTAL:
  13682. value = SecurityManager.getToken(keyUrl);
  13683. credential = value ? new Credential(value, "token") : null;
  13684. if (!credential) {
  13685. value = SecurityManager.getKey(keyUrl);
  13686. credential = value ? new Credential(value, "key") : null;
  13687. }
  13688. break;
  13689. case ServerType.ONLINE:
  13690. value = SecurityManager.getKey(keyUrl);
  13691. credential = value ? new Credential(value, "key") : null;
  13692. break;
  13693. default:
  13694. //iServer or others
  13695. value = SecurityManager.getToken(keyUrl);
  13696. credential = value ? new Credential(value, "token") : null;
  13697. break;
  13698. }
  13699. return credential;
  13700. }
  13701. /**
  13702. * @function SuperMap.CommonServiceBase.prototype.getUrlCompleted
  13703. * @description 请求成功后执行此方法。
  13704. * @param {Object} result - 服务器返回的结果对象。
  13705. */
  13706. }, {
  13707. key: "getUrlCompleted",
  13708. value: function getUrlCompleted(result) {
  13709. var me = this;
  13710. me._processSuccess(result);
  13711. }
  13712. /**
  13713. * @function SuperMap.CommonServiceBase.prototype.getUrlFailed
  13714. * @description 请求失败后执行此方法。
  13715. * @param {Object} result - 服务器返回的结果对象。
  13716. */
  13717. }, {
  13718. key: "getUrlFailed",
  13719. value: function getUrlFailed(result) {
  13720. var me = this;
  13721. if (me.totalTimes > 0) {
  13722. me.totalTimes--;
  13723. me.ajaxPolling();
  13724. } else {
  13725. me._processFailed(result);
  13726. }
  13727. }
  13728. /**
  13729. *
  13730. * @function SuperMap.CommonServiceBase.prototype.ajaxPolling
  13731. * @description 请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
  13732. */
  13733. }, {
  13734. key: "ajaxPolling",
  13735. value: function ajaxPolling() {
  13736. var me = this,
  13737. url = me.options.url,
  13738. re = /^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;
  13739. me.index = parseInt(Math.random() * me.length);
  13740. me.url = me.urls[me.index];
  13741. url = url.replace(re, re.exec(me.url)[0]);
  13742. me.options.url = url;
  13743. me.options.isInTheSameDomain = Util.isInTheSameDomain(url);
  13744. me._commit(me.options);
  13745. }
  13746. /**
  13747. * @function SuperMap.CommonServiceBase.prototype.calculatePollingTimes
  13748. * @description 计算剩余请求失败执行次数。
  13749. */
  13750. }, {
  13751. key: "calculatePollingTimes",
  13752. value: function calculatePollingTimes() {
  13753. var me = this;
  13754. if (me.times) {
  13755. if (me.totalTimes > me.POLLING_TIMES) {
  13756. if (me.times > me.POLLING_TIMES) {
  13757. me.totalTimes = me.POLLING_TIMES;
  13758. } else {
  13759. me.totalTimes = me.times;
  13760. }
  13761. } else {
  13762. if (me.times < me.totalTimes) {
  13763. me.totalTimes = me.times;
  13764. }
  13765. }
  13766. } else {
  13767. if (me.totalTimes > me.POLLING_TIMES) {
  13768. me.totalTimes = me.POLLING_TIMES;
  13769. }
  13770. }
  13771. me.totalTimes--;
  13772. }
  13773. /**
  13774. * @function SuperMap.CommonServiceBase.prototype.isServiceSupportPolling
  13775. * @description 判断服务是否支持轮询。
  13776. */
  13777. }, {
  13778. key: "isServiceSupportPolling",
  13779. value: function isServiceSupportPolling() {
  13780. var me = this;
  13781. return !(me.CLASS_NAME === "SuperMap.REST.ThemeService" || me.CLASS_NAME === "SuperMap.REST.EditFeaturesService");
  13782. }
  13783. /**
  13784. * @function SuperMap.CommonServiceBase.prototype.serviceProcessCompleted
  13785. * @description 状态完成,执行此方法。
  13786. * @param {Object} result - 服务器返回的结果对象。
  13787. */
  13788. }, {
  13789. key: "serviceProcessCompleted",
  13790. value: function serviceProcessCompleted(result) {
  13791. result = Util.transformResult(result);
  13792. this.events.triggerEvent("processCompleted", {
  13793. result: result
  13794. });
  13795. }
  13796. /**
  13797. * @function SuperMap.CommonServiceBase.prototype.serviceProcessFailed
  13798. * @description 状态失败,执行此方法。
  13799. * @param {Object} result - 服务器返回的结果对象。
  13800. */
  13801. }, {
  13802. key: "serviceProcessFailed",
  13803. value: function serviceProcessFailed(result) {
  13804. result = Util.transformResult(result);
  13805. var error = result.error || result;
  13806. this.events.triggerEvent("processFailed", {
  13807. error: error
  13808. });
  13809. }
  13810. }, {
  13811. key: "_commit",
  13812. value: function _commit(options) {
  13813. if (options.method === "POST" || options.method === "PUT") {
  13814. if (options.params) {
  13815. options.url = Util.urlAppend(options.url, Util.getParameterString(options.params || {}));
  13816. }
  13817. options.params = options.data;
  13818. }
  13819. FetchRequest.commit(options.method, options.url, options.params, {
  13820. headers: options.headers,
  13821. withCredentials: options.withCredentials,
  13822. crossOrigin: options.crossOrigin,
  13823. timeout: options.async ? 0 : null,
  13824. proxy: options.proxy
  13825. }).then(function (response) {
  13826. if (response.text) {
  13827. return response.text();
  13828. }
  13829. if (response.json) {
  13830. return response.json();
  13831. }
  13832. return response;
  13833. }).then(function (text) {
  13834. var result = text;
  13835. if (typeof text === "string") {
  13836. result = new JSONFormat().read(text);
  13837. }
  13838. if (!result || result.error || result.code >= 300 && result.code !== 304) {
  13839. if (result && result.error) {
  13840. result = {
  13841. error: result.error
  13842. };
  13843. } else {
  13844. result = {
  13845. error: result
  13846. };
  13847. }
  13848. }
  13849. if (result.error) {
  13850. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  13851. failure(result);
  13852. } else {
  13853. result.succeed = result.succeed == undefined ? true : result.succeed;
  13854. var success = options.scope ? FunctionExt.bind(options.success, options.scope) : options.success;
  13855. success(result);
  13856. }
  13857. })["catch"](function (e) {
  13858. var failure = options.scope ? FunctionExt.bind(options.failure, options.scope) : options.failure;
  13859. failure(e);
  13860. });
  13861. }
  13862. }]);
  13863. return CommonServiceBase;
  13864. }();
  13865. SuperMap.CommonServiceBase = CommonServiceBase;
  13866. /**
  13867. * 服务器请求回调函数
  13868. * @callback RequestCallback
  13869. * @example
  13870. * var requestCallback = function (serviceResult){
  13871. * console.log(serviceResult.result);
  13872. * }
  13873. * new QueryService(url).queryByBounds(param, requestCallback);
  13874. * @param {Object} serviceResult
  13875. * @param {Object} serviceResult.result 服务器返回结果。
  13876. * @param {Object} serviceResult.object 发布应用程序事件的对象。
  13877. * @param {Object} serviceResult.type 事件类型。
  13878. * @param {Object} serviceResult.element 接受浏览器事件的 DOM 节点。
  13879. */
  13880. ;// CONCATENATED MODULE: ./src/common/iServer/GeoCodingParameter.js
  13881. function GeoCodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13882. 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); } }
  13883. function GeoCodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoCodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoCodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  13884. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13885. * This program are made available under the terms of the Apache License, Version 2.0
  13886. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13887. /**
  13888. * @class SuperMap.GeoCodingParameter
  13889. * @category iServer AddressMatch
  13890. * @classdesc 地理正向匹配参数类。
  13891. * @param {Object} options - 参数。
  13892. * @param {string} options.address - 地点关键词。
  13893. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  13894. * @param {number} [options.toIndex] - 设置返回对象的结束索引值。
  13895. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  13896. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  13897. * @param {number} [options.maxReturn] - 最大返回结果数。
  13898. */
  13899. var GeoCodingParameter = /*#__PURE__*/function () {
  13900. function GeoCodingParameter(options) {
  13901. GeoCodingParameter_classCallCheck(this, GeoCodingParameter);
  13902. if (options.filters && typeof options.filters === 'string') {
  13903. options.filters = options.filters.split(',');
  13904. }
  13905. /**
  13906. * @member {string} SuperMap.GeoCodingParameter.prototype.address
  13907. * @description 地点关键词。
  13908. */
  13909. this.address = null;
  13910. /**
  13911. * @member {number} [SuperMap.GeoCodingParameter.prototype.fromIndex]
  13912. * @description 设置返回对象的起始索引值。
  13913. */
  13914. this.fromIndex = null;
  13915. /**
  13916. * @member {number} [SuperMap.GeoCodingParameter.prototype.toIndex]
  13917. * @description 设置返回对象的结束索引值。
  13918. */
  13919. this.toIndex = null;
  13920. /**
  13921. * @member {Array.<string>} [SuperMap.GeoCodingParameter.prototype.filters]
  13922. * @description 过滤字段,限定查询区域。
  13923. */
  13924. this.filters = null;
  13925. /**
  13926. * @member {string} [SuperMap.GeoCodingParameter.prototype.prjCoordSys]
  13927. * @description 查询结果的坐标系。
  13928. */
  13929. this.prjCoordSys = null;
  13930. /**
  13931. * @member {number} [SuperMap.GeoCodingParameter.prototype.maxReturn]
  13932. * @description 最大返回结果数。
  13933. */
  13934. this.maxReturn = null;
  13935. Util.extend(this, options);
  13936. }
  13937. /**
  13938. * @function SuperMap.GeoCodingParameter.prototype.destroy
  13939. * @description 释放资源,将引用资源的属性置空。
  13940. */
  13941. GeoCodingParameter_createClass(GeoCodingParameter, [{
  13942. key: "destroy",
  13943. value: function destroy() {
  13944. this.address = null;
  13945. this.fromIndex = null;
  13946. this.toIndex = null;
  13947. this.filters = null;
  13948. this.prjCoordSys = null;
  13949. this.maxReturn = null;
  13950. }
  13951. }]);
  13952. return GeoCodingParameter;
  13953. }();
  13954. SuperMap.GeoCodingParameter = GeoCodingParameter;
  13955. ;// CONCATENATED MODULE: ./src/common/iServer/GeoDecodingParameter.js
  13956. function GeoDecodingParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  13957. 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); } }
  13958. function GeoDecodingParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoDecodingParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoDecodingParameter_defineProperties(Constructor, staticProps); return Constructor; }
  13959. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  13960. * This program are made available under the terms of the Apache License, Version 2.0
  13961. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  13962. /**
  13963. * @class SuperMap.GeoDecodingParameter
  13964. * @category iServer AddressMatch
  13965. * @classdesc 地理反向匹配参数类。
  13966. * @param {Object} options - 参数。
  13967. * @param {number} options.x - 查询位置的横坐标。
  13968. * @param {number} options.y - 查询位置的纵坐标。
  13969. * @param {number} [options.fromIndex] - 设置返回对象的起始索引值。
  13970. * @param {Array.<string>} [options.filters] - 过滤字段,限定查询区域。
  13971. * @param {string} [options.prjCoordSys] - 查询结果的坐标系。
  13972. * @param {number} [options.maxReturn] - 最大返回结果数。
  13973. * @param {number} [options.geoDecodingRadius] - 查询半径。
  13974. */
  13975. var GeoDecodingParameter = /*#__PURE__*/function () {
  13976. function GeoDecodingParameter(options) {
  13977. GeoDecodingParameter_classCallCheck(this, GeoDecodingParameter);
  13978. if (options.filters) {
  13979. options.filters = options.filters.split(',');
  13980. }
  13981. /**
  13982. * @member {number} SuperMap.GeoDecodingParameter.prototype.x
  13983. * @description 查询位置的横坐标。
  13984. */
  13985. this.x = null;
  13986. /**
  13987. * @member {number} SuperMap.GeoDecodingParameter.prototype.y
  13988. * @description 查询位置的纵坐标。
  13989. */
  13990. this.y = null;
  13991. /**
  13992. * @member {number} [SuperMap.GeoDecodingParameter.prototype.fromIndex]
  13993. * @description 设置返回对象的起始索引值。
  13994. */
  13995. this.fromIndex = null;
  13996. /**
  13997. * @member {number} [SuperMap.GeoDecodingParameter.prototype.toIndex]
  13998. * @description 设置返回对象的结束索引值。
  13999. */
  14000. this.toIndex = null;
  14001. /**
  14002. * @member {Array.<string>} [SuperMap.GeoDecodingParameter.prototype.filters]
  14003. * @description 过滤字段,限定查询区域。
  14004. */
  14005. this.filters = null;
  14006. /**
  14007. * @member {string} [SuperMap.GeoDecodingParameter.prototype.prjCoordSys]
  14008. * @description 查询结果的坐标系。
  14009. */
  14010. this.prjCoordSys = null;
  14011. /**
  14012. * @member {number} [SuperMap.GeoDecodingParameter.prototype.maxReturn]
  14013. * @description 最大返回结果数。
  14014. */
  14015. this.maxReturn = null;
  14016. /**
  14017. * @member {number} SuperMap.GeoDecodingParameter.prototype.geoDecodingRadius
  14018. * @description 查询半径。
  14019. */
  14020. this.geoDecodingRadius = null;
  14021. Util.extend(this, options);
  14022. }
  14023. /**
  14024. * @function SuperMap.GeoDecodingParameter.prototype.destroy
  14025. * @description 释放资源,将引用资源的属性置空。
  14026. */
  14027. GeoDecodingParameter_createClass(GeoDecodingParameter, [{
  14028. key: "destroy",
  14029. value: function destroy() {
  14030. this.x = null;
  14031. this.y = null;
  14032. this.fromIndex = null;
  14033. this.toIndex = null;
  14034. this.filters = null;
  14035. this.prjCoordSys = null;
  14036. this.maxReturn = null;
  14037. this.geoDecodingRadius = null;
  14038. }
  14039. }]);
  14040. return GeoDecodingParameter;
  14041. }();
  14042. SuperMap.GeoDecodingParameter = GeoDecodingParameter;
  14043. ;// CONCATENATED MODULE: ./src/common/iServer/AddressMatchService.js
  14044. function AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AddressMatchService_typeof(obj); }
  14045. function AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14046. 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); } }
  14047. function AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  14048. function AddressMatchService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { AddressMatchService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return AddressMatchService_get(target, property, receiver || target); }
  14049. function AddressMatchService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AddressMatchService_getPrototypeOf(object); if (object === null) break; } return object; }
  14050. 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 } }); if (superClass) AddressMatchService_setPrototypeOf(subClass, superClass); }
  14051. function AddressMatchService_setPrototypeOf(o, p) { AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AddressMatchService_setPrototypeOf(o, p); }
  14052. 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); }; }
  14053. function AddressMatchService_possibleConstructorReturn(self, call) { if (call && (AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return AddressMatchService_assertThisInitialized(self); }
  14054. function AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14055. function AddressMatchService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  14056. function AddressMatchService_getPrototypeOf(o) { AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AddressMatchService_getPrototypeOf(o); }
  14057. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14058. * This program are made available under the terms of the Apache License, Version 2.0
  14059. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14060. /**
  14061. * @class SuperMap.AddressMatchService
  14062. * @category iServer AddressMatch
  14063. * @classdesc 地址匹配服务,包括正向匹配和反向匹配。
  14064. * @param {string} url - 地址匹配服务地址。
  14065. * @param {Object} options - 参数。
  14066. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14067. * @param {Object} [options.headers] - 请求头。
  14068. */
  14069. var AddressMatchService_AddressMatchService = /*#__PURE__*/function (_CommonServiceBase) {
  14070. AddressMatchService_inherits(AddressMatchService, _CommonServiceBase);
  14071. var _super = AddressMatchService_createSuper(AddressMatchService);
  14072. function AddressMatchService(url, options) {
  14073. var _this;
  14074. AddressMatchService_classCallCheck(this, AddressMatchService);
  14075. _this = _super.call(this, url, options);
  14076. _this.options = options || {};
  14077. _this.CLASS_NAME = 'SuperMap.AddressMatchService';
  14078. return _this;
  14079. }
  14080. /**
  14081. * @function SuperMap.AddressMatchService.prototype.destroy
  14082. * @override
  14083. */
  14084. AddressMatchService_createClass(AddressMatchService, [{
  14085. key: "destroy",
  14086. value: function destroy() {
  14087. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "destroy", this).call(this);
  14088. }
  14089. /**
  14090. * @function SuperMap.AddressMatchService.prototype.code
  14091. * @param {string} url - 正向地址匹配服务地址。
  14092. * @param {SuperMap.GeoCodingParameter} params - 正向地址匹配服务参数。
  14093. */
  14094. }, {
  14095. key: "code",
  14096. value: function code(url, params) {
  14097. if (!(params instanceof GeoCodingParameter)) {
  14098. return;
  14099. }
  14100. this.processAsync(url, params);
  14101. }
  14102. /**
  14103. * @function SuperMap.AddressMatchService.prototype.decode
  14104. * @param {string} url - 反向地址匹配服务地址。
  14105. * @param {SuperMap.GeoDecodingParameter} params - 反向地址匹配服务参数。
  14106. */
  14107. }, {
  14108. key: "decode",
  14109. value: function decode(url, params) {
  14110. if (!(params instanceof GeoDecodingParameter)) {
  14111. return;
  14112. }
  14113. this.processAsync(url, params);
  14114. }
  14115. /**
  14116. * @function SuperMap.AddressMatchService.prototype.processAsync
  14117. * @description 负责将客户端的动态分段服务参数传递到服务端。
  14118. * @param {string} url - 服务地址。
  14119. * @param {Object} params - 参数。
  14120. */
  14121. }, {
  14122. key: "processAsync",
  14123. value: function processAsync(url, params) {
  14124. this.request({
  14125. method: 'GET',
  14126. url: url,
  14127. params: params,
  14128. scope: this,
  14129. success: this.serviceProcessCompleted,
  14130. failure: this.serviceProcessFailed
  14131. });
  14132. }
  14133. /**
  14134. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  14135. * @param {Object} result - 服务器返回的结果对象。
  14136. * @description 服务流程是否完成
  14137. */
  14138. }, {
  14139. key: "serviceProcessCompleted",
  14140. value: function serviceProcessCompleted(result) {
  14141. if (result.succeed) {
  14142. delete result.succeed;
  14143. }
  14144. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessCompleted", this).call(this, result);
  14145. }
  14146. /**
  14147. * @function SuperMap.AddressMatchService.prototype.serviceProcessCompleted
  14148. * @param {Object} result - 服务器返回的结果对象。
  14149. * @description 服务流程是否失败
  14150. */
  14151. }, {
  14152. key: "serviceProcessFailed",
  14153. value: function serviceProcessFailed(result) {
  14154. AddressMatchService_get(AddressMatchService_getPrototypeOf(AddressMatchService.prototype), "serviceProcessFailed", this).call(this, result);
  14155. }
  14156. }]);
  14157. return AddressMatchService;
  14158. }(CommonServiceBase);
  14159. SuperMap.AddressMatchService = AddressMatchService_AddressMatchService;
  14160. ;// CONCATENATED MODULE: ./src/common/iServer/AggQueryBuilderParameter.js
  14161. function AggQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14162. function AggQueryBuilderParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  14163. function AggQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14164. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14165. * This program are made available under the terms of the Apache License, Version 2.0
  14166. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14167. /**
  14168. * @class SuperMap.AggQueryBuilderParameter
  14169. * @classdesc 聚合查询 QueryBuilder 参数基类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  14170. * @category iServer Data FeatureResults
  14171. * @param {Object} option - 初始化参数。
  14172. * @param {string} option.name - 查询结果名称。
  14173. * @param {SuperMap.AggregationQueryBuilderType} option.queryType - 查询类型。
  14174. */
  14175. var AggQueryBuilderParameter = /*#__PURE__*/function () {
  14176. function AggQueryBuilderParameter(option) {
  14177. AggQueryBuilderParameter_classCallCheck(this, AggQueryBuilderParameter);
  14178. /**
  14179. * @member {string} SuperMap.AggQueryBuilderParameter.prototype.name
  14180. * @description 查询结果名称。
  14181. */
  14182. this.name = null;
  14183. /**
  14184. * @member {SuperMap.AggregationQueryBuilderType} SuperMap.AggQueryBuilderParameter.prototype.queryType
  14185. * @description 查询类型。
  14186. */
  14187. this.queryType = null;
  14188. this.CLASS_NAME = "SuperMap.AggQueryBuilderParameter";
  14189. Util.extend(this, option);
  14190. }
  14191. AggQueryBuilderParameter_createClass(AggQueryBuilderParameter, [{
  14192. key: "destroy",
  14193. value: function destroy() {
  14194. var me = this;
  14195. me.name = null;
  14196. me.queryType = null;
  14197. }
  14198. }]);
  14199. return AggQueryBuilderParameter;
  14200. }();
  14201. SuperMap.AggQueryBuilderParameter = AggQueryBuilderParameter;
  14202. ;// CONCATENATED MODULE: ./src/common/iServer/AggregationParameter.js
  14203. function AggregationParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14204. 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); } }
  14205. function AggregationParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) AggregationParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) AggregationParameter_defineProperties(Constructor, staticProps); return Constructor; }
  14206. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14207. * This program are made available under the terms of the Apache License, Version 2.0
  14208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14209. /**
  14210. * @class SuperMap.AggregationParameter
  14211. * @classdesc 聚合查询参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  14212. * @category iServer Data FeatureResults
  14213. * @param {Object} options - 初始化参数。
  14214. * @param {string} options.aggName - 聚合名称。
  14215. * @param {SuperMap.AggregationType} options.aggType - 聚合类型设置。
  14216. * @param {string} options.aggFieldName - 聚合字段。
  14217. * @param {SuperMap.AggregationParameter} options.subAgg - 子聚合类。
  14218. *
  14219. */
  14220. var AggregationParameter = /*#__PURE__*/function () {
  14221. function AggregationParameter(options) {
  14222. AggregationParameter_classCallCheck(this, AggregationParameter);
  14223. /**
  14224. * @member {string} SuperMap.AggregationParameter.prototype.aggName
  14225. * @description 聚合名称。
  14226. */
  14227. this.aggName = null;
  14228. /**
  14229. * @member {SuperMap.AggregationType} SuperMap.AggregationParameter.prototype.aggType
  14230. * @description 聚合类型设置类。
  14231. */
  14232. this.aggType = null;
  14233. /**
  14234. * @member {string} SuperMap.AggregationParameter.prototype.aggFieldName
  14235. * @description 聚合字段。
  14236. */
  14237. this.aggFieldName = null;
  14238. /**
  14239. * @member {SuperMap.AggregationParameter} SuperMap.AggregationParameter.prototype.subAgg
  14240. * @description 子聚合。
  14241. */
  14242. this.subAgg = null;
  14243. this.CLASS_NAME = "SuperMap.AggregationParameter";
  14244. Util.extend(this, options);
  14245. }
  14246. AggregationParameter_createClass(AggregationParameter, [{
  14247. key: "destroy",
  14248. value: function destroy() {
  14249. var me = this;
  14250. me.aggName = null;
  14251. me.aggFieldName = null;
  14252. me.aggType = null;
  14253. if (me.subAgg) {
  14254. me.subAgg = null;
  14255. }
  14256. }
  14257. }]);
  14258. return AggregationParameter;
  14259. }();
  14260. SuperMap.AggregationParameter = AggregationParameter;
  14261. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationParameters.js
  14262. function AreaSolarRadiationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14263. 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); } }
  14264. function AreaSolarRadiationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  14265. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14266. * This program are made available under the terms of the Apache License, Version 2.0
  14267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14268. /**
  14269. * @class SuperMap.AreaSolarRadiationParameters
  14270. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  14271. * @classdesc 地区太阳辐射参数类。
  14272. * @param {Object} options - 参数。
  14273. * @param {string} options.dataset - 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"的形式来表示,例如:JingjinTerrain@Jingjin。
  14274. * @param {string} options.targetDatasourceName - 指定的存储结果数据集的数据源名称, 例如:"Jingjin"。
  14275. * @param {string} options.totalGridName - 指定地区太阳辐射总辐射量数据集的名称。
  14276. * @param {string} options.diffuseDatasetGridName - 指定地区太阳辐射散射辐射量数据集的名称。
  14277. * @param {string} options.durationDatasetGridName - 指定地区太阳辐射太阳直射持续时间数据集的名称。
  14278. * @param {string} options.directDatasetGridName - 指定地区太阳辐射直射辐射量数据集的名称。
  14279. * @param {number} options.latitude - 待计算区域的纬度值。
  14280. * @param {string} [options.timeMode = 'MULTIDAYS'] - 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  14281. * @param {number} options.dayStart - 起始日期(年内的第几天)。
  14282. * @param {number} options.dayEnd - 结束日期(年内的第几天)。
  14283. * @param {number} [options.hourStart] - 起始时间(一天中的第几个小时)。
  14284. * @param {number} [options.hourEnd] - 结束时间(一天中的第几个小时)。
  14285. * @param {number} [options.transmittance] - 太阳辐射穿过大气的透射率。
  14286. * @param {number} [options.hourInterval=0.5] - 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确,如果修改此参数,必须使用整数)。
  14287. * @param {number} [options.dayInterval=5] - 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确,必须使用整数)。
  14288. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  14289. */
  14290. var AreaSolarRadiationParameters = /*#__PURE__*/function () {
  14291. function AreaSolarRadiationParameters(options) {
  14292. AreaSolarRadiationParameters_classCallCheck(this, AreaSolarRadiationParameters);
  14293. /**
  14294. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.dataset
  14295. * @description 要用来做地区太阳辐射数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示,例如:JingjinTerrain@Jingjin。注:地区太阳辐射数据必须为栅格数据集。
  14296. */
  14297. this.dataset = null;
  14298. /**
  14299. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.targetDatasourceName
  14300. * @description 指定的存储结果数据集的数据源名称,例如:"Jingjin"。
  14301. */
  14302. this.targetDatasourceName = null;
  14303. /**
  14304. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.totalGridName
  14305. * @description 指定地区太阳辐射总辐射量数据集的名称。
  14306. */
  14307. this.totalGridName = null;
  14308. /**
  14309. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.diffuseDatasetGridName
  14310. * @description 指定地区太阳辐射散射辐射量数据集的名称。
  14311. */
  14312. this.diffuseDatasetGridName = null;
  14313. /**
  14314. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  14315. * @description 指定地区太阳辐射太阳直射持续时间数据集的名称。
  14316. */
  14317. this.durationDatasetGridName = null;
  14318. /**
  14319. * @member {string} SuperMap.AreaSolarRadiationParameters.prototype.durationDatasetGridName
  14320. * @description 指定地区太阳辐射直射辐射量数据集的名称。
  14321. */
  14322. this.directDatasetGridName = null;
  14323. /**
  14324. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.latitude
  14325. * @description 待计算区域的纬度值。
  14326. */
  14327. this.latitude = null;
  14328. /**
  14329. * @member {string} [SuperMap.AreaSolarRadiationParameters.prototype.timeMode='MULTIDAYS']
  14330. * @description 时间模式。可选值"WITHINDAY"(单日)或"MULTIDAYS"(多日)。
  14331. */
  14332. this.timeMode = "MULTIDAYS";
  14333. /**
  14334. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayStart
  14335. * @description 起始日期(年内的第几天)。
  14336. */
  14337. this.dayStart = null;
  14338. /**
  14339. * @member {number} SuperMap.AreaSolarRadiationParameters.prototype.dayEnd
  14340. * @description 结束日期(年内的第几天)。
  14341. */
  14342. this.dayEnd = null;
  14343. /**
  14344. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourStart]
  14345. * @description 起始时间(一天中的第几个小时)。
  14346. */
  14347. this.hourStart = null;
  14348. /**
  14349. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourEnd]
  14350. * @description 结束时间(一天中的第几个小时)。
  14351. */
  14352. this.hourEnd = null;
  14353. /**
  14354. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.transmittance]
  14355. * @description 太阳辐射穿过大气的透射率。
  14356. */
  14357. this.transmittance = null;
  14358. /**
  14359. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.hourInterval=0.5]
  14360. * @description 计算时的小时间隔(设置的越小计算量越大并且计算结果更精确, 如果修改此参数,必须使用整数)
  14361. */
  14362. this.hourInterval = null;
  14363. /**
  14364. * @member {number} [SuperMap.AreaSolarRadiationParameters.prototype.dayInterval=5]
  14365. * @description 计算时的天数间隔(设置的越小计算量越大并且计算结果更精确, 必须使用整数)
  14366. */
  14367. this.dayInterval = null;
  14368. /**
  14369. * @member {boolean} [SuperMap.AreaSolarRadiationParameters.prototype.deleteExistResultDataset=false]
  14370. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  14371. */
  14372. this.deleteExistResultDataset = false;
  14373. Util.extend(this, options);
  14374. this.CLASS_NAME = "SuperMap.AreaSolarRadiationParameters";
  14375. }
  14376. /**
  14377. * @function SuperMap.AreaSolarRadiationParameters.prototype.destroy
  14378. * @description 释放资源,将引用资源的属性置空。
  14379. */
  14380. AreaSolarRadiationParameters_createClass(AreaSolarRadiationParameters, [{
  14381. key: "destroy",
  14382. value: function destroy() {
  14383. var me = this;
  14384. me.dataset = null;
  14385. me.zFactor = 1.0;
  14386. me.averageCurvatureName = null;
  14387. me.profileCurvatureName = null;
  14388. me.planCurvatureName = null;
  14389. me.deleteExistResultDataset = true;
  14390. }
  14391. /**
  14392. * @function SuperMap.AreaSolarRadiationParameters.toObject
  14393. * @param {SuperMap.AreaSolarRadiationParameters} param - 地区太阳辐射参数类。
  14394. * @param {SuperMap.AreaSolarRadiationParameters} tempObj - 地区太阳辐射参数对象。
  14395. * @returns {Object} JSON对象。
  14396. * @description 将SuperMap.AreaSolarRadiationParameters对象转换成JSON对象。
  14397. */
  14398. }], [{
  14399. key: "toObject",
  14400. value: function toObject(param, tempObj) {
  14401. var parameter = {};
  14402. for (var name in param) {
  14403. if (name !== "dataset") {
  14404. var name1 = name === "latitude" || name === "timeMode" || name === "dayStart";
  14405. var name2 = name === "dayEnd" || name === "hourStart" || name === "hourEnd";
  14406. var name3 = name === "transmittance" || name === "hourInterval" || name === "dayInterval";
  14407. if (name1 || name2 || name3) {
  14408. parameter[name] = param[name];
  14409. } else {
  14410. tempObj[name] = param[name];
  14411. }
  14412. }
  14413. }
  14414. tempObj["parameter"] = parameter;
  14415. }
  14416. }]);
  14417. return AreaSolarRadiationParameters;
  14418. }();
  14419. SuperMap.AreaSolarRadiationParameters = AreaSolarRadiationParameters;
  14420. ;// CONCATENATED MODULE: ./src/common/iServer/SpatialAnalystBase.js
  14421. function SpatialAnalystBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SpatialAnalystBase_typeof = function _typeof(obj) { return typeof obj; }; } else { SpatialAnalystBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SpatialAnalystBase_typeof(obj); }
  14422. function SpatialAnalystBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14423. 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); } }
  14424. function SpatialAnalystBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystBase_defineProperties(Constructor, staticProps); return Constructor; }
  14425. function SpatialAnalystBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SpatialAnalystBase_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SpatialAnalystBase_get(target, property, receiver || target); }
  14426. function SpatialAnalystBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SpatialAnalystBase_getPrototypeOf(object); if (object === null) break; } return object; }
  14427. 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 } }); if (superClass) SpatialAnalystBase_setPrototypeOf(subClass, superClass); }
  14428. function SpatialAnalystBase_setPrototypeOf(o, p) { SpatialAnalystBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystBase_setPrototypeOf(o, p); }
  14429. 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); }; }
  14430. function SpatialAnalystBase_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystBase_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystBase_assertThisInitialized(self); }
  14431. function SpatialAnalystBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14432. function SpatialAnalystBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  14433. function SpatialAnalystBase_getPrototypeOf(o) { SpatialAnalystBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystBase_getPrototypeOf(o); }
  14434. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14435. * This program are made available under the terms of the Apache License, Version 2.0
  14436. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14437. /**
  14438. * @class SuperMap.SpatialAnalystBase
  14439. * @category iServer SpatialAnalyst
  14440. * @classdesc 空间分析服务基类。
  14441. * @param {string} url - 地址。
  14442. * @param {Object} options - 参数。
  14443. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14444. * @param {Object} [options.headers] - 请求头。
  14445. * @extends {SuperMap.CommonServiceBase}
  14446. */
  14447. var SpatialAnalystBase = /*#__PURE__*/function (_CommonServiceBase) {
  14448. SpatialAnalystBase_inherits(SpatialAnalystBase, _CommonServiceBase);
  14449. var _super = SpatialAnalystBase_createSuper(SpatialAnalystBase);
  14450. function SpatialAnalystBase(url, options) {
  14451. var _this;
  14452. SpatialAnalystBase_classCallCheck(this, SpatialAnalystBase);
  14453. _this = _super.call(this, url, options);
  14454. /**
  14455. * @member {SuperMap.DataFormat} [SuperMap.SpatialAnalystBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  14456. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"。
  14457. */
  14458. _this.format = DataFormat.GEOJSON;
  14459. _this.CLASS_NAME = "SuperMap.SpatialAnalystBase";
  14460. return _this;
  14461. }
  14462. /**
  14463. * @function SuperMap.SpatialAnalystBase.prototype.destroy
  14464. * @override
  14465. */
  14466. SpatialAnalystBase_createClass(SpatialAnalystBase, [{
  14467. key: "destroy",
  14468. value: function destroy() {
  14469. SpatialAnalystBase_get(SpatialAnalystBase_getPrototypeOf(SpatialAnalystBase.prototype), "destroy", this).call(this);
  14470. this.format = null;
  14471. }
  14472. /**
  14473. * @function SuperMap.SpatialAnalystBase.prototype.serviceProcessCompleted
  14474. * @description 分析完成,执行此方法。
  14475. * @param {Object} result - 服务器返回的结果对象。
  14476. */
  14477. }, {
  14478. key: "serviceProcessCompleted",
  14479. value: function serviceProcessCompleted(result) {
  14480. var me = this,
  14481. analystResult;
  14482. result = Util.transformResult(result);
  14483. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  14484. //批量分析时会返回多个结果
  14485. if (Util.isArray(result)) {
  14486. for (var i = 0; i < result.length; i++) {
  14487. result[i] = me.toGeoJSONResult(result[i]);
  14488. }
  14489. analystResult = result;
  14490. } else {
  14491. analystResult = me.toGeoJSONResult(result);
  14492. }
  14493. }
  14494. if (!analystResult) {
  14495. analystResult = result;
  14496. }
  14497. me.events.triggerEvent("processCompleted", {
  14498. result: analystResult
  14499. });
  14500. }
  14501. /**
  14502. * @function SuperMap.SpatialAnalystBase.prototype.toGeoJSONResult
  14503. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  14504. * @param {Object} result - 服务器返回的结果对象。
  14505. *
  14506. */
  14507. }, {
  14508. key: "toGeoJSONResult",
  14509. value: function toGeoJSONResult(result) {
  14510. if (!result) {
  14511. return null;
  14512. } //批量叠加分析时结果这样处理
  14513. if (result.result && result.result.resultGeometry) {
  14514. result = result.result;
  14515. }
  14516. var geoJSONFormat = new GeoJSON();
  14517. if (result.recordsets) {
  14518. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  14519. if (recordsets[i].features) {
  14520. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  14521. }
  14522. }
  14523. } else if (result.recordset && result.recordset.features) {
  14524. result.recordset.features = geoJSONFormat.toGeoJSON(result.recordset.features);
  14525. }
  14526. if (result.resultGeometry) {
  14527. result.resultGeometry = geoJSONFormat.toGeoJSON(result.resultGeometry);
  14528. }
  14529. if (result.regions) {
  14530. result.regions = geoJSONFormat.toGeoJSON(result.regions);
  14531. }
  14532. return result;
  14533. }
  14534. }]);
  14535. return SpatialAnalystBase;
  14536. }(CommonServiceBase);
  14537. SuperMap.SpatialAnalystBase = SpatialAnalystBase;
  14538. ;// CONCATENATED MODULE: ./src/common/iServer/AreaSolarRadiationService.js
  14539. function AreaSolarRadiationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AreaSolarRadiationService_typeof = function _typeof(obj) { return typeof obj; }; } else { AreaSolarRadiationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AreaSolarRadiationService_typeof(obj); }
  14540. function AreaSolarRadiationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14541. 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); } }
  14542. function AreaSolarRadiationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) AreaSolarRadiationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) AreaSolarRadiationService_defineProperties(Constructor, staticProps); return Constructor; }
  14543. function AreaSolarRadiationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { AreaSolarRadiationService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return AreaSolarRadiationService_get(target, property, receiver || target); }
  14544. function AreaSolarRadiationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = AreaSolarRadiationService_getPrototypeOf(object); if (object === null) break; } return object; }
  14545. 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 } }); if (superClass) AreaSolarRadiationService_setPrototypeOf(subClass, superClass); }
  14546. function AreaSolarRadiationService_setPrototypeOf(o, p) { AreaSolarRadiationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AreaSolarRadiationService_setPrototypeOf(o, p); }
  14547. 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); }; }
  14548. function AreaSolarRadiationService_possibleConstructorReturn(self, call) { if (call && (AreaSolarRadiationService_typeof(call) === "object" || typeof call === "function")) { return call; } return AreaSolarRadiationService_assertThisInitialized(self); }
  14549. function AreaSolarRadiationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  14550. function AreaSolarRadiationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  14551. function AreaSolarRadiationService_getPrototypeOf(o) { AreaSolarRadiationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AreaSolarRadiationService_getPrototypeOf(o); }
  14552. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14553. * This program are made available under the terms of the Apache License, Version 2.0
  14554. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14555. /**
  14556. * @class SuperMap.AreaSolarRadiationService
  14557. * @category iServer SpatialAnalyst SolarRadiationAnalyst
  14558. * @classdesc 地区太阳辐射服务类。
  14559. * @param {string} url - 服务的访问地址。如:</br>http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst。</br>
  14560. * @param {Object} options - 参数。</br>
  14561. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  14562. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  14563. * @param {Object} [options.headers] - 请求头。
  14564. * @extends {SuperMap.SpatialAnalystBase}
  14565. * @example 例如:
  14566. * (start code)
  14567. * var myAreaSolarRadiationService = new SuperMap.AreaSolarRadiationService(url);
  14568. * myAreaSolarRadiationService.on({
  14569. * "processCompleted": processCompleted,
  14570. * "processFailed": processFailed
  14571. * }
  14572. * );
  14573. * (end)
  14574. *
  14575. */
  14576. var AreaSolarRadiationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  14577. AreaSolarRadiationService_inherits(AreaSolarRadiationService, _SpatialAnalystBase);
  14578. var _super = AreaSolarRadiationService_createSuper(AreaSolarRadiationService);
  14579. function AreaSolarRadiationService(url, options) {
  14580. var _this;
  14581. AreaSolarRadiationService_classCallCheck(this, AreaSolarRadiationService);
  14582. _this = _super.call(this, url, options);
  14583. _this.CLASS_NAME = "SuperMap.AreaSolarRadiationService";
  14584. return _this;
  14585. }
  14586. /**
  14587. * @function SuperMap.AreaSolarRadiationService.prototype.destroy
  14588. * @override
  14589. */
  14590. AreaSolarRadiationService_createClass(AreaSolarRadiationService, [{
  14591. key: "destroy",
  14592. value: function destroy() {
  14593. AreaSolarRadiationService_get(AreaSolarRadiationService_getPrototypeOf(AreaSolarRadiationService.prototype), "destroy", this).call(this);
  14594. }
  14595. /**
  14596. * @function SuperMap.AreaSolarRadiationService.prototype.processAsync
  14597. * @description 负责将客户端的查询参数传递到服务端。
  14598. * @param {SuperMap.AreaSolarRadiationParameters} parameter - 地区太阳辐射参数。
  14599. */
  14600. }, {
  14601. key: "processAsync",
  14602. value: function processAsync(parameter) {
  14603. if (!(parameter instanceof AreaSolarRadiationParameters)) {
  14604. return;
  14605. }
  14606. var me = this;
  14607. var parameterObject = {};
  14608. if (parameter instanceof AreaSolarRadiationParameters) {
  14609. me.url = Util.urlPathAppend(me.url, "datasets/".concat(parameter.dataset, "/solarradiation"));
  14610. }
  14611. me.url = Util.urlAppend(me.url, 'returnContent=true');
  14612. AreaSolarRadiationParameters.toObject(parameter, parameterObject);
  14613. var jsonParameters = Util.toJSON(parameterObject);
  14614. me.request({
  14615. method: 'POST',
  14616. data: jsonParameters,
  14617. scope: me,
  14618. success: me.serviceProcessCompleted,
  14619. failure: me.serviceProcessFailed
  14620. });
  14621. }
  14622. }]);
  14623. return AreaSolarRadiationService;
  14624. }(SpatialAnalystBase);
  14625. SuperMap.AreaSolarRadiationService = AreaSolarRadiationService;
  14626. ;// CONCATENATED MODULE: ./src/common/iServer/BufferDistance.js
  14627. function BufferDistance_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14628. 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); } }
  14629. function BufferDistance_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferDistance_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferDistance_defineProperties(Constructor, staticProps); return Constructor; }
  14630. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14631. * This program are made available under the terms of the Apache License, Version 2.0
  14632. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14633. /**
  14634. * @class SuperMap.BufferDistance
  14635. * @category iServer SpatialAnalyst BufferAnalyst
  14636. * @classdesc 缓冲区分析的缓冲距离类。通过该类可以设置缓冲区分析的缓冲距离,距离可以是数值也可以是数值型的字段表达式。
  14637. * @param {Object} options - 参数。
  14638. * @param {string} [options.exp] - 以数值型的字段表达式作为缓冲区分析的距离值。
  14639. * @param {number} [options.value=100] - 以数值作为缓冲区分析的距离值。单位:米。
  14640. */
  14641. var BufferDistance = /*#__PURE__*/function () {
  14642. function BufferDistance(options) {
  14643. BufferDistance_classCallCheck(this, BufferDistance);
  14644. /**
  14645. * @member {string} [SuperMap.BufferDistance.prototype.exp]
  14646. * @description 以数值型的字段表达式作为缓冲区分析的距离值。
  14647. */
  14648. this.exp = null;
  14649. /**
  14650. * @member {number} [SuperMap.BufferDistance.prototype.value=100]
  14651. * @description 以数值作为缓冲区分析的距离值。单位:米。
  14652. */
  14653. this.value = 100;
  14654. Util.extend(this, options);
  14655. this.CLASS_NAME = "SuperMap.BufferDistance";
  14656. }
  14657. /**
  14658. * @function SuperMap.BufferDistance.prototype.destroy
  14659. * @description 释放资源,将引用资源的属性置空。
  14660. */
  14661. BufferDistance_createClass(BufferDistance, [{
  14662. key: "destroy",
  14663. value: function destroy() {
  14664. this.exp = null;
  14665. this.value = null;
  14666. }
  14667. }]);
  14668. return BufferDistance;
  14669. }();
  14670. SuperMap.BufferDistance = BufferDistance;
  14671. ;// CONCATENATED MODULE: ./src/common/iServer/BufferSetting.js
  14672. function BufferSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14673. 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); } }
  14674. function BufferSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferSetting_defineProperties(Constructor, staticProps); return Constructor; }
  14675. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14676. * This program are made available under the terms of the Apache License, Version 2.0
  14677. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14678. /**
  14679. * @class SuperMap.BufferSetting
  14680. * @category iServer SpatialAnalyst BufferAnalyst
  14681. * @classdesc 缓冲区分析通用设置类。
  14682. * @param {Object} options - 参数。
  14683. * @param {SuperMap.BufferEndType} [options.endType=SuperMap.BufferEndType.FLAT] - 缓冲区端点枚举值。
  14684. * @param {SuperMap.BufferDistance} [options.leftDistance=100] - 左侧缓冲距离。
  14685. * @param {SuperMap.BufferDistance} [options.rightDistance=100] - 右侧缓冲距离。
  14686. * @param {number} [options.semicircleLineSegment=4] - 圆头缓冲圆弧处线段的个数。
  14687. * @param {SuperMap.BufferRadiusUnit} [options.radiusUnit=SuperMap.BufferRadiusUnit.METER] - 缓冲半径单位。
  14688. */
  14689. var BufferSetting = /*#__PURE__*/function () {
  14690. function BufferSetting(options) {
  14691. BufferSetting_classCallCheck(this, BufferSetting);
  14692. /**
  14693. * @member {SuperMap.BufferEndType} [SuperMap.BufferSetting.prototype.endType = SuperMap.BufferEndType.FLAT]
  14694. * @description 缓冲区端点枚举值。分为平头和圆头两种。
  14695. */
  14696. this.endType = BufferEndType.FLAT;
  14697. /**
  14698. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.leftDistance=100]
  14699. * @description 左侧缓冲距离。
  14700. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  14701. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  14702. */
  14703. this.leftDistance = new BufferDistance();
  14704. /**
  14705. * @member {SuperMap.BufferDistance} [SuperMap.BufferSetting.prototype.rightDistance=100]
  14706. * @description 右侧缓冲距离。
  14707. * 当为 GeometryBufferAnalyst 时,单位为默认地图的投影系的单位(如3857为米,4326为度),
  14708. * 当为 DatasetBufferAnalyst 时,单位通过{@link BufferSetting.radiusUnit}设置(默认全部为米)。
  14709. */
  14710. this.rightDistance = new BufferDistance();
  14711. /**
  14712. * @member {number} [SuperMap.BufferSetting.prototype.semicircleLineSegment=4]
  14713. * @description 圆头缓冲圆弧处线段的个数。即用多少个线段来模拟一个半圆。
  14714. */
  14715. this.semicircleLineSegment = 4;
  14716. /**
  14717. * @member {SuperMap.BufferRadiusUnit} [SuperMap.BufferSetting.prototype.radiusUnit = SuperMap.BufferRadiusUnit.METER]
  14718. * @description 缓冲半径单位,可以是{@link SuperMap.BufferRadiusUnit.METER}、{@link SuperMap.BufferRadiusUnit.MILIMETER}、
  14719. * {@link SuperMap.BufferRadiusUnit.CENTIMETER}、{@link SuperMap.BufferRadiusUnit.DECIMETER}、{@link SuperMap.BufferRadiusUnit.KILOMETER}、
  14720. * {@link SuperMap.BufferRadiusUnit.FOOT}、{@link SuperMap.BufferRadiusUnit.INCH}、{@link SuperMap.BufferRadiusUnit.MILE}、{@link SuperMap.BufferRadiusUnit.YARD}。
  14721. * 仅对BufferAnalyst有效。
  14722. */
  14723. this.radiusUnit = BufferRadiusUnit.METER;
  14724. if (options) {
  14725. Util.extend(this, options);
  14726. }
  14727. this.CLASS_NAME = "SuperMap.BufferSetting";
  14728. }
  14729. /**
  14730. * @function SuperMap.BufferSetting.prototype.destroy
  14731. * @description 释放资源,将引用资源的属性置空。
  14732. */
  14733. BufferSetting_createClass(BufferSetting, [{
  14734. key: "destroy",
  14735. value: function destroy() {
  14736. var me = this;
  14737. me.endType = null;
  14738. if (me.leftDistance) {
  14739. me.leftDistance.destroy();
  14740. me.leftDistance = null;
  14741. }
  14742. if (me.rightDistance) {
  14743. me.rightDistance.destroy();
  14744. me.rightDistance = null;
  14745. }
  14746. me.semicircleLineSegment = null;
  14747. me.radiusUnit = null;
  14748. }
  14749. }]);
  14750. return BufferSetting;
  14751. }();
  14752. SuperMap.BufferSetting = BufferSetting;
  14753. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystParameters.js
  14754. function BufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14755. 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); } }
  14756. function BufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  14757. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14758. * This program are made available under the terms of the Apache License, Version 2.0
  14759. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14760. /**
  14761. * @class SuperMap.BufferAnalystParameters
  14762. * @category iServer SpatialAnalyst BufferAnalyst
  14763. * @classdesc 缓冲区分析参数基类。
  14764. * @param {Object} options - 参数。
  14765. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  14766. */
  14767. var BufferAnalystParameters = /*#__PURE__*/function () {
  14768. function BufferAnalystParameters(options) {
  14769. BufferAnalystParameters_classCallCheck(this, BufferAnalystParameters);
  14770. var me = this;
  14771. /**
  14772. * @member {SuperMap.BufferSetting} [SuperMap.BufferAnalystParameters.prototype.bufferSetting]
  14773. * @description 设置缓冲区通用参数。为缓冲区分析提供必要的参数信息,包括左缓冲距离、右缓冲距离、端点类型、圆头缓冲圆弧处线段的个数信息。
  14774. */
  14775. me.bufferSetting = new BufferSetting();
  14776. Util.extend(this, options);
  14777. this.CLASS_NAME = "SuperMap.BufferAnalystParameters";
  14778. }
  14779. /**
  14780. * @function SuperMap.BufferAnalystParameters.prototype.destroy
  14781. * @description 释放资源,将引用资源的属性置空。
  14782. */
  14783. BufferAnalystParameters_createClass(BufferAnalystParameters, [{
  14784. key: "destroy",
  14785. value: function destroy() {
  14786. var me = this;
  14787. if (me.bufferSetting) {
  14788. me.bufferSetting.destroy();
  14789. me.bufferSetting = null;
  14790. }
  14791. }
  14792. }]);
  14793. return BufferAnalystParameters;
  14794. }();
  14795. SuperMap.BufferAnalystParameters = BufferAnalystParameters;
  14796. ;// CONCATENATED MODULE: ./src/common/iServer/DataReturnOption.js
  14797. function DataReturnOption_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14798. 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); } }
  14799. function DataReturnOption_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataReturnOption_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataReturnOption_defineProperties(Constructor, staticProps); return Constructor; }
  14800. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14801. * This program are made available under the terms of the Apache License, Version 2.0
  14802. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14803. /**
  14804. * @class SuperMap.DataReturnOption
  14805. * @category iServer SpatialAnalyst
  14806. * @classdesc 数据返回设置类。
  14807. * @param {Object} options - 参数。
  14808. * @param {number} [options.expectCount=1000] - 设置返回的最大记录数,小于或者等于 0 时表示返回所有记录数。
  14809. * @param {string} [options.dataset] - 设置结果数据集标识,当 dataReturnMode 为 {@link SuperMap.DataReturnMode.DATASET_ONLY}或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  14810. * 作为返回数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  14811. * @param {SuperMap.DataReturnMode} [options.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY] - 数据返回模式。
  14812. * @param {boolean} [options.deleteExistResultDataset=true] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  14813. */
  14814. var DataReturnOption = /*#__PURE__*/function () {
  14815. function DataReturnOption(options) {
  14816. DataReturnOption_classCallCheck(this, DataReturnOption);
  14817. /**
  14818. * @member {number} [SuperMap.DataReturnOption.prototype.expectCount=1000]
  14819. * @description 设置返回的最大记录数,小于或者等于0时表示返回所有记录数。
  14820. */
  14821. this.expectCount = 1000;
  14822. /**
  14823. * @member {string} [SuperMap.DataReturnOption.prototype.dataset]
  14824. * @description 设置结果数据集标识,当dataReturnMode为 {@link SuperMap.DataReturnMode.DATASET_ONLY}
  14825. * 或{@link SuperMap.DataReturnMode.DATASET_AND_RECORDSET}时有效,
  14826. * 作为返回数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  14827. */
  14828. this.dataset = null;
  14829. /**
  14830. * @member {SuperMap.DataReturnMode} [SuperMap.DataReturnOption.prototype.dataReturnMode=SuperMap.DataReturnMode.RECORDSET_ONLY]
  14831. * @description 数据返回模式。
  14832. */
  14833. this.dataReturnMode = DataReturnMode.RECORDSET_ONLY;
  14834. /**
  14835. * @member {boolean} [SuperMap.DataReturnOption.prototype.deleteExistResultDataset=true]
  14836. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  14837. */
  14838. this.deleteExistResultDataset = true;
  14839. Util.extend(this, options);
  14840. this.CLASS_NAME = "SuperMap.DataReturnOption";
  14841. }
  14842. /**
  14843. * @function SuperMap.DataReturnOption.prototype.destroy
  14844. * @description 释放资源,将引用资源的属性置空。
  14845. */
  14846. DataReturnOption_createClass(DataReturnOption, [{
  14847. key: "destroy",
  14848. value: function destroy() {
  14849. var me = this;
  14850. me.expectCount = null;
  14851. me.dataset = null;
  14852. me.dataReturnMode = null;
  14853. me.deleteExistResultDataset = null;
  14854. }
  14855. }]);
  14856. return DataReturnOption;
  14857. }();
  14858. SuperMap.DataReturnOption = DataReturnOption;
  14859. ;// CONCATENATED MODULE: ./src/common/iServer/JoinItem.js
  14860. function JoinItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14861. 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); } }
  14862. function JoinItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) JoinItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) JoinItem_defineProperties(Constructor, staticProps); return Constructor; }
  14863. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14864. * This program are made available under the terms of the Apache License, Version 2.0
  14865. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14866. /**
  14867. * @class SuperMap.JoinItem
  14868. * @category iServer
  14869. * @classdesc 连接信息类。
  14870. * 该类用于矢量数据集与外部表的连接。外部表可以为另一个矢量数据集(其中纯属性数据集中没有空间几何信息)所对应的 DBMS 表,也可以是用户自建的业务表。
  14871. * 需要注意的是,矢量数据集与外部表必须属于同一数据源。表之间的联系的建立有两种方式,一种是连接(join),一种是关联(link)。
  14872. * 连接,实际上是依据相同的字段将一个外部表追加到指定的表;而关联是基于一个相同的字段定义了两个表格之间的联系,但不是实际的追加。
  14873. * 用于连接两个表的字段的名称不一定相同,但类型必须一致。当两个表格之间建立了连接,通过对主表进行操作,可以对外部表进行查询,制作专题图以及分析等。
  14874. * 当两个表格之间是一对一或多对一的关系时,可以使用 join 连接。当为多对一的关系时,允许指定多个字段之间的关联。
  14875. *(注意:SuperMap.JoinItem 目前支持左连接和内连接,不支持全连接和右连接,UDB 引擎不支持内连接。并且用于建立连接的两个表必须在同一个数据源下。)
  14876. * @param {Object} options - 参数。
  14877. * @param {string} options.foreignTableName - 外部表的名称。
  14878. * @param {string} options.joinFilter - 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  14879. * @param {SuperMap.JoinType} options.joinType - 两个表之间连接类型。
  14880. * @example 下面以 SQL 查询说明 joinItem 的使用方法:
  14881. *(start code)
  14882. * function queryBySQL() {
  14883. * // 设置与外部表的连接信息
  14884. * var joinItem = new SuperMap.JoinItem({
  14885. * foreignTableName: "foreignTable",
  14886. * joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
  14887. * joinType: "LEFTJOIN"
  14888. * })
  14889. * var queryParam, queryBySQLParams, queryBySQLService;
  14890. * // 设置查询参数,在查询参数中添加joinItem关联条件信息
  14891. * queryParam = new SuperMap.FilterParameter({
  14892. * name: "Countries@World",
  14893. * joinItems: [joinItem]
  14894. * }),
  14895. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  14896. * queryParams: [queryParam]
  14897. * }),
  14898. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  14899. * eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
  14900. * });
  14901. * queryBySQLService.processAsync(queryBySQLParams);
  14902. * }
  14903. * function processCompleted(queryEventArgs) {//todo}
  14904. * function processFailed(e) {//todo}
  14905. * (end)
  14906. */
  14907. var JoinItem = /*#__PURE__*/function () {
  14908. function JoinItem(options) {
  14909. JoinItem_classCallCheck(this, JoinItem);
  14910. /**
  14911. * @member {string} SuperMap.JoinItem.prototype.foreignTableName
  14912. * @description 外部表的名称。
  14913. * 如果外部表的名称是以 “表名@数据源名” 命名方式,则该属性只需赋值表名。
  14914. * 例如:外部表 Name@changchun,Name 为表名,changchun 为数据源名称,则该属性的赋值应为:Name。
  14915. */
  14916. this.foreignTableName = null;
  14917. /**
  14918. * @member {string} SuperMap.JoinItem.prototype.joinFilter
  14919. * @description 矢量数据集与外部表之间的连接表达式,即设定两个表之间关联的字段。
  14920. * 例如,将房屋面数据集(Building)的 district 字段与房屋拥有者的纯属性数据集(Owner)的 region 字段相连接,
  14921. * 两个数据集对应的表名称分别为 Table_Building 和 Table_Owner,
  14922. * 则连接表达式为 Table_Building.district = Table_Owner.region。
  14923. * 当有多个字段相连接时,用 AND 将多个表达式相连。
  14924. */
  14925. this.joinFilter = null;
  14926. /**
  14927. * @member {SuperMap.JoinType} SuperMap.JoinItem.prototype.joinType
  14928. * @description 两个表之间连接类型。
  14929. * 连接类型决定了对两个表进行连接查询后返回的记录的情况。
  14930. */
  14931. this.joinType = null;
  14932. if (options) {
  14933. Util.extend(this, options);
  14934. }
  14935. this.CLASS_NAME = "SuperMap.JoinItem";
  14936. }
  14937. /**
  14938. * @function SuperMap.JoinItem.prototype.destroy
  14939. * @description 释放资源,将引用资源的属性置空。
  14940. */
  14941. JoinItem_createClass(JoinItem, [{
  14942. key: "destroy",
  14943. value: function destroy() {
  14944. var me = this;
  14945. me.foreignTableName = null;
  14946. me.joinFilter = null;
  14947. me.joinType = null;
  14948. }
  14949. /**
  14950. * @function SuperMap.JoinItem.prototype.toServerJSONObject
  14951. * @description 转换成对应的 JSON 格式对象。
  14952. */
  14953. }, {
  14954. key: "toServerJSONObject",
  14955. value: function toServerJSONObject() {
  14956. var dataObj = {};
  14957. dataObj = Util.copyAttributes(dataObj, this); //joinFilter基本是个纯属性对象,这里不再做转换
  14958. return dataObj;
  14959. }
  14960. }]);
  14961. return JoinItem;
  14962. }();
  14963. SuperMap.JoinItem = JoinItem;
  14964. ;// CONCATENATED MODULE: ./src/common/iServer/DatasourceConnectionInfo.js
  14965. function DatasourceConnectionInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  14966. 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); } }
  14967. function DatasourceConnectionInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasourceConnectionInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasourceConnectionInfo_defineProperties(Constructor, staticProps); return Constructor; }
  14968. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  14969. * This program are made available under the terms of the Apache License, Version 2.0
  14970. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  14971. // eslint-disable-line no-unused-vars
  14972. /**
  14973. * @class SuperMap.DatasourceConnectionInfo
  14974. * @category iServer Data
  14975. * @classdesc 数据源连接信息类。该类包括了进行数据源连接的所有信息,如所要连接的服务器名称、数据库名称、用户名以及密码等。
  14976. * 当保存为工作空间时, 工作空间中的数据源的连接信息都将存储到工作空间文件中。对于不同类型的数据源,其连接信息有所区别。
  14977. * 所以在使 用该类所包含的成员时,请注意该成员所适用的数据源类型。对于从数据源对象中返回的数据连接信息对象,只有 connect 方法可以被修改,
  14978. * 其他内容是不可以被修改的。对于用户创建的数据源连接信息对象,其内容都可以修改。
  14979. * @category iServer Data
  14980. * @param {Object} options - 参数。
  14981. * @param {string} options.alias - 数据源别名。
  14982. * @param {string} options.dataBase - 数据源连接的数据库名。
  14983. * @param {boolean} [options.connect] - 数据源是否自动连接数据。
  14984. * @param {string} [options.driver] - 使用 ODBC(Open Database Connectivity,开放数据库互连)的数据库的驱动程序名。
  14985. * @param {SuperMap.EngineType} [options.engineType] - 数据源连接的引擎类型。
  14986. * @param {boolean} [options.exclusive] - 是否以独占方式打开数据源。
  14987. * @param {boolean} [options.OpenLinkTable] - 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  14988. * @param {string} [options.password] - 登录数据源连接的数据库或文件的密码。
  14989. * @param {boolean} [options.readOnly] - 是否以只读方式打开数据源。
  14990. * @param {string} [options.server] - 数据库服务器名或 SDB 文件名。
  14991. * @param {string} [options.user] - 登录数据库的用户名。
  14992. */
  14993. var DatasourceConnectionInfo = /*#__PURE__*/function () {
  14994. function DatasourceConnectionInfo(options) {
  14995. DatasourceConnectionInfo_classCallCheck(this, DatasourceConnectionInfo);
  14996. /**
  14997. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.alias
  14998. * @description 数据源别名。
  14999. */
  15000. this.alias = null;
  15001. /**
  15002. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.connect]
  15003. * @description 数据源是否自动连接数据。
  15004. */
  15005. this.connect = null;
  15006. /**
  15007. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.dataBase
  15008. * @description 数据源连接的数据库名。
  15009. */
  15010. this.dataBase = null;
  15011. /**
  15012. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.driver]
  15013. * @description 使用 ODBC(Open Database Connectivity,开放数据库互连) 的数据库的驱动程序名。
  15014. * 其中,对于 SQL Server 数据库与 iServer 发布的 WMTS 服务,此为必设参数。
  15015. * 对于 SQL Server 数据库,它使用 ODBC 连接,所设置的驱动程序名为 "SQL Server" 或 "SQL Native Client";
  15016. * 对于 iServer 发布的 WMTS 服务,设置的驱动名称为 "WMTS"。
  15017. */
  15018. this.driver = null;
  15019. /**
  15020. * @member {SuperMap.EngineType} [SuperMap.DatasourceConnectionInfo.prototype.engineType]
  15021. * @description 数据源连接的引擎类型。
  15022. */
  15023. this.engineType = null;
  15024. /**
  15025. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.exclusive]
  15026. * @description 是否以独占方式打开数据源。
  15027. */
  15028. this.exclusive = null;
  15029. /**
  15030. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.OpenLinkTable]
  15031. * @description 是否把数据库中的其他非 SuperMap 数据表作为 LinkTable 打开。
  15032. */
  15033. this.OpenLinkTable = null;
  15034. /**
  15035. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.password]
  15036. * @description 登录数据源连接的数据库或文件的密码。
  15037. */
  15038. this.password = null;
  15039. /**
  15040. * @member {boolean} [SuperMap.DatasourceConnectionInfo.prototype.readOnly]
  15041. * @description 是否以只读方式打开数据源。
  15042. */
  15043. this.readOnly = null;
  15044. /**
  15045. * @member {string} [SuperMap.DatasourceConnectionInfo.prototype.server]
  15046. * @description 数据库服务器名、文件名或服务地址。
  15047. * 1.对于 SDB 和 UDB 文件,为其文件的绝对路径。注意:当绝对路径的长度超过 UTF-8 编码格式的 260 字节长度,该数据源无法打开。
  15048. * 2.对于 Oracle 数据库,其服务器名为其 TNS 服务名称。
  15049. * 3.对于 SQL Server 数据库,其服务器名为其系统的 DSN(Database Source Name) 名称。
  15050. * 4.对于 PostgreSQL 数据库,其服务器名为 “IP:端口号”,默认的端口号是 5432。
  15051. * 5.对于 DB2 数据库,已经进行了编目,所以不需要进行服务器的设置。
  15052. * 6.对于 Kingbase 数据库,其服务器名为其 IP 地址。
  15053. * 7.对于 GoogleMaps 数据源,其服务器地址,默认设置为 “{@link http://maps.google.com}”,且不可更改。
  15054. * 8.对于 SuperMapCould 数据源,为其服务地址。
  15055. * 9.对于 MAPWORLD 数据源,为其服务地址,默认设置为 “{@link http://www.tianditu.cn}”,且不可更改。
  15056. * 10.对于 OGC 和 REST 数据源,为其服务地址。
  15057. */
  15058. this.server = null;
  15059. /**
  15060. * @member {string} SuperMap.DatasourceConnectionInfo.prototype.user
  15061. * @description 登录数据库的用户名。
  15062. */
  15063. this.user = null;
  15064. if (options) {
  15065. Util.extend(this, options);
  15066. }
  15067. this.CLASS_NAME = "SuperMap.DatasourceConnectionInfo";
  15068. }
  15069. /**
  15070. * @function SuperMap.DatasourceConnectionInfo.prototype.destroy
  15071. * @description 释放资源,将引用资源的属性置空。
  15072. */
  15073. DatasourceConnectionInfo_createClass(DatasourceConnectionInfo, [{
  15074. key: "destroy",
  15075. value: function destroy() {
  15076. var me = this;
  15077. me.alias = null;
  15078. me.connect = null;
  15079. me.dataBase = null;
  15080. me.driver = null;
  15081. me.engineType = null;
  15082. me.exclusive = null;
  15083. me.OpenLinkTable = null;
  15084. me.password = null;
  15085. me.readOnly = null;
  15086. me.server = null;
  15087. me.user = null;
  15088. }
  15089. }]);
  15090. return DatasourceConnectionInfo;
  15091. }();
  15092. SuperMap.DatasourceConnectionInfo = DatasourceConnectionInfo;
  15093. ;// CONCATENATED MODULE: ./src/common/iServer/LinkItem.js
  15094. function LinkItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15095. 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); } }
  15096. function LinkItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) LinkItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) LinkItem_defineProperties(Constructor, staticProps); return Constructor; }
  15097. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15098. * This program are made available under the terms of the Apache License, Version 2.0
  15099. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15100. /**
  15101. * @class SuperMap.LinkItem
  15102. * @constructs SuperMap.LinkItem
  15103. * @category iServer
  15104. * @classdesc 关联信息类。
  15105. * @description 该类用于矢量数据集与外部表的关联。 外部表是另一个数据集(其中纯属性数据集中没有空间几何信息)中的 DBMS 表,
  15106. * 矢量数据集与外部表可以属于不同的数据源,但数据源类型目前只支持 SQL Server 和 Oracle 类型。使用 LinkItem 时,
  15107. * 空间数据和属性数据必须满足关联条件,即主空间数据集与外部属性表之间存在关联字段。{@link SuperMap.LinkItem}
  15108. * 只支持左连接,UDB、PostgreSQL 和 DB2 数据源不支持 {@link SuperMap.LinkItem};另外,用于建立关联关系的两个表可以不在同一个数据源下。注意:<br>
  15109. * 1. 使用 {@link SuperMap.LinkItem} 的约束条件为:空间数据和属性数据必须有关联条件,即主空间数据集与外部属性表之间存在关联字段;<br>
  15110. * 2. 使用外关联表制作专题图时,所关联的字段必须设置表名,例如,如果所关联的字段为 BaseMap_R 数据集的 SmID,就要写成 BaseMap_R.SMID。
  15111. * @param {Object} options - 参数。
  15112. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceConnectionInfo - 关联的外部数据源信息。
  15113. * @param {Array.<string>} options.foreignKeys - 主空间数据集的外键。
  15114. * @param {string} options.foreignTable - 关联的外部属性表的名称。
  15115. * @param {Array.<string>} options.linkFields - 欲保留的外部属性表的字段。
  15116. * @param {string} options.linkFilter - 与外部属性表的连接条件。
  15117. * @param {string} options.name - 此关联信息对象的名称。
  15118. * @param {Array.<string>} options.primaryKeys - 需要关联的外部属性表的主键。
  15119. * @example 下面以 SQL 查询说明 linkitem 的使用方法:
  15120. * function queryBySQL() {
  15121. * // 设置关联的外部数据库信息,alias表示数据库别名
  15122. * var dc = new SuperMap.DatasourceConnectionInfo({
  15123. * dataBase: "RelQuery",
  15124. * server: "{ip}:{port}",
  15125. * user: "sa",
  15126. * password: "map",
  15127. * driver: "SQL Server",
  15128. * connect: true,
  15129. * OpenLinkTable: false,
  15130. * alias: "RelQuery",
  15131. * engineType: EngineType.SQLPLUS,
  15132. * readOnly: false,
  15133. * exclusive: false
  15134. * });
  15135. * // 设置关联信息
  15136. * var linkItem = new SuperMap.LinkItem({
  15137. * datasourceConnectionInfo: dc,
  15138. * foreignKeys: ["name"],
  15139. * foreignTable: "Pop_2011",
  15140. * linkFields: ["SmID as Pid","pop"],
  15141. * name: "link",
  15142. * primatryKeys: ["name"],
  15143. * });
  15144. * // 设置查询参数,在查询参数中添加linkItem关联条件信息
  15145. * var queryParam, queryBySQLParams, queryBySQLService;
  15146. * queryParam = new SuperMap.FilterParameter({
  15147. * name: "Province@RelQuery",
  15148. * fields: ["SmID","name"],
  15149. * attributeFilter: "SmID<7",
  15150. * linkItems: [linkItem]
  15151. * }),
  15152. * queryBySQLParams = new SuperMap.QueryBySQLParameters({
  15153. * queryParams: [queryParam]
  15154. * }),
  15155. * queryBySQLService = new SuperMap.QueryBySQLService(url, {
  15156. * eventListeners: {
  15157. * "processCompleted": processCompleted,
  15158. * "processFailed": processFailed
  15159. * }
  15160. * });
  15161. * queryBySQLService.processAsync(queryBySQLParams);
  15162. * }
  15163. * function processCompleted(queryEventArgs) {//todo}
  15164. * function processFailed(e) {//todo}
  15165. *
  15166. */
  15167. var LinkItem = /*#__PURE__*/function () {
  15168. function LinkItem(options) {
  15169. LinkItem_classCallCheck(this, LinkItem);
  15170. /**
  15171. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.LinkItem.prototype.datasourceConnectionInfo
  15172. * @description 关联的外部数据源信息。
  15173. */
  15174. this.datasourceConnectionInfo = null;
  15175. /**
  15176. * @member {Array.<string>} SuperMap.LinkItem.prototype.foreignKeys
  15177. * @description 主空间数据集的外键。
  15178. */
  15179. this.foreignKeys = null;
  15180. /**
  15181. * @member {string} SuperMap.LinkItem.prototype.foreignTable
  15182. * @description 关联的外部属性表的名称,目前仅支持 Supermap 管理的表,即另一个矢量数据集所对应的 DBMS 表。
  15183. */
  15184. this.foreignTable = null;
  15185. /**
  15186. * @member {Array.<string>} SuperMap.LinkItem.prototype.linkFields
  15187. * @description 欲保留的外部属性表的字段。如果不设置字段或者设置的字段在外部属性表中不存在的话则不返
  15188. * 回任何外部属性表的属性信息。如果欲保留的外部表字段与主表字段存在同名,则还需要指定一个不存在字段名作为外部表的字段别名。
  15189. */
  15190. this.linkFields = null;
  15191. /**
  15192. * @member {string} SuperMap.LinkItem.prototype.linkFilter
  15193. * @description 与外部属性表的连接条件。
  15194. */
  15195. this.linkFilter = null;
  15196. /**
  15197. * @member {string} SuperMap.LinkItem.prototype.name
  15198. * @description 此关联信息对象的名称。
  15199. */
  15200. this.name = null;
  15201. /**
  15202. * @member {Array.<string>} SuperMap.LinkItem.prototype.primaryKeys
  15203. * @description 需要关联的外部属性表的主键。
  15204. */
  15205. this.primaryKeys = null;
  15206. if (options) {
  15207. Util.extend(this, options);
  15208. }
  15209. this.CLASS_NAME = "SuperMap.LinkItem";
  15210. }
  15211. /**
  15212. * @function SuperMap.LinkItem.prototype.destroy
  15213. * @description 释放资源,将引用资源的属性置空。
  15214. */
  15215. LinkItem_createClass(LinkItem, [{
  15216. key: "destroy",
  15217. value: function destroy() {
  15218. var me = this;
  15219. if (me.datasourceConnectionInfo instanceof DatasourceConnectionInfo) {
  15220. me.datasourceConnectionInfo.destroy();
  15221. me.datasourceConnectionInfo = null;
  15222. }
  15223. me.foreignKeys = null;
  15224. me.foreignTable = null;
  15225. me.linkFields = null;
  15226. me.linkFilter = null;
  15227. me.name = null;
  15228. me.primaryKeys = null;
  15229. }
  15230. }]);
  15231. return LinkItem;
  15232. }();
  15233. SuperMap.LinkItem = LinkItem;
  15234. ;// CONCATENATED MODULE: ./src/common/iServer/FilterParameter.js
  15235. function FilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15236. 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); } }
  15237. function FilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  15238. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15239. * This program are made available under the terms of the Apache License, Version 2.0
  15240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15241. /**
  15242. * @class SuperMap.FilterParameter
  15243. * @category iServer
  15244. * @classdesc 查询过滤条件参数类。该类用于设置查询数据集的查询过滤参数。
  15245. * @param {Object} options - 参数。
  15246. * @param {string} options.attributeFilter - 属性过滤条件。
  15247. * @param {string} options.name - 查询数据集名称或者图层名称。
  15248. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 与外部表的连接信息 SuperMap.JoinItem 数组。
  15249. * @param {Array.<SuperMap.LinkItem>} [options.linkItems] - 与外部表的关联信息 SuperMap.LinkItem 数组。
  15250. * @param {Array.<string>} [options.ids] - 查询 id 数组,即属性表中的 SmID 值。
  15251. * @param {string} [options.orderBy] - 查询排序的字段,orderBy 的字段须为数值型的。
  15252. * @param {string} [options.groupBy] - 查询分组条件的字段。
  15253. * @param {Array.<string>} [options.fields] - 查询字段数组。
  15254. */
  15255. var FilterParameter = /*#__PURE__*/function () {
  15256. function FilterParameter(options) {
  15257. FilterParameter_classCallCheck(this, FilterParameter);
  15258. /**
  15259. * @member {string} SuperMap.FilterParameter.prototype.attributeFilter
  15260. * @description 属性过滤条件。
  15261. * 相当于 SQL 语句中的 WHERE 子句,其格式为:WHERE <条件表达式>,
  15262. * attributeFilter 就是其中的“条件表达式”。
  15263. * 该字段的用法为 attributeFilter = "过滤条件"。
  15264. * 例如,要查询字段 fieldValue 小于100的记录,设置 attributeFilter = "fieldValue < 100";
  15265. * 要查询字段 name 的值为“酒店”的记录,设置 attributeFilter = "name like '%酒店%'",等等。
  15266. */
  15267. this.attributeFilter = null;
  15268. /**
  15269. * @member {string} SuperMap.FilterParameter.prototype.name
  15270. * @description 查询数据集名称或者图层名称,根据实际的查询对象而定。
  15271. * 一般情况下该字段为数据集名称,但在进行与地图相关功能的操作时,
  15272. * 需要设置为图层名称(图层名称格式:数据集名称@数据源别名)。
  15273. * 因为一个地图的图层可能是来自于不同数据源的数据集,
  15274. * 而不同的数据源中可能存在同名的数据集,
  15275. * 使用数据集名称不能唯一的确定数据集,
  15276. * 所以在进行与地图相关功能的操作时,该值需要设置为图层名称。
  15277. */
  15278. this.name = null;
  15279. /**
  15280. * @member {Array.<SuperMap.JoinItem>} [SuperMap.FilterParameter.prototype.joinItems]
  15281. * @description 与外部表的连接信息 SuperMap.JoinItem 数组。
  15282. */
  15283. this.joinItems = null;
  15284. /**
  15285. * @member {Array.<SuperMap.LinkItem>} [SuperMap.FilterParameter.prototype.linkItems]
  15286. * @description 与外部表的关联信息 LinkItem 数组。
  15287. */
  15288. this.linkItems = null;
  15289. /**
  15290. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.ids]
  15291. * @description 查询 id 数组,即属性表中的 SmID 值。
  15292. */
  15293. this.ids = null;
  15294. /**
  15295. * @member {string} [SuperMap.FilterParameter.prototype.orderBy]
  15296. * @description 查询排序的字段,orderBy的字段须为数值型的。
  15297. * 相当于 SQL 语句中的 ORDER BY 子句,其格式为:ORDER BY <列名>,
  15298. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  15299. * 对单个字段排序时,该字段的用法为 orderBy = "字段名";
  15300. * 对多个字段排序时,字段之间以英文逗号进行分割,用法为 orderBy = "字段名1, 字段名2"。
  15301. * 例如,现有一个国家数据集,它有两个字段分别为“SmArea”和“pop_1994”,
  15302. * 分别表示国家的面积和1994年的各国人口数量。
  15303. * 如果要按照各国人口数量对记录进行排序,则 orderBy = "pop_1994";
  15304. * 如果要以面积和人口进行排序,则 orderBy = "SmArea, pop_1994"。
  15305. */
  15306. this.orderBy = null;
  15307. /**
  15308. * @member {string} [SuperMap.FilterParameter.prototype.groupBy]
  15309. * @description 查询分组条件的字段。
  15310. * 相当于 SQL 语句中的 GROUP BY 子句,其格式为:GROUP BY <列名>,
  15311. * 列名即属性表中每一列的名称,列又可称为属性,在 SuperMap 中又称为字段。
  15312. * 对单个字段分组时,该字段的用法为 groupBy = "字段名";
  15313. * 对多个字段分组时,字段之间以英文逗号进行分割,用法为 groupBy = "字段名1, 字段名2"。
  15314. * 例如,现有一个全球城市数据集,该数据集有两个字段分别为“Continent”和“Country”,
  15315. * 分别表示某个城市所属的洲和国家。
  15316. * 如果要按照国家对全球的城市进行分组, 可以设置 groupBy = "Country";
  15317. * 如果以洲和国家对城市进行分组,设置 groupBy = "Continent, Country"。
  15318. */
  15319. this.groupBy = null;
  15320. /**
  15321. * @member {Array.<string>} [SuperMap.FilterParameter.prototype.fields]
  15322. * @description 查询字段数组,如果不设置则使用系统返回的所有字段。
  15323. */
  15324. this.fields = null;
  15325. if (options) {
  15326. Util.extend(this, options);
  15327. }
  15328. this.CLASS_NAME = "SuperMap.FilterParameter";
  15329. }
  15330. /**
  15331. * @function SuperMap.FilterParameter.prototype.destroy
  15332. * @description 释放资源,将引用资源的属性置空。
  15333. */
  15334. FilterParameter_createClass(FilterParameter, [{
  15335. key: "destroy",
  15336. value: function destroy() {
  15337. var me = this;
  15338. me.attributeFilter = null;
  15339. me.name = null;
  15340. if (me.joinItems) {
  15341. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  15342. joinItems[i].destroy();
  15343. }
  15344. me.joinItems = null;
  15345. }
  15346. if (me.linkItems) {
  15347. for (var _i = 0, linkItems = me.linkItems, _len = linkItems.length; _i < _len; _i++) {
  15348. linkItems[_i].destroy();
  15349. }
  15350. me.linkItems = null;
  15351. }
  15352. me.ids = null;
  15353. me.orderBy = null;
  15354. me.groupBy = null;
  15355. me.fields = null;
  15356. }
  15357. }]);
  15358. return FilterParameter;
  15359. }();
  15360. SuperMap.FilterParameter = FilterParameter;
  15361. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetBufferAnalystParameters.js
  15362. function DatasetBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetBufferAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetBufferAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetBufferAnalystParameters_typeof(obj); }
  15363. function DatasetBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15364. 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); } }
  15365. function DatasetBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  15366. function DatasetBufferAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetBufferAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return DatasetBufferAnalystParameters_get(target, property, receiver || target); }
  15367. function DatasetBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  15368. 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 } }); if (superClass) DatasetBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  15369. function DatasetBufferAnalystParameters_setPrototypeOf(o, p) { DatasetBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetBufferAnalystParameters_setPrototypeOf(o, p); }
  15370. 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); }; }
  15371. function DatasetBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetBufferAnalystParameters_assertThisInitialized(self); }
  15372. function DatasetBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15373. function DatasetBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15374. function DatasetBufferAnalystParameters_getPrototypeOf(o) { DatasetBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetBufferAnalystParameters_getPrototypeOf(o); }
  15375. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15376. * This program are made available under the terms of the Apache License, Version 2.0
  15377. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15378. /**
  15379. * @class SuperMap.DatasetBufferAnalystParameters
  15380. * @category iServer SpatialAnalyst BufferAnalyst
  15381. * @classdesc 数据集缓冲区分析参数类。
  15382. * @param {Object} options - 参数。
  15383. * @param {string} options.dataset - 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  15384. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  15385. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  15386. * @param {boolean} [options.isAttributeRetained=true] - 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  15387. * @param {boolean} [options.isUnion=false] - 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  15388. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  15389. *
  15390. * @extends {SuperMap.BufferAnalystParameters}
  15391. */
  15392. var DatasetBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  15393. DatasetBufferAnalystParameters_inherits(DatasetBufferAnalystParameters, _BufferAnalystParamet);
  15394. var _super = DatasetBufferAnalystParameters_createSuper(DatasetBufferAnalystParameters);
  15395. function DatasetBufferAnalystParameters(options) {
  15396. var _this;
  15397. DatasetBufferAnalystParameters_classCallCheck(this, DatasetBufferAnalystParameters);
  15398. _this = _super.call(this, options);
  15399. /**
  15400. * @member {string} SuperMap.DatasetBufferAnalystParameters.prototype.dataset
  15401. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如“数据集名称@数据源别名”形式来表示。
  15402. */
  15403. _this.dataset = null;
  15404. /**
  15405. * @member {SuperMap.FilterParameter} [SuperMap.DatasetBufferAnalystParameters.prototype.filterQueryParameter]
  15406. * @description 设置数据集中几何对象的过滤条件。只有满足此条件的几何对象才参与缓冲区分析。
  15407. */
  15408. _this.filterQueryParameter = new FilterParameter();
  15409. /**
  15410. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetBufferAnalystParameters.prototype.resultSetting]
  15411. * @description 结果返回设置类。
  15412. */
  15413. _this.resultSetting = new DataReturnOption();
  15414. /**
  15415. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isAttributeRetained=true]
  15416. * @description 是否保留进行缓冲区分析的对象的字段属性。当 isUnion 字段为 false 时该字段有效。
  15417. */
  15418. _this.isAttributeRetained = true;
  15419. /**
  15420. * @member {boolean} [SuperMap.DatasetBufferAnalystParameters.prototype.isUnion=false]
  15421. * @description 是否将缓冲区与源记录集中的对象合并后返回。对于面对象而言,要求源数据集中的面对象不相交。
  15422. */
  15423. _this.isUnion = false;
  15424. Util.extend(DatasetBufferAnalystParameters_assertThisInitialized(_this), options);
  15425. _this.CLASS_NAME = "SuperMap.DatasetBufferAnalystParameters";
  15426. return _this;
  15427. }
  15428. /**
  15429. * @function SuperMap.DatasetBufferAnalystParameters.prototype.destroy
  15430. * @override
  15431. */
  15432. DatasetBufferAnalystParameters_createClass(DatasetBufferAnalystParameters, [{
  15433. key: "destroy",
  15434. value: function destroy() {
  15435. DatasetBufferAnalystParameters_get(DatasetBufferAnalystParameters_getPrototypeOf(DatasetBufferAnalystParameters.prototype), "destroy", this).call(this);
  15436. var me = this;
  15437. me.dataset = null;
  15438. if (me.filterQueryParameter) {
  15439. me.filterQueryParameter.destroy();
  15440. me.filterQueryParameter = null;
  15441. }
  15442. if (me.resultSetting) {
  15443. me.resultSetting.destroy();
  15444. me.resultSetting = null;
  15445. }
  15446. me.isAttributeRetained = null;
  15447. me.isUnion = null;
  15448. }
  15449. /**
  15450. * @function SuperMap.DatasetBufferAnalystParameters.toObject
  15451. * @param {SuperMap.DatasetBufferAnalystParameters} datasetBufferAnalystParameters - 数据集缓冲区分析参数类。
  15452. * @param {SuperMap.DatasetBufferAnalystParameters} tempObj - 数据集缓冲区分析参数对象。
  15453. * @description 将数据集缓冲区分析参数对象转换为 JSON 对象。
  15454. * @returns {Object} JSON 对象。
  15455. */
  15456. }], [{
  15457. key: "toObject",
  15458. value: function toObject(datasetBufferAnalystParameters, tempObj) {
  15459. for (var name in datasetBufferAnalystParameters) {
  15460. if (name === "bufferSetting") {
  15461. datasetBufferAnalystParameters.bufferSetting.radiusUnit = datasetBufferAnalystParameters.bufferSetting.radiusUnit.toUpperCase();
  15462. tempObj.bufferAnalystParameter = datasetBufferAnalystParameters.bufferSetting;
  15463. } else if (name === "resultSetting") {
  15464. tempObj.dataReturnOption = datasetBufferAnalystParameters.resultSetting;
  15465. } else if (name === "dataset") {
  15466. continue;
  15467. } else {
  15468. tempObj[name] = datasetBufferAnalystParameters[name];
  15469. }
  15470. }
  15471. }
  15472. }]);
  15473. return DatasetBufferAnalystParameters;
  15474. }(BufferAnalystParameters);
  15475. SuperMap.DatasetBufferAnalystParameters = DatasetBufferAnalystParameters;
  15476. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBufferAnalystParameters.js
  15477. function GeometryBufferAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryBufferAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryBufferAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryBufferAnalystParameters_typeof(obj); }
  15478. function GeometryBufferAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15479. 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); } }
  15480. function GeometryBufferAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBufferAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBufferAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  15481. function GeometryBufferAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBufferAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeometryBufferAnalystParameters_get(target, property, receiver || target); }
  15482. function GeometryBufferAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBufferAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  15483. 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 } }); if (superClass) GeometryBufferAnalystParameters_setPrototypeOf(subClass, superClass); }
  15484. function GeometryBufferAnalystParameters_setPrototypeOf(o, p) { GeometryBufferAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBufferAnalystParameters_setPrototypeOf(o, p); }
  15485. 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); }; }
  15486. function GeometryBufferAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryBufferAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBufferAnalystParameters_assertThisInitialized(self); }
  15487. function GeometryBufferAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15488. function GeometryBufferAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15489. function GeometryBufferAnalystParameters_getPrototypeOf(o) { GeometryBufferAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBufferAnalystParameters_getPrototypeOf(o); }
  15490. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15491. * This program are made available under the terms of the Apache License, Version 2.0
  15492. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15493. /**
  15494. * @class SuperMap.GeometryBufferAnalystParameters
  15495. * @category iServer SpatialAnalyst BufferAnalyst
  15496. * @classdesc 几何对象缓冲区分析参数类
  15497. * 对指定的某个几何对象做缓冲区分析。通过该类可以指定要做缓冲区分析的几何对象、缓冲区参数等。
  15498. * @param {Object} options - 参数。
  15499. * @param {Object} options.sourceGeometry - 要做缓冲区分析的几何对象。
  15500. * @param {number} options.sourceGeometrySRID - 缓冲区几何对象投影坐标参数, 如 4326,3857。
  15501. * @param {SuperMap.BufferSetting} [options.bufferSetting] - 设置缓冲区通用参数。
  15502. * @extends {SuperMap.BufferAnalystParameters}
  15503. */
  15504. var GeometryBufferAnalystParameters = /*#__PURE__*/function (_BufferAnalystParamet) {
  15505. GeometryBufferAnalystParameters_inherits(GeometryBufferAnalystParameters, _BufferAnalystParamet);
  15506. var _super = GeometryBufferAnalystParameters_createSuper(GeometryBufferAnalystParameters);
  15507. function GeometryBufferAnalystParameters(options) {
  15508. var _this;
  15509. GeometryBufferAnalystParameters_classCallCheck(this, GeometryBufferAnalystParameters);
  15510. _this = _super.call(this, options);
  15511. /**
  15512. * @member {Object} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometry
  15513. * @description 要做缓冲区分析的几何对象。<br>
  15514. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  15515. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  15516. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  15517. */
  15518. _this.sourceGeometry = null;
  15519. /**
  15520. * @member {number} SuperMap.GeometryBufferAnalystParameters.prototype.sourceGeometrySRID
  15521. * @description 缓冲区几何对象投影坐标参数, 如 4326,3857。
  15522. */
  15523. _this.sourceGeometrySRID = null;
  15524. if (options) {
  15525. Util.extend(GeometryBufferAnalystParameters_assertThisInitialized(_this), options);
  15526. }
  15527. _this.CLASS_NAME = " SuperMap.GeometryBufferAnalystParameters";
  15528. return _this;
  15529. }
  15530. /**
  15531. * @function SuperMap.GeometryBufferAnalystParameters.prototype.destroy
  15532. * @override
  15533. */
  15534. GeometryBufferAnalystParameters_createClass(GeometryBufferAnalystParameters, [{
  15535. key: "destroy",
  15536. value: function destroy() {
  15537. GeometryBufferAnalystParameters_get(GeometryBufferAnalystParameters_getPrototypeOf(GeometryBufferAnalystParameters.prototype), "destroy", this).call(this);
  15538. var me = this;
  15539. if (me.sourceGeometry) {
  15540. me.sourceGeometry.destroy();
  15541. me.sourceGeometry = null;
  15542. }
  15543. }
  15544. /**
  15545. * @function SuperMap.GeometryBufferAnalystParameters.toObject
  15546. * @param {SuperMap.GeometryBufferAnalystParameters} geometryBufferAnalystParameters - 几何对象缓冲区分析参数类。
  15547. * @param {SuperMap.GeometryBufferAnalystParameters} tempObj - 几何对象缓冲区分析参数对象。
  15548. * @description 将几何对象缓冲区分析参数对象转换为 JSON 对象。
  15549. * @returns {Object} JSON 对象。
  15550. */
  15551. }], [{
  15552. key: "toObject",
  15553. value: function toObject(geometryBufferAnalystParameters, tempObj) {
  15554. for (var name in geometryBufferAnalystParameters) {
  15555. if (name === "bufferSetting") {
  15556. var tempBufferSetting = {};
  15557. for (var key in geometryBufferAnalystParameters.bufferSetting) {
  15558. tempBufferSetting[key] = geometryBufferAnalystParameters.bufferSetting[key];
  15559. }
  15560. tempObj.analystParameter = tempBufferSetting;
  15561. } else if (name === "sourceGeometry") {
  15562. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryBufferAnalystParameters.sourceGeometry);
  15563. } else {
  15564. tempObj[name] = geometryBufferAnalystParameters[name];
  15565. }
  15566. }
  15567. }
  15568. }]);
  15569. return GeometryBufferAnalystParameters;
  15570. }(BufferAnalystParameters);
  15571. SuperMap.GeometryBufferAnalystParameters = GeometryBufferAnalystParameters;
  15572. ;// CONCATENATED MODULE: ./src/common/iServer/BufferAnalystService.js
  15573. function BufferAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BufferAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { BufferAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BufferAnalystService_typeof(obj); }
  15574. function BufferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15575. 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); } }
  15576. function BufferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BufferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BufferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  15577. function BufferAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BufferAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return BufferAnalystService_get(target, property, receiver || target); }
  15578. function BufferAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BufferAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  15579. 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 } }); if (superClass) BufferAnalystService_setPrototypeOf(subClass, superClass); }
  15580. function BufferAnalystService_setPrototypeOf(o, p) { BufferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BufferAnalystService_setPrototypeOf(o, p); }
  15581. 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); }; }
  15582. function BufferAnalystService_possibleConstructorReturn(self, call) { if (call && (BufferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BufferAnalystService_assertThisInitialized(self); }
  15583. function BufferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15584. function BufferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15585. function BufferAnalystService_getPrototypeOf(o) { BufferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BufferAnalystService_getPrototypeOf(o); }
  15586. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15587. * This program are made available under the terms of the Apache License, Version 2.0
  15588. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15589. /**
  15590. * @class SuperMap.BufferAnalystService
  15591. * @category iServer SpatialAnalyst BufferAnalyst
  15592. * @classdesc 缓冲区分析服务类。
  15593. * 该类负责将客户设置的缓冲区分析参数传递给服务端,并接收服务端返回的缓冲区分析结果数据。
  15594. * 缓冲区分析结果通过该类支持的事件的监听函数参数获取。
  15595. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  15596. * @param {Object} options - 参数。</br>
  15597. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  15598. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15599. * @param {Object} [options.headers] - 请求头。
  15600. * @extends {SuperMap.SpatialAnalystBase}
  15601. * @example 例如:
  15602. * (start code)
  15603. * var myBufferAnalystService = new SuperMap.BufferAnalystService(url, {
  15604. * eventListeners: {
  15605. * "processCompleted": bufferCompleted,
  15606. * "processFailed": bufferFailed
  15607. * }
  15608. * });
  15609. * (end)
  15610. *
  15611. *
  15612. */
  15613. var BufferAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  15614. BufferAnalystService_inherits(BufferAnalystService, _SpatialAnalystBase);
  15615. var _super = BufferAnalystService_createSuper(BufferAnalystService);
  15616. function BufferAnalystService(url, options) {
  15617. var _this;
  15618. BufferAnalystService_classCallCheck(this, BufferAnalystService);
  15619. _this = _super.call(this, url, options);
  15620. /**
  15621. * @member {string} SuperMap.BufferAnalystService.prototype.mode
  15622. * @description 缓冲区分析类型
  15623. */
  15624. _this.mode = null;
  15625. if (options) {
  15626. Util.extend(BufferAnalystService_assertThisInitialized(_this), options);
  15627. }
  15628. _this.CLASS_NAME = "SuperMap.BufferAnalystService";
  15629. return _this;
  15630. }
  15631. /**
  15632. * @function SuperMap.BufferAnalystService.prototype.destroy
  15633. * @override
  15634. */
  15635. BufferAnalystService_createClass(BufferAnalystService, [{
  15636. key: "destroy",
  15637. value: function destroy() {
  15638. BufferAnalystService_get(BufferAnalystService_getPrototypeOf(BufferAnalystService.prototype), "destroy", this).call(this);
  15639. this.mode = null;
  15640. }
  15641. /**
  15642. * @method SuperMap.BufferAnalystService.prototype.processAsync
  15643. * @description 负责将客户端的查询参数传递到服务端。
  15644. * @param {SuperMap.BufferAnalystParameters} parameter - 缓冲区分析参数
  15645. */
  15646. }, {
  15647. key: "processAsync",
  15648. value: function processAsync(parameter) {
  15649. var parameterObject = {};
  15650. var me = this;
  15651. if (parameter instanceof DatasetBufferAnalystParameters) {
  15652. me.mode = 'datasets';
  15653. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/buffer');
  15654. DatasetBufferAnalystParameters.toObject(parameter, parameterObject);
  15655. } else if (parameter instanceof GeometryBufferAnalystParameters) {
  15656. me.mode = 'geometry';
  15657. me.url = Util.urlPathAppend(me.url, 'geometry/buffer');
  15658. GeometryBufferAnalystParameters.toObject(parameter, parameterObject);
  15659. }
  15660. var jsonParameters = Util.toJSON(parameterObject);
  15661. me.url = Util.urlAppend(me.url, 'returnContent=true');
  15662. me.request({
  15663. method: "POST",
  15664. data: jsonParameters,
  15665. scope: me,
  15666. success: me.serviceProcessCompleted,
  15667. failure: me.serviceProcessFailed
  15668. });
  15669. }
  15670. }]);
  15671. return BufferAnalystService;
  15672. }(SpatialAnalystBase);
  15673. SuperMap.BufferAnalystService = BufferAnalystService;
  15674. ;// CONCATENATED MODULE: ./src/common/iServer/OutputSetting.js
  15675. function OutputSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15676. 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); } }
  15677. function OutputSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) OutputSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) OutputSetting_defineProperties(Constructor, staticProps); return Constructor; }
  15678. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15679. * This program are made available under the terms of the Apache License, Version 2.0
  15680. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15681. /**
  15682. * @class SuperMap.OutputSetting
  15683. * @category iServer ProcessingService
  15684. * @classdesc 分布式分析输出类型设置类。
  15685. * @param {Object} options - 参数。
  15686. * @param {SuperMap.DatasourceConnectionInfo} options.datasourceInfo - 数据源连接信息。
  15687. * @param {string} [options.datasetName='analystResult'] - 结果数据集名称。
  15688. * @param {SuperMap.OutputType} [options.type=SuperMap.OutputType.UDB] - 输出类型。
  15689. * @param {string} [options.outputPath] - 分析结果输出路径。
  15690. */
  15691. var OutputSetting = /*#__PURE__*/function () {
  15692. function OutputSetting(options) {
  15693. OutputSetting_classCallCheck(this, OutputSetting);
  15694. /**
  15695. * @member {SuperMap.OutputType} SuperMap.OutputSetting.prototype.type
  15696. * @description 分布式分析的输出类型。
  15697. */
  15698. this.type = OutputType.UDB;
  15699. /**
  15700. * @member {string} [SuperMap.OutputSetting.prototype.datasetName='analystResult']
  15701. * @description 分布式分析的输出结果数据集名称。
  15702. */
  15703. this.datasetName = "analystResult";
  15704. /**
  15705. * @member {SuperMap.DatasourceConnectionInfo} SuperMap.OutputSetting.prototype.datasourceInfo
  15706. * @description 分布式分析的输出结果数据源连接信息。
  15707. */
  15708. this.datasourceInfo = null;
  15709. /**
  15710. * @member {string} [SuperMap.OutputSetting.prototype.outputPath]
  15711. * @description 分布式分析的分析结果输出路径。
  15712. */
  15713. this.outputPath = "";
  15714. Util.extend(this, options);
  15715. this.CLASS_NAME = "SuperMap.OutputSetting";
  15716. }
  15717. /**
  15718. * @function SuperMap.OutputSetting.prototype.destroy
  15719. * @description 释放资源,将引用资源的属性置空。
  15720. */
  15721. OutputSetting_createClass(OutputSetting, [{
  15722. key: "destroy",
  15723. value: function destroy() {
  15724. var me = this;
  15725. me.type = null;
  15726. me.datasetName = null;
  15727. me.outputPath = null;
  15728. if (me.datasourceInfo instanceof DatasourceConnectionInfo) {
  15729. me.datasourceInfo.destroy();
  15730. me.datasourceInfo = null;
  15731. }
  15732. }
  15733. }]);
  15734. return OutputSetting;
  15735. }();
  15736. SuperMap.OutputSetting = OutputSetting;
  15737. ;// CONCATENATED MODULE: ./src/common/iServer/MappingParameters.js
  15738. function MappingParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15739. 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); } }
  15740. function MappingParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MappingParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MappingParameters_defineProperties(Constructor, staticProps); return Constructor; }
  15741. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15742. * This program are made available under the terms of the Apache License, Version 2.0
  15743. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15744. /**
  15745. * @class SuperMap.MappingParameters
  15746. * @category iServer ProcessingService
  15747. * @classdesc 分析后结果可视化的参数类。
  15748. * @param {Object} options - 参数。
  15749. * @param {Array.<SuperMap.ThemeGridRangeItem>} [options.items] - 栅格分段专题图子项数组。
  15750. * @param {number} [options.numericPrecision=1] - 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  15751. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 专题图分段模式。
  15752. * @param {number} [options.rangeCount] - 专题图分段个数。
  15753. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 专题图颜色渐变模式。
  15754. */
  15755. var MappingParameters = /*#__PURE__*/function () {
  15756. function MappingParameters(options) {
  15757. MappingParameters_classCallCheck(this, MappingParameters);
  15758. /**
  15759. * @member {Array.<SuperMap.ThemeGridRangeItem>} [SuperMap.MappingParameters.prototype.items]
  15760. * @description 栅格分段专题图子项数组。
  15761. */
  15762. this.items = null;
  15763. /**
  15764. * @member {number} [SuperMap.MappingParameters.prototype.numericPrecision=1]
  15765. * @description 精度,此字段用于设置分析结果标签专题图中标签数值的精度,如“1”表示精确到小数点的后一位。
  15766. */
  15767. this.numericPrecision = 1;
  15768. /**
  15769. * @member {SuperMap.RangeMode} [SuperMap.MappingParameters.prototype.RangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  15770. * @description 专题图分段模式。
  15771. */
  15772. this.rangeMode = RangeMode.EQUALINTERVAL;
  15773. /**
  15774. * @member {number} [SuperMap.MappingParameters.prototype.rangeCount]
  15775. * @description 专题图分段个数。
  15776. */
  15777. this.rangeCount = "";
  15778. /**
  15779. * @member {SuperMap.ColorGradientType} [SuperMap.MappingParameters.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  15780. * @description 专题图颜色渐变模式。
  15781. */
  15782. this.colorGradientType = ColorGradientType.YELLOW_RED;
  15783. Util.extend(this, options);
  15784. this.CLASS_NAME = "SuperMap.MappingParameters";
  15785. }
  15786. /**
  15787. * @function SuperMap.MappingParameters.prototype.destroy
  15788. * @description 释放资源,将引用资源的属性置空。
  15789. */
  15790. MappingParameters_createClass(MappingParameters, [{
  15791. key: "destroy",
  15792. value: function destroy() {
  15793. var me = this;
  15794. if (me.items) {
  15795. if (me.items.length > 0) {
  15796. for (var item in me.items) {
  15797. me.items[item].destroy();
  15798. me.items[item] = null;
  15799. }
  15800. }
  15801. me.items = null;
  15802. }
  15803. me.numericPrecision = null;
  15804. me.rangeMode = null;
  15805. me.rangeCount = null;
  15806. me.colorGradientType = null;
  15807. }
  15808. }]);
  15809. return MappingParameters;
  15810. }();
  15811. SuperMap.MappingParameters = MappingParameters;
  15812. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsParameter.js
  15813. function BuffersAnalystJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15814. 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); } }
  15815. function BuffersAnalystJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  15816. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15817. * This program are made available under the terms of the Apache License, Version 2.0
  15818. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15819. /**
  15820. * @class SuperMap.BuffersAnalystJobsParameter
  15821. * @category iServer ProcessingService BufferAnalyst
  15822. * @classdesc 缓冲区分析任务参数类。
  15823. * @param {Object} options - 参数。
  15824. * @param {string} options.datasetName - 数据集名。
  15825. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 分析范围(默认为全图范围)。
  15826. * @param {string} [options.distance='15'] - 缓冲距离,或缓冲区半径。
  15827. * @param {string} [options.distanceField='pickup_latitude'] - 缓冲区分析距离字段。
  15828. * @param {SuperMap.AnalystSizeUnit} [options.distanceUnit=SuperMap.AnalystSizeUnit.METER] - 缓冲距离单位单位。
  15829. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  15830. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  15831. */
  15832. var BuffersAnalystJobsParameter = /*#__PURE__*/function () {
  15833. function BuffersAnalystJobsParameter(options) {
  15834. BuffersAnalystJobsParameter_classCallCheck(this, BuffersAnalystJobsParameter);
  15835. /**
  15836. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.datasetName
  15837. * @description 数据集名。
  15838. */
  15839. this.datasetName = '';
  15840. /**
  15841. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.BuffersAnalystJobsParameter.prototype.bounds
  15842. * @description 分析范围。
  15843. */
  15844. this.bounds = '';
  15845. /**
  15846. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distance='15']
  15847. * @description 缓冲距离,或称为缓冲区半径。当缓冲距离字段位空时,此参数有效。
  15848. */
  15849. this.distance = '';
  15850. /**
  15851. * @member {string} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceField='pickup_latitude']
  15852. * @description 缓冲距离字段。
  15853. */
  15854. this.distanceField = '';
  15855. /**
  15856. * @member {SuperMap.AnalystSizeUnit} [SuperMap.BuffersAnalystJobsParameter.prototype.distanceUnit=SuperMap.AnalystSizeUnit.METER]
  15857. * @description 缓冲距离单位。
  15858. */
  15859. this.distanceUnit = AnalystSizeUnit.METER;
  15860. /**
  15861. * @member {string} SuperMap.BuffersAnalystJobsParameter.prototype.dissolveField
  15862. * @description 融合字段,根据字段值对缓冲区结果面对象进行融合。
  15863. */
  15864. this.dissolveField = '';
  15865. /**
  15866. * @member {SuperMap.OutputSetting} [SuperMap.BuffersAnalystJobsParameter.prototype.output]
  15867. * @description 输出参数设置类。
  15868. */
  15869. this.output = null;
  15870. /**
  15871. * @member {SuperMap.MappingParameters} [SuperMap.BuffersAnalystJobsParameter.prototype.mappingParameters]
  15872. * @description 分析后结果可视化的参数类。
  15873. */
  15874. this.mappingParameters = null;
  15875. if (!options) {
  15876. return this;
  15877. }
  15878. Util.extend(this, options);
  15879. this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsParameter';
  15880. }
  15881. /**
  15882. * @function SuperMap.BuffersAnalystJobsParameter.prototype.destroy
  15883. * @description 释放资源,将引用资源的属性置空。
  15884. */
  15885. BuffersAnalystJobsParameter_createClass(BuffersAnalystJobsParameter, [{
  15886. key: "destroy",
  15887. value: function destroy() {
  15888. this.datasetName = null;
  15889. this.bounds = null;
  15890. this.distance = null;
  15891. this.distanceField = null;
  15892. this.distanceUnit = null;
  15893. this.dissolveField = null;
  15894. if (this.output instanceof OutputSetting) {
  15895. this.output.destroy();
  15896. this.output = null;
  15897. }
  15898. if (this.mappingParameters instanceof MappingParameters) {
  15899. this.mappingParameters.destroy();
  15900. this.mappingParameters = null;
  15901. }
  15902. }
  15903. /**
  15904. * @function SuperMap.BuffersAnalystJobsParameter.toObject
  15905. * @param {SuperMap.BuffersAnalystJobsParameter} BuffersAnalystJobsParameter - 缓冲区分析任务参数。
  15906. * @param {Object} tempObj - 目标对象。
  15907. * @description 生成缓冲区分析任务对象。
  15908. */
  15909. }], [{
  15910. key: "toObject",
  15911. value: function toObject(BuffersAnalystJobsParameter, tempObj) {
  15912. for (var name in BuffersAnalystJobsParameter) {
  15913. if (name === 'datasetName') {
  15914. tempObj['input'] = tempObj['input'] || {};
  15915. tempObj['input'][name] = BuffersAnalystJobsParameter[name];
  15916. continue;
  15917. }
  15918. if (name === 'output') {
  15919. tempObj['output'] = tempObj['output'] || {};
  15920. tempObj['output'] = BuffersAnalystJobsParameter[name];
  15921. continue;
  15922. }
  15923. tempObj['analyst'] = tempObj['analyst'] || {};
  15924. if (name === 'bounds' && BuffersAnalystJobsParameter[name]) {
  15925. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name].toBBOX();
  15926. } else {
  15927. tempObj['analyst'][name] = BuffersAnalystJobsParameter[name];
  15928. }
  15929. if (name === 'mappingParameters') {
  15930. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  15931. tempObj['analyst']['mappingParameters'] = BuffersAnalystJobsParameter[name];
  15932. }
  15933. }
  15934. }
  15935. }]);
  15936. return BuffersAnalystJobsParameter;
  15937. }();
  15938. SuperMap.BuffersAnalystJobsParameter = BuffersAnalystJobsParameter;
  15939. ;// CONCATENATED MODULE: ./src/common/iServer/ProcessingServiceBase.js
  15940. function ProcessingServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingServiceBase_typeof(obj); }
  15941. function ProcessingServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  15942. 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); } }
  15943. function ProcessingServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  15944. function ProcessingServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ProcessingServiceBase_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ProcessingServiceBase_get(target, property, receiver || target); }
  15945. function ProcessingServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ProcessingServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  15946. 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 } }); if (superClass) ProcessingServiceBase_setPrototypeOf(subClass, superClass); }
  15947. function ProcessingServiceBase_setPrototypeOf(o, p) { ProcessingServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingServiceBase_setPrototypeOf(o, p); }
  15948. 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); }; }
  15949. function ProcessingServiceBase_possibleConstructorReturn(self, call) { if (call && (ProcessingServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingServiceBase_assertThisInitialized(self); }
  15950. function ProcessingServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  15951. function ProcessingServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  15952. function ProcessingServiceBase_getPrototypeOf(o) { ProcessingServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingServiceBase_getPrototypeOf(o); }
  15953. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  15954. * This program are made available under the terms of the Apache License, Version 2.0
  15955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  15956. /**
  15957. * @class SuperMap.ProcessingServiceBase
  15958. * @category iServer ProcessingService
  15959. * @classdesc 分布式分析服务基类
  15960. * @extends {SuperMap.CommonServiceBase}
  15961. * @param {string} url - 分布式分析服务地址。
  15962. * @param {Object} options - 参数。
  15963. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  15964. * @param {number} options.index - 服务访问地址在数组中的位置。
  15965. * @param {number} options.length - 服务访问地址数组长度。
  15966. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  15967. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  15968. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  15969. * @param {Object} [options.headers] - 请求头。
  15970. */
  15971. var ProcessingServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  15972. ProcessingServiceBase_inherits(ProcessingServiceBase, _CommonServiceBase);
  15973. var _super = ProcessingServiceBase_createSuper(ProcessingServiceBase);
  15974. function ProcessingServiceBase(url, options) {
  15975. var _this;
  15976. ProcessingServiceBase_classCallCheck(this, ProcessingServiceBase);
  15977. options = options || {};
  15978. /*
  15979. * Constant: EVENT_TYPES
  15980. * {Array.<string>}
  15981. * 此类支持的事件类型
  15982. * - *processCompleted* 创建成功后触发的事件。
  15983. * - *processFailed* 创建失败后触发的事件 。
  15984. * - *processRunning* 创建过程的整个阶段都会触发的事件,用于获取创建过程的状态 。
  15985. */
  15986. options.EVENT_TYPES = ["processCompleted", "processFailed", "processRunning"];
  15987. _this = _super.call(this, url, options);
  15988. _this.CLASS_NAME = "SuperMap.ProcessingServiceBase";
  15989. return _this;
  15990. }
  15991. /**
  15992. * @function SuperMap.ProcessingServiceBase.prototype.destroy
  15993. * @override
  15994. */
  15995. ProcessingServiceBase_createClass(ProcessingServiceBase, [{
  15996. key: "destroy",
  15997. value: function destroy() {
  15998. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "destroy", this).call(this);
  15999. }
  16000. /**
  16001. * @function SuperMap.ProcessingServiceBase.prototype.getJobs
  16002. * @description 获取分布式分析任务。
  16003. * @param {string} url - 资源地址。
  16004. */
  16005. }, {
  16006. key: "getJobs",
  16007. value: function getJobs(url) {
  16008. var me = this;
  16009. FetchRequest.get(me._processUrl(url), null, {
  16010. proxy: me.proxy
  16011. }).then(function (response) {
  16012. return response.json();
  16013. }).then(function (result) {
  16014. me.events.triggerEvent("processCompleted", {
  16015. result: result
  16016. });
  16017. })["catch"](function (e) {
  16018. me.eventListeners.processFailed({
  16019. error: e
  16020. });
  16021. });
  16022. }
  16023. /**
  16024. * @function SuperMap.ProcessingServiceBase.prototype.addJob
  16025. * @description 添加分布式分析任务。
  16026. * @param {string} url - 资源根地址。
  16027. * @param {Object} params - 创建一个空间分析的请求参数。
  16028. * @param {string} paramType - 请求参数类型。
  16029. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  16030. */
  16031. }, {
  16032. key: "addJob",
  16033. value: function addJob(url, params, paramType, seconds) {
  16034. var me = this,
  16035. parameterObject = null;
  16036. if (params && params instanceof paramType) {
  16037. parameterObject = new Object();
  16038. paramType.toObject(params, parameterObject);
  16039. }
  16040. var headers = Object.assign({
  16041. 'Content-Type': 'application/x-www-form-urlencoded'
  16042. }, me.headers || {});
  16043. var options = {
  16044. proxy: me.proxy,
  16045. headers: headers,
  16046. withCredentials: me.withCredentials,
  16047. crossOrigin: me.crossOrigin,
  16048. isInTheSameDomain: me.isInTheSameDomain
  16049. };
  16050. FetchRequest.post(me._processUrl(url), JSON.stringify(parameterObject), options).then(function (response) {
  16051. return response.json();
  16052. }).then(function (result) {
  16053. if (result.succeed) {
  16054. me.serviceProcessCompleted(result, seconds);
  16055. } else {
  16056. me.serviceProcessFailed(result);
  16057. }
  16058. })["catch"](function (e) {
  16059. me.serviceProcessFailed({
  16060. error: e
  16061. });
  16062. });
  16063. }
  16064. }, {
  16065. key: "serviceProcessCompleted",
  16066. value: function serviceProcessCompleted(result, seconds) {
  16067. result = Util.transformResult(result);
  16068. seconds = seconds || 1000;
  16069. var me = this;
  16070. if (result) {
  16071. var id = setInterval(function () {
  16072. FetchRequest.get(me._processUrl(result.newResourceLocation), {
  16073. _t: new Date().getTime()
  16074. }).then(function (response) {
  16075. return response.json();
  16076. }).then(function (job) {
  16077. me.events.triggerEvent("processRunning", {
  16078. id: job.id,
  16079. state: job.state
  16080. });
  16081. if (job.state.runState === 'LOST' || job.state.runState === 'KILLED' || job.state.runState === 'FAILED') {
  16082. clearInterval(id);
  16083. me.events.triggerEvent("processFailed", {
  16084. error: job.state.errorMsg,
  16085. state: job.state.runState
  16086. });
  16087. }
  16088. if (job.state.runState === 'FINISHED' && job.setting.serviceInfo) {
  16089. clearInterval(id);
  16090. me.events.triggerEvent("processCompleted", {
  16091. result: job
  16092. });
  16093. }
  16094. })["catch"](function (e) {
  16095. clearInterval(id);
  16096. me.events.triggerEvent("processFailed", {
  16097. error: e
  16098. });
  16099. });
  16100. }, seconds);
  16101. }
  16102. }
  16103. }, {
  16104. key: "serviceProcessFailed",
  16105. value: function serviceProcessFailed(result) {
  16106. ProcessingServiceBase_get(ProcessingServiceBase_getPrototypeOf(ProcessingServiceBase.prototype), "serviceProcessFailed", this).call(this, result);
  16107. }
  16108. }, {
  16109. key: "_processUrl",
  16110. value: function _processUrl(url) {
  16111. if (SecurityManager.getToken(url)) {
  16112. url = Util.urlAppend(url, 'token=' + SecurityManager.getToken(url));
  16113. }
  16114. return url;
  16115. }
  16116. }]);
  16117. return ProcessingServiceBase;
  16118. }(CommonServiceBase);
  16119. SuperMap.ProcessingServiceBase = ProcessingServiceBase;
  16120. ;// CONCATENATED MODULE: ./src/common/iServer/BuffersAnalystJobsService.js
  16121. function BuffersAnalystJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BuffersAnalystJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { BuffersAnalystJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BuffersAnalystJobsService_typeof(obj); }
  16122. function BuffersAnalystJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16123. 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); } }
  16124. function BuffersAnalystJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BuffersAnalystJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BuffersAnalystJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  16125. function BuffersAnalystJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BuffersAnalystJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return BuffersAnalystJobsService_get(target, property, receiver || target); }
  16126. function BuffersAnalystJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BuffersAnalystJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  16127. 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 } }); if (superClass) BuffersAnalystJobsService_setPrototypeOf(subClass, superClass); }
  16128. function BuffersAnalystJobsService_setPrototypeOf(o, p) { BuffersAnalystJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BuffersAnalystJobsService_setPrototypeOf(o, p); }
  16129. 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); }; }
  16130. function BuffersAnalystJobsService_possibleConstructorReturn(self, call) { if (call && (BuffersAnalystJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return BuffersAnalystJobsService_assertThisInitialized(self); }
  16131. function BuffersAnalystJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16132. function BuffersAnalystJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16133. function BuffersAnalystJobsService_getPrototypeOf(o) { BuffersAnalystJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BuffersAnalystJobsService_getPrototypeOf(o); }
  16134. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16135. * This program are made available under the terms of the Apache License, Version 2.0
  16136. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16137. /**
  16138. * @class SuperMap.BuffersAnalystJobsService
  16139. * @category iServer ProcessingService BufferAnalyst
  16140. * @classdesc 缓冲区分析服务类
  16141. * @extends {SuperMap.ProcessingServiceBase}
  16142. * @param {string} url - 服务地址。
  16143. * @param {Object} options - 参数。
  16144. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16145. * @param {Object} [options.headers] - 请求头。
  16146. */
  16147. var BuffersAnalystJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  16148. BuffersAnalystJobsService_inherits(BuffersAnalystJobsService, _ProcessingServiceBas);
  16149. var _super = BuffersAnalystJobsService_createSuper(BuffersAnalystJobsService);
  16150. function BuffersAnalystJobsService(url, options) {
  16151. var _this;
  16152. BuffersAnalystJobsService_classCallCheck(this, BuffersAnalystJobsService);
  16153. _this = _super.call(this, url, options);
  16154. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/buffers');
  16155. _this.CLASS_NAME = 'SuperMap.BuffersAnalystJobsService';
  16156. return _this;
  16157. }
  16158. /**
  16159. *@override
  16160. */
  16161. BuffersAnalystJobsService_createClass(BuffersAnalystJobsService, [{
  16162. key: "destroy",
  16163. value: function destroy() {
  16164. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "destroy", this).call(this);
  16165. }
  16166. /**
  16167. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJobs
  16168. * @description 获取缓冲区分析所有任务
  16169. */
  16170. }, {
  16171. key: "getBuffersJobs",
  16172. value: function getBuffersJobs() {
  16173. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, this.url);
  16174. }
  16175. /**
  16176. * @function SuperMap.BuffersAnalystJobsService.prototype.getBufferJob
  16177. * @description 获取指定id的缓冲区分析服务
  16178. * @param {string} id - 指定要获取数据的id。
  16179. */
  16180. }, {
  16181. key: "getBuffersJob",
  16182. value: function getBuffersJob(id) {
  16183. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  16184. }
  16185. /**
  16186. * @function SuperMap.BuffersAnalystJobsService.prototype.addBufferJob
  16187. * @description 新建缓冲区分析服务
  16188. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  16189. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  16190. */
  16191. }, {
  16192. key: "addBuffersJob",
  16193. value: function addBuffersJob(params, seconds) {
  16194. BuffersAnalystJobsService_get(BuffersAnalystJobsService_getPrototypeOf(BuffersAnalystJobsService.prototype), "addJob", this).call(this, this.url, params, BuffersAnalystJobsParameter, seconds);
  16195. }
  16196. }]);
  16197. return BuffersAnalystJobsService;
  16198. }(ProcessingServiceBase);
  16199. SuperMap.BuffersAnalystJobsService = BuffersAnalystJobsService;
  16200. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystParameters.js
  16201. function BurstPipelineAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16202. 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); } }
  16203. function BurstPipelineAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16204. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16205. * This program are made available under the terms of the Apache License, Version 2.0
  16206. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16207. /**
  16208. * @class SuperMap.BurstPipelineAnalystParameters
  16209. * @category iServer NetworkAnalyst BurstAnalyse
  16210. * @classdesc 爆管分析参数类。
  16211. * @param {Object} options - 参数。
  16212. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  16213. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  16214. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  16215. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  16216. */
  16217. var BurstPipelineAnalystParameters = /*#__PURE__*/function () {
  16218. function BurstPipelineAnalystParameters(options) {
  16219. BurstPipelineAnalystParameters_classCallCheck(this, BurstPipelineAnalystParameters);
  16220. var me = this;
  16221. /**
  16222. * @member {Array.<number>} SuperMap.BurstPipelineAnalystParameters.prototype.sourceNodeIDs
  16223. * @description 指定的设施点 ID 数组。
  16224. */
  16225. this.sourceNodeIDs = null;
  16226. /**
  16227. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.edgeID]
  16228. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  16229. */
  16230. this.edgeID = null;
  16231. /**
  16232. * @member {number} [SuperMap.BurstPipelineAnalystParameters.prototype.nodeID]
  16233. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  16234. */
  16235. this.nodeID = null;
  16236. /**
  16237. * @member {boolean} [SuperMap.BurstPipelineAnalystParameters.prototype.isUncertainDirectionValid=false]
  16238. * @description 指定不确定流向是否有效。
  16239. * 指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行。
  16240. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  16241. */
  16242. this.isUncertainDirectionValid = false;
  16243. Util.extend(me, options);
  16244. this.CLASS_NAME = "SuperMap.BurstPipelineAnalystParameters";
  16245. }
  16246. /**
  16247. * @function SuperMap.BurstPipelineAnalystParameters.prototype.destroy
  16248. * @description 释放资源,将引用资源的属性置空。
  16249. */
  16250. BurstPipelineAnalystParameters_createClass(BurstPipelineAnalystParameters, [{
  16251. key: "destroy",
  16252. value: function destroy() {
  16253. var me = this;
  16254. me.sourceNodeIDs = null;
  16255. me.edgeID = null;
  16256. me.nodeID = null;
  16257. me.isUncertainDirectionValid = null;
  16258. }
  16259. }]);
  16260. return BurstPipelineAnalystParameters;
  16261. }();
  16262. SuperMap.BurstPipelineAnalystParameters = BurstPipelineAnalystParameters;
  16263. ;// CONCATENATED MODULE: ./src/common/iServer/NetworkAnalystServiceBase.js
  16264. function NetworkAnalystServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalystServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalystServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalystServiceBase_typeof(obj); }
  16265. function NetworkAnalystServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16266. 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); } }
  16267. function NetworkAnalystServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  16268. function NetworkAnalystServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { NetworkAnalystServiceBase_get = Reflect.get; } 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(receiver); } return desc.value; }; } return NetworkAnalystServiceBase_get(target, property, receiver || target); }
  16269. function NetworkAnalystServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NetworkAnalystServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  16270. 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 } }); if (superClass) NetworkAnalystServiceBase_setPrototypeOf(subClass, superClass); }
  16271. function NetworkAnalystServiceBase_setPrototypeOf(o, p) { NetworkAnalystServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystServiceBase_setPrototypeOf(o, p); }
  16272. 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); }; }
  16273. function NetworkAnalystServiceBase_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystServiceBase_assertThisInitialized(self); }
  16274. function NetworkAnalystServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16275. function NetworkAnalystServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16276. function NetworkAnalystServiceBase_getPrototypeOf(o) { NetworkAnalystServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystServiceBase_getPrototypeOf(o); }
  16277. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16278. * This program are made available under the terms of the Apache License, Version 2.0
  16279. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16280. /**
  16281. * @class SuperMap.NetworkAnalystServiceBase
  16282. * @category iServer NetworkAnalyst
  16283. * @classdesc 网络分析服务基类。
  16284. * @description 网络分析服务基类。
  16285. * @extends {SuperMap.CommonServiceBase}
  16286. * @param {string} url - 网络分析服务地址。
  16287. * @param {Object} options - 参数。
  16288. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16289. * @param {Object} [options.headers] - 请求头。
  16290. */
  16291. var NetworkAnalystServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  16292. NetworkAnalystServiceBase_inherits(NetworkAnalystServiceBase, _CommonServiceBase);
  16293. var _super = NetworkAnalystServiceBase_createSuper(NetworkAnalystServiceBase);
  16294. function NetworkAnalystServiceBase(url, options) {
  16295. var _this;
  16296. NetworkAnalystServiceBase_classCallCheck(this, NetworkAnalystServiceBase);
  16297. _this = _super.call(this, url, options);
  16298. /**
  16299. * @member {SuperMap.DataFormat} [SuperMap.NetworkAnalystServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  16300. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"
  16301. */
  16302. _this.format = DataFormat.GEOJSON;
  16303. _this.CLASS_NAME = "SuperMap.NetworkAnalystServiceBase";
  16304. return _this;
  16305. }
  16306. /**
  16307. * @function SuperMap.NetworkAnalystServiceBase.prototype.destroy
  16308. * @description 释放资源,将引用的资源属性置空。
  16309. */
  16310. NetworkAnalystServiceBase_createClass(NetworkAnalystServiceBase, [{
  16311. key: "destroy",
  16312. value: function destroy() {
  16313. NetworkAnalystServiceBase_get(NetworkAnalystServiceBase_getPrototypeOf(NetworkAnalystServiceBase.prototype), "destroy", this).call(this);
  16314. this.format = null;
  16315. }
  16316. /**
  16317. * @function SuperMap.NetworkAnalystServiceBase.prototype.serviceProcessCompleted
  16318. * @description 分析完成,执行此方法。
  16319. * @param {Object} result - 服务器返回的结果对象。
  16320. */
  16321. }, {
  16322. key: "serviceProcessCompleted",
  16323. value: function serviceProcessCompleted(result) {
  16324. var me = this,
  16325. analystResult;
  16326. result = Util.transformResult(result);
  16327. if (result && me.format === DataFormat.GEOJSON && typeof me.toGeoJSONResult === 'function') {
  16328. analystResult = me.toGeoJSONResult(result);
  16329. }
  16330. if (!analystResult) {
  16331. analystResult = result;
  16332. }
  16333. me.events.triggerEvent("processCompleted", {
  16334. result: analystResult
  16335. });
  16336. }
  16337. /**
  16338. * @function SuperMap.NetworkAnalystServiceBase.prototype.toGeoJSONResult
  16339. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。只处理结果中的路由,由子类实现。
  16340. * @param {Object} result - 服务器返回的结果对象。
  16341. * @returns {GeoJSONObject} GeoJSON 对象。
  16342. */
  16343. }, {
  16344. key: "toGeoJSONResult",
  16345. value: function toGeoJSONResult(result) {
  16346. // eslint-disable-line no-unused-vars
  16347. return null;
  16348. }
  16349. }]);
  16350. return NetworkAnalystServiceBase;
  16351. }(CommonServiceBase);
  16352. SuperMap.NetworkAnalystServiceBase = NetworkAnalystServiceBase;
  16353. ;// CONCATENATED MODULE: ./src/common/iServer/BurstPipelineAnalystService.js
  16354. function BurstPipelineAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { BurstPipelineAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { BurstPipelineAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return BurstPipelineAnalystService_typeof(obj); }
  16355. function BurstPipelineAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16356. 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); } }
  16357. function BurstPipelineAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) BurstPipelineAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) BurstPipelineAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  16358. function BurstPipelineAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { BurstPipelineAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return BurstPipelineAnalystService_get(target, property, receiver || target); }
  16359. function BurstPipelineAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = BurstPipelineAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  16360. 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 } }); if (superClass) BurstPipelineAnalystService_setPrototypeOf(subClass, superClass); }
  16361. function BurstPipelineAnalystService_setPrototypeOf(o, p) { BurstPipelineAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return BurstPipelineAnalystService_setPrototypeOf(o, p); }
  16362. 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); }; }
  16363. function BurstPipelineAnalystService_possibleConstructorReturn(self, call) { if (call && (BurstPipelineAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return BurstPipelineAnalystService_assertThisInitialized(self); }
  16364. function BurstPipelineAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16365. function BurstPipelineAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16366. function BurstPipelineAnalystService_getPrototypeOf(o) { BurstPipelineAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return BurstPipelineAnalystService_getPrototypeOf(o); }
  16367. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16368. * This program are made available under the terms of the Apache License, Version 2.0
  16369. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16370. /**
  16371. * @class SuperMap.BurstPipelineAnalystService
  16372. * @category iServer NetworkAnalyst BurstAnalyse
  16373. * @classdesc 爆管分析服务类,即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组、普通结点 ID 数组及其上下游弧段 ID 数组。
  16374. * @extends {SuperMap.NetworkAnalystServiceBase}
  16375. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  16376. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源},
  16377. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  16378. * @param {Object} options - 参数。
  16379. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  16380. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16381. * @param {Object} [options.headers] - 请求头。
  16382. */
  16383. var BurstPipelineAnalystService = /*#__PURE__*/function (_NetworkAnalystServic) {
  16384. BurstPipelineAnalystService_inherits(BurstPipelineAnalystService, _NetworkAnalystServic);
  16385. var _super = BurstPipelineAnalystService_createSuper(BurstPipelineAnalystService);
  16386. function BurstPipelineAnalystService(url, options) {
  16387. var _this;
  16388. BurstPipelineAnalystService_classCallCheck(this, BurstPipelineAnalystService);
  16389. _this = _super.call(this, url, options);
  16390. _this.CLASS_NAME = "SuperMap.BurstPipelineAnalystService";
  16391. return _this;
  16392. }
  16393. /**
  16394. * @function SuperMap.BurstPipelineAnalystService.prototype.destroy
  16395. * @override
  16396. */
  16397. BurstPipelineAnalystService_createClass(BurstPipelineAnalystService, [{
  16398. key: "destroy",
  16399. value: function destroy() {
  16400. BurstPipelineAnalystService_get(BurstPipelineAnalystService_getPrototypeOf(BurstPipelineAnalystService.prototype), "destroy", this).call(this);
  16401. }
  16402. /**
  16403. * @function SuperMap.BurstPipelineAnalystService.prototype.processAsync
  16404. * @description 负责将客户端的查询参数传递到服务端。
  16405. * @params {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析参数类
  16406. */
  16407. }, {
  16408. key: "processAsync",
  16409. value: function processAsync(params) {
  16410. if (!(params instanceof BurstPipelineAnalystParameters)) {
  16411. return null;
  16412. }
  16413. var me = this,
  16414. jsonObject;
  16415. me.url = Util.urlPathAppend(me.url, 'burstAnalyse');
  16416. jsonObject = {
  16417. sourceNodeIDs: params.sourceNodeIDs,
  16418. isUncertainDirectionValid: params.isUncertainDirectionValid
  16419. }; //必传参数不正确,就终止
  16420. if (params.edgeID !== null && params.nodeID !== null) {
  16421. throw new Error('edgeID and nodeID cannot be null at the same time.');
  16422. }
  16423. if (params.edgeID === null && params.nodeID === null) {
  16424. throw new Error('edgeID and nodeID cannot be null at the same time.');
  16425. }
  16426. if (params.edgeID !== null) {
  16427. jsonObject.edgeID = params.edgeID;
  16428. } else {
  16429. jsonObject.nodeID = params.nodeID;
  16430. }
  16431. me.request({
  16432. method: "GET",
  16433. params: jsonObject,
  16434. scope: me,
  16435. success: me.serviceProcessCompleted,
  16436. failure: me.serviceProcessFailed
  16437. });
  16438. }
  16439. }]);
  16440. return BurstPipelineAnalystService;
  16441. }(NetworkAnalystServiceBase);
  16442. SuperMap.BurstPipelineAnalystService = BurstPipelineAnalystService;
  16443. ;// CONCATENATED MODULE: ./src/common/iServer/ChartFeatureInfoSpecsService.js
  16444. function ChartFeatureInfoSpecsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartFeatureInfoSpecsService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartFeatureInfoSpecsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartFeatureInfoSpecsService_typeof(obj); }
  16445. function ChartFeatureInfoSpecsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16446. 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); } }
  16447. function ChartFeatureInfoSpecsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartFeatureInfoSpecsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartFeatureInfoSpecsService_defineProperties(Constructor, staticProps); return Constructor; }
  16448. function ChartFeatureInfoSpecsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ChartFeatureInfoSpecsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ChartFeatureInfoSpecsService_get(target, property, receiver || target); }
  16449. function ChartFeatureInfoSpecsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ChartFeatureInfoSpecsService_getPrototypeOf(object); if (object === null) break; } return object; }
  16450. 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 } }); if (superClass) ChartFeatureInfoSpecsService_setPrototypeOf(subClass, superClass); }
  16451. function ChartFeatureInfoSpecsService_setPrototypeOf(o, p) { ChartFeatureInfoSpecsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartFeatureInfoSpecsService_setPrototypeOf(o, p); }
  16452. 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); }; }
  16453. function ChartFeatureInfoSpecsService_possibleConstructorReturn(self, call) { if (call && (ChartFeatureInfoSpecsService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartFeatureInfoSpecsService_assertThisInitialized(self); }
  16454. function ChartFeatureInfoSpecsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16455. function ChartFeatureInfoSpecsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16456. function ChartFeatureInfoSpecsService_getPrototypeOf(o) { ChartFeatureInfoSpecsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartFeatureInfoSpecsService_getPrototypeOf(o); }
  16457. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16458. * This program are made available under the terms of the Apache License, Version 2.0
  16459. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16460. /**
  16461. * @class SuperMap.ChartFeatureInfoSpecsService
  16462. * @category iServer Map Chart
  16463. * @classdesc 海图物标信息服务类,通过该服务类可以查询到服务端支持的所有海图物标信息。
  16464. * 用户可以通过两种方式获取查询结果:
  16465. * 一种是通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件;
  16466. * 另一种是使用 AsyncResponder 类实现异步处理。
  16467. * @extends {SuperMap.CommonServiceBase}
  16468. * @param {string} url - 地图(特指海图)服务地址。
  16469. * 如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  16470. * 发送请求格式类似于:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图/chartFeatureInfoSpecs.json"。
  16471. * @param {Object} options - 参数。
  16472. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  16473. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  16474. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为"ISERVER","GEOJSON"。
  16475. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16476. * @param {Object} [options.headers] - 请求头。
  16477. */
  16478. var ChartFeatureInfoSpecsService = /*#__PURE__*/function (_CommonServiceBase) {
  16479. ChartFeatureInfoSpecsService_inherits(ChartFeatureInfoSpecsService, _CommonServiceBase);
  16480. var _super = ChartFeatureInfoSpecsService_createSuper(ChartFeatureInfoSpecsService);
  16481. function ChartFeatureInfoSpecsService(url, options) {
  16482. var _this;
  16483. ChartFeatureInfoSpecsService_classCallCheck(this, ChartFeatureInfoSpecsService);
  16484. _this = _super.call(this, url, options);
  16485. _this.CLASS_NAME = "SuperMap.ChartFeatureInfoSpecsService";
  16486. return _this;
  16487. }
  16488. /**
  16489. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.destroy
  16490. * @override
  16491. */
  16492. ChartFeatureInfoSpecsService_createClass(ChartFeatureInfoSpecsService, [{
  16493. key: "destroy",
  16494. value: function destroy() {
  16495. ChartFeatureInfoSpecsService_get(ChartFeatureInfoSpecsService_getPrototypeOf(ChartFeatureInfoSpecsService.prototype), "destroy", this).call(this);
  16496. Util.reset(this);
  16497. }
  16498. /**
  16499. * @function SuperMap.ChartFeatureInfoSpecsService.prototype.processAsync
  16500. * @description 根据地图(特指海图)服务地址与服务端完成异步通讯,获取物标信息。
  16501. * 当查询物标信息成功时,将触发 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE
  16502. * 事件。用可以通过户两种方式获取图层信息:
  16503. * 1. 通过 AsyncResponder 类获取(推荐使用);
  16504. * 2. 通过监听 ChartFeatureInfoSpecsEvent.PROCESS_COMPLETE 事件获取。
  16505. */
  16506. }, {
  16507. key: "processAsync",
  16508. value: function processAsync() {
  16509. var me = this,
  16510. method = "GET";
  16511. if (!me.isTempLayers) {
  16512. Util.urlPathAppend(me.url, 'chartFeatureInfoSpecs');
  16513. }
  16514. me.request({
  16515. method: method,
  16516. params: null,
  16517. scope: me,
  16518. success: me.serviceProcessCompleted,
  16519. failure: me.serviceProcessFailed
  16520. });
  16521. }
  16522. }]);
  16523. return ChartFeatureInfoSpecsService;
  16524. }(CommonServiceBase);
  16525. SuperMap.ChartFeatureInfoSpecsService = ChartFeatureInfoSpecsService;
  16526. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryFilterParameter.js
  16527. function ChartQueryFilterParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16528. 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); } }
  16529. function ChartQueryFilterParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryFilterParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryFilterParameter_defineProperties(Constructor, staticProps); return Constructor; }
  16530. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16531. * This program are made available under the terms of the Apache License, Version 2.0
  16532. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16533. /**
  16534. * @class SuperMap.ChartQueryFilterParameter
  16535. * @category iServer Map Chart
  16536. * @classdesc 海图查询过滤参数类,用于设置海图查询的过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  16537. * @param {Object} options - 参数。
  16538. * @param {string} options.attributeFilter - 属性字段过滤条件。
  16539. * @param {number} options.chartFeatureInfoSpecCode - 查询的物标代号。
  16540. * @param {boolean} [options.isQueryPoint] - 是否查询点。
  16541. * @param {boolean} [options.isQueryLine] - 是否查询线。
  16542. * @param {boolean} [options.isQueryRegion] - 是否查询面。
  16543. */
  16544. var ChartQueryFilterParameter = /*#__PURE__*/function () {
  16545. function ChartQueryFilterParameter(options) {
  16546. ChartQueryFilterParameter_classCallCheck(this, ChartQueryFilterParameter);
  16547. /**
  16548. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryPoint]
  16549. * @description 是否查询点。
  16550. */
  16551. this.isQueryPoint = null;
  16552. /**
  16553. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryLine]
  16554. * @description 是否查询线。
  16555. */
  16556. this.isQueryLine = null;
  16557. /**
  16558. * @member {boolean} [SuperMap.ChartQueryFilterParameter.prototype.isQueryRegion]
  16559. * @description 是否查询面。
  16560. */
  16561. this.isQueryRegion = null;
  16562. /**
  16563. * @member {string} SuperMap.ChartQueryFilterParameter.prototype.attributeFilter
  16564. * @description 属性字段过滤条件。
  16565. */
  16566. this.attributeFilter = null;
  16567. /**
  16568. * @member {number} SuperMap.ChartQueryFilterParameter.prototype.chartFeatureInfoSpecCode
  16569. * @description 查询的物标代号。
  16570. */
  16571. this.chartFeatureInfoSpecCode = null;
  16572. Util.extend(this, options);
  16573. this.CLASS_NAME = "SuperMap.ChartQueryFilterParameter";
  16574. }
  16575. /**
  16576. * @function SuperMap.ChartQueryFilterParameter.prototype.destroy
  16577. * @description 释放资源,将引用资源的属性置空。
  16578. */
  16579. ChartQueryFilterParameter_createClass(ChartQueryFilterParameter, [{
  16580. key: "destroy",
  16581. value: function destroy() {
  16582. var me = this;
  16583. me.isQueryPoint = null;
  16584. me.isQueryLine = null;
  16585. me.isQueryRegion = null;
  16586. me.attributeFilter = null;
  16587. me.chartFeatureInfoSpecCode = null;
  16588. }
  16589. /**
  16590. * @function SuperMap.ChartQueryFilterParameter.prototype.toJson
  16591. * @description 将属性信息转化成 JSON 格式字符串。
  16592. */
  16593. }, {
  16594. key: "toJson",
  16595. value: function toJson() {
  16596. var json = "";
  16597. json += "\"isQueryPoint\":" + this.isQueryPoint + ",";
  16598. json += "\"isQueryLine\":" + this.isQueryLine + ",";
  16599. json += "\"isQueryRegion\":" + this.isQueryRegion + ",";
  16600. if (this.attributeFilter) {
  16601. json += "\"attributeFilter\": \"" + this.attributeFilter + "\",";
  16602. }
  16603. json += "\"chartFeatureInfoSpecCode\":" + this.chartFeatureInfoSpecCode;
  16604. json = "{" + json + "}";
  16605. return json;
  16606. }
  16607. }]);
  16608. return ChartQueryFilterParameter;
  16609. }();
  16610. SuperMap.ChartQueryFilterParameter = ChartQueryFilterParameter;
  16611. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryParameters.js
  16612. function ChartQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16613. 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); } }
  16614. function ChartQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16615. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16616. * This program are made available under the terms of the Apache License, Version 2.0
  16617. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16618. /**
  16619. * @class SuperMap.ChartQueryParameters
  16620. * @category iServer Map Chart
  16621. * @classdesc 海图查询参数类,该类用于设置海图查询时的相关参数,海图查询分为海图属性查询和海图范围查询两类,通过属性 queryMode 指定查询模式。
  16622. * 必设属性有:queryMode、chartLayerNames、chartQueryFilterParameters。当进行海图范围查询时,必设属性还包括 bounds。
  16623. * @param {Object} options - 参数。
  16624. * @param {string} options.queryMode - 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery")。
  16625. * @param {Array.<string>} options.chartLayerNames - 查询的海图图层的名称。
  16626. * @param {Array.<{SuperMap.ChartQueryFilterParameter}>} options.chartQueryFilterParameters - 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  16627. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 海图查询范围。当进行海图范围查询时,此参数为必选。
  16628. * @param {boolean} [options.returnContent=true] - 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  16629. * @param {number} [options.startRecord=0] - 查询起始记录位置。
  16630. * @param {number} [options.expectCount] - 期望查询结果返回的记录数,该值大于0。
  16631. */
  16632. var ChartQueryParameters = /*#__PURE__*/function () {
  16633. function ChartQueryParameters(options) {
  16634. ChartQueryParameters_classCallCheck(this, ChartQueryParameters);
  16635. /**
  16636. * @member {string} SuperMap.ChartQueryParameters.prototype.queryMode
  16637. * @description 海图查询模式类型,支持两种查询方式:海图属性查询("ChartAttributeQuery")和海图空间查询("ChartBoundsQuery") 。
  16638. */
  16639. this.queryMode = null;
  16640. /**
  16641. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.ChartQueryParameters.prototype.bounds
  16642. * @description 海图查询范围。
  16643. */
  16644. this.bounds = null;
  16645. /**
  16646. * @member {Array.<string>} SuperMap.ChartQueryParameters.prototype.chartLayerNames
  16647. * @description 查询的海图图层的名称。
  16648. */
  16649. this.chartLayerNames = null;
  16650. /**
  16651. * @member {Array.<SuperMap.ChartQueryFilterParameter>} SuperMap.ChartQueryParameters.prototype.chartQueryFilterParameters
  16652. * @description 海图查询过滤参数。包括:物标代码、物标可应用对象的选择(是否查询点、线或面)、属性字段过滤条件。
  16653. */
  16654. this.chartQueryFilterParameters = null;
  16655. /**
  16656. * @member {boolean} [SuperMap.ChartQueryParameters.prototype.returnContent=true]
  16657. * @description 获取或设置是返回查询结果记录集 recordsets,还是返回查询结果的资源 resourceInfo。
  16658. */
  16659. this.returnContent = true;
  16660. /**
  16661. * @member {number} [SuperMap.ChartQueryParameters.prototype.startRecord=0]
  16662. * @description 查询起始记录位置。
  16663. */
  16664. this.startRecord = 0;
  16665. /**
  16666. * @member {number} [SuperMap.ChartQueryParameters.prototype.expectCount]
  16667. * @description 期望查询结果返回的记录数,该值大于0。
  16668. */
  16669. this.expectCount = null;
  16670. Util.extend(this, options);
  16671. this.CLASS_NAME = "SuperMap.ChartQueryParameters";
  16672. }
  16673. /**
  16674. * @function SuperMap.ChartQueryParameters.prototype.destroy
  16675. * @description 释放资源,将引用资源的属性置空。
  16676. */
  16677. ChartQueryParameters_createClass(ChartQueryParameters, [{
  16678. key: "destroy",
  16679. value: function destroy() {
  16680. var me = this;
  16681. me.queryMode = null;
  16682. me.bounds = null;
  16683. me.chartLayerNames = null;
  16684. me.chartQueryFilterParameters = null;
  16685. me.returnContent = true;
  16686. me.startRecord = 0;
  16687. me.expectCount = null;
  16688. }
  16689. /**
  16690. * @function SuperMap.ChartQueryParameters.prototype.getVariablesJson
  16691. * @description 将属性信息转换成能够被服务识别的 JSON 格式字符串。
  16692. * @returns {string} JSON 字符串。
  16693. */
  16694. }, {
  16695. key: "getVariablesJson",
  16696. value: function getVariablesJson() {
  16697. var json = "";
  16698. json += "\"queryMode\":\"" + this.queryMode + "\",";
  16699. if (this.chartLayerNames && this.chartLayerNames.length) {
  16700. var chartLayersArray = [];
  16701. var layerLength = this.chartLayerNames.length;
  16702. for (var i = 0; i < layerLength; i++) {
  16703. chartLayersArray.push("\"" + this.chartLayerNames[i] + "\"");
  16704. }
  16705. var layerNames = "[" + chartLayersArray.join(",") + "]";
  16706. json += "\"chartLayerNames\":" + layerNames + ",";
  16707. }
  16708. if (this.queryMode === "ChartBoundsQuery" && this.bounds) {
  16709. json += "\"bounds\":" + "{" + "\"leftBottom\":" + "{" + "\"x\":" + this.bounds.left + "," + "\"y\":" + this.bounds.bottom + "}" + "," + "\"rightTop\":" + "{" + "\"x\":" + this.bounds.right + "," + "\"y\":" + this.bounds.top + "}" + "},";
  16710. }
  16711. if (this.chartQueryFilterParameters && this.chartQueryFilterParameters.length) {
  16712. var chartParamArray = [];
  16713. var chartLength = this.chartQueryFilterParameters.length;
  16714. for (var j = 0; j < chartLength; j++) {
  16715. var chartQueryFilterParameter = this.chartQueryFilterParameters[j];
  16716. if (!(chartQueryFilterParameter instanceof ChartQueryFilterParameter)) {
  16717. continue;
  16718. }
  16719. chartParamArray.push(chartQueryFilterParameter.toJson());
  16720. }
  16721. var chartParamsJson = "[" + chartParamArray.join(",") + "]";
  16722. chartParamsJson = "\"chartQueryParams\":" + chartParamsJson + ",";
  16723. chartParamsJson += "\"startRecord\":" + this.startRecord + ",";
  16724. chartParamsJson += "\"expectCount\":" + this.expectCount;
  16725. chartParamsJson = "{" + chartParamsJson + "}";
  16726. json += "\"chartQueryParameters\":" + chartParamsJson;
  16727. }
  16728. json = "{" + json + "}";
  16729. return json;
  16730. }
  16731. }]);
  16732. return ChartQueryParameters;
  16733. }();
  16734. SuperMap.ChartQueryParameters = ChartQueryParameters;
  16735. ;// CONCATENATED MODULE: ./src/common/iServer/QueryParameters.js
  16736. function QueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16737. 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); } }
  16738. function QueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  16739. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16740. * This program are made available under the terms of the Apache License, Version 2.0
  16741. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16742. /**
  16743. * @class SuperMap.QueryParameters
  16744. * @category iServer Map QueryResults
  16745. * @classdesc 查询参数基类。距离查询、SQL 查询、几何地物查询等各自的参数均继承此类。
  16746. * @param {Object} options - 参数。
  16747. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  16748. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  16749. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  16750. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  16751. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  16752. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  16753. * @param {number} [options.startRecord=0] - 查询起始记录号。
  16754. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  16755. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  16756. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  16757. */
  16758. var QueryParameters = /*#__PURE__*/function () {
  16759. function QueryParameters(options) {
  16760. QueryParameters_classCallCheck(this, QueryParameters);
  16761. if (!options) {
  16762. return;
  16763. }
  16764. /**
  16765. * @member {string} [SuperMap.QueryParameters.prototype.customParams]
  16766. * @description 自定义参数,供扩展使用。
  16767. */
  16768. this.customParams = null;
  16769. /**
  16770. * @member {Object} [SuperMap.QueryParameters.prototype.prjCoordSys]
  16771. * @description 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}
  16772. */
  16773. this.prjCoordSys = null;
  16774. /**
  16775. * @member {number} [SuperMap.QueryParameters.prototype.expectCount=100000]
  16776. * @description 期望返回结果记录个数,默认返回100000条查询记录,
  16777. * 如果实际不足100000条则返回实际记录条数。
  16778. */
  16779. this.expectCount = 100000;
  16780. /**
  16781. * @member {SuperMap.GeometryType} [SuperMap.QueryParameters.prototype.networkType=SuperMap.GeometryType.LINE]
  16782. * @description 网络数据集对应的查询类型,分为点和线两种类型。
  16783. */
  16784. this.networkType = GeometryType.LINE;
  16785. /**
  16786. * @member {SuperMap.QueryOption} [SuperMap.QueryParameters.prototype.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY]
  16787. * @description 查询结果类型枚举类。
  16788. * 该类描述查询结果返回类型,包括只返回属性、
  16789. * 只返回几何实体以及返回属性和几何实体。
  16790. */
  16791. this.queryOption = QueryOption.ATTRIBUTEANDGEOMETRY;
  16792. /**
  16793. * @member {Array.<SuperMap.FilterParameter>} SuperMap.QueryParameters.prototype.queryParams
  16794. * @description 查询过滤条件参数数组。
  16795. * 该类用于设置查询数据集的查询过滤参数。
  16796. */
  16797. this.queryParams = null;
  16798. /**
  16799. * @member {number} [SuperMap.QueryParameters.prototype.startRecord=0]
  16800. * @description 查询起始记录号。
  16801. */
  16802. this.startRecord = 0;
  16803. /**
  16804. * @member {number} [SuperMap.QueryParameters.prototype.holdTime=10]
  16805. * @description 资源在服务端保存的时间,单位为分钟。
  16806. */
  16807. this.holdTime = 10;
  16808. /**
  16809. * @member {boolean} [SuperMap.QueryParameters.prototype.returnCustomResult=false]
  16810. * @description 仅供三维使用。
  16811. */
  16812. this.returnCustomResult = false;
  16813. /**
  16814. * @member {boolean} [SuperMap.QueryParameters.prototype.returnFeatureWithFieldCaption=false]
  16815. * @description 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  16816. */
  16817. this.returnFeatureWithFieldCaption = false;
  16818. Util.extend(this, options);
  16819. this.CLASS_NAME = "SuperMap.QueryParameters";
  16820. }
  16821. /**
  16822. * @function SuperMap.QueryParameters.prototype.destroy
  16823. * @description 释放资源,将引用资源的属性置空。
  16824. */
  16825. QueryParameters_createClass(QueryParameters, [{
  16826. key: "destroy",
  16827. value: function destroy() {
  16828. var me = this;
  16829. me.customParams = null;
  16830. me.expectCount = null;
  16831. me.networkType = null;
  16832. me.queryOption = null;
  16833. if (me.queryParams) {
  16834. for (var i = 0, qps = me.queryParams, len = qps.length; i < len; i++) {
  16835. qps[i].destroy();
  16836. }
  16837. me.queryParams = null;
  16838. }
  16839. me.startRecord = null;
  16840. me.holdTime = null;
  16841. me.returnCustomResult = null;
  16842. me.prjCoordSys = null;
  16843. }
  16844. }]);
  16845. return QueryParameters;
  16846. }();
  16847. SuperMap.QueryParameters = QueryParameters;
  16848. ;// CONCATENATED MODULE: ./src/common/iServer/ChartQueryService.js
  16849. function ChartQueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartQueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartQueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartQueryService_typeof(obj); }
  16850. function ChartQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  16851. 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); } }
  16852. function ChartQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  16853. 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 } }); if (superClass) ChartQueryService_setPrototypeOf(subClass, superClass); }
  16854. function ChartQueryService_setPrototypeOf(o, p) { ChartQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartQueryService_setPrototypeOf(o, p); }
  16855. 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); }; }
  16856. function ChartQueryService_possibleConstructorReturn(self, call) { if (call && (ChartQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartQueryService_assertThisInitialized(self); }
  16857. function ChartQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  16858. function ChartQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  16859. function ChartQueryService_getPrototypeOf(o) { ChartQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartQueryService_getPrototypeOf(o); }
  16860. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  16861. * This program are made available under the terms of the Apache License, Version 2.0
  16862. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  16863. /**
  16864. * @class SuperMap.ChartQueryService
  16865. * @category iServer Map Chart
  16866. * @classdesc 海图查询服务类。该类负责将海图查询所需参数(ChartQueryParameters)传递至服务端,并获取服务端的返回结果。
  16867. * 用户可以通过两种方式获取查询结果:
  16868. * 1.通过 AsyncResponder 类获取(推荐使用);
  16869. * 2.通过监听 QueryEvent.PROCESS_COMPLETE 事件获取。
  16870. * @extends {SuperMap.CommonServiceBase}
  16871. * @param {string} url - 地图查询服务访问地址。如:"http://localhost:8090/iserver/services/map-ChartW/rest/maps/海图"。
  16872. * @param {Object} options - 参数。
  16873. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  16874. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  16875. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为"ISERVER","GEOJSON"。
  16876. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  16877. * @param {Object} [options.headers] - 请求头。
  16878. * @example
  16879. * 下面示例显示了如何进行海图属性查询:
  16880. * var nameArray = ["GB4X0000_52000"];
  16881. * var chartQueryFilterParameter = new ChartQueryFilterParameter({
  16882. * isQueryPoint:true,
  16883. * isQueryLine:true,
  16884. * isQueryRegion:true,
  16885. * attributeFilter:"SmID<10",
  16886. * chartFeatureInfoSpecCode:1
  16887. * });
  16888. *
  16889. * var chartQueryParameters = new SuperMap.ChartQueryParameters({
  16890. * queryMode:"ChartAttributeQuery",
  16891. * chartLayerNames:nameArray,
  16892. * returnContent:true,
  16893. * chartQueryFilterParameters:[chartQueryFilterParameter]
  16894. * });
  16895. *
  16896. * var chartQueryService = new SuperMap.ChartQueryService(url);
  16897. *
  16898. * chartQueryService.events.on({
  16899. * "processCompleted":processCompleted,
  16900. * "processFailed":processFailed
  16901. * });
  16902. * chartQueryService.processAsync(chartQueryParameters);
  16903. */
  16904. var ChartQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  16905. ChartQueryService_inherits(ChartQueryService, _CommonServiceBase);
  16906. var _super = ChartQueryService_createSuper(ChartQueryService);
  16907. function ChartQueryService(url, options) {
  16908. var _this;
  16909. ChartQueryService_classCallCheck(this, ChartQueryService);
  16910. _this = _super.call(this, url, options);
  16911. options = options || {};
  16912. /**
  16913. * @member {boolean} SuperMap.ChartQueryService.prototype.returnContent
  16914. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  16915. */
  16916. _this.returnContent = null;
  16917. /**
  16918. * @member {SuperMap.DataFormat} SuperMap.ChartQueryService.prototype.format
  16919. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式
  16920. * 参数格式为"ISERVER","GEOJSON",GEOJSON
  16921. */
  16922. _this.format = DataFormat.GEOJSON;
  16923. Util.extend(ChartQueryService_assertThisInitialized(_this), options);
  16924. var me = ChartQueryService_assertThisInitialized(_this);
  16925. if (options.format) {
  16926. me.format = options.format.toUpperCase();
  16927. }
  16928. if (!me.url) {
  16929. return ChartQueryService_possibleConstructorReturn(_this);
  16930. }
  16931. me.url = Util.urlPathAppend(me.url, 'queryResults');
  16932. _this.CLASS_NAME = "SuperMap.ChartQueryService";
  16933. return _this;
  16934. }
  16935. /**
  16936. * @function SuperMap.ChartQueryService.prototype.destroy
  16937. * @override
  16938. */
  16939. ChartQueryService_createClass(ChartQueryService, [{
  16940. key: "destroy",
  16941. value: function destroy() {
  16942. var me = this;
  16943. CommonServiceBase.prototype.destroy.apply(this, arguments);
  16944. me.returnContent = null;
  16945. me.format = null;
  16946. }
  16947. /**
  16948. * @function SuperMap.ChartQueryService.prototype.processAsync
  16949. * @description 使用服务地址 URL 实例化 ChartQueryService 对象。
  16950. * @param {SuperMap.ChartQueryParameters} params - 查询参数。
  16951. */
  16952. }, {
  16953. key: "processAsync",
  16954. value: function processAsync(params) {
  16955. //todo重点需要添加代码的地方
  16956. if (!(params instanceof ChartQueryParameters)) {
  16957. return;
  16958. }
  16959. var me = this,
  16960. jsonParameters;
  16961. me.returnContent = params.returnContent;
  16962. jsonParameters = params.getVariablesJson();
  16963. if (me.returnContent) {
  16964. me.url = Util.urlAppend(me.url, 'returnContent=true');
  16965. }
  16966. me.request({
  16967. method: "POST",
  16968. data: jsonParameters,
  16969. scope: me,
  16970. success: me.serviceProcessCompleted,
  16971. failure: me.serviceProcessFailed
  16972. });
  16973. }
  16974. /**
  16975. * @function SuperMap.ChartQueryService.prototype.serviceProcessCompleted
  16976. * @description 查询完成,执行此方法。
  16977. * @param {Object} result - 服务器返回的结果对象。
  16978. */
  16979. }, {
  16980. key: "serviceProcessCompleted",
  16981. value: function serviceProcessCompleted(result) {
  16982. var me = this;
  16983. result = Util.transformResult(result);
  16984. if (result && result.recordsets && me.format === DataFormat.GEOJSON) {
  16985. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  16986. if (recordsets[i].features) {
  16987. var geoJSONFormat = new GeoJSON();
  16988. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  16989. }
  16990. }
  16991. }
  16992. me.events.triggerEvent("processCompleted", {
  16993. result: result
  16994. });
  16995. }
  16996. /**
  16997. * @function SuperMap.ChartQueryService.prototype.getQueryParameters
  16998. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  16999. * @param {Object} params - JSON 字符串表示的查询参数。
  17000. * @returns {SuperMap.QueryParameters} 返回查询结果
  17001. */
  17002. }, {
  17003. key: "getQueryParameters",
  17004. value: function getQueryParameters(params) {
  17005. return new QueryParameters({
  17006. queryMode: params.queryMode,
  17007. bounds: params.bounds,
  17008. chartLayerNames: params.chartLayerNames,
  17009. chartQueryFilterParameters: params.chartQueryFilterParameters,
  17010. returnContent: params.returnContent
  17011. });
  17012. }
  17013. }]);
  17014. return ChartQueryService;
  17015. }(CommonServiceBase);
  17016. SuperMap.ChartQueryService = ChartQueryService;
  17017. ;// CONCATENATED MODULE: ./src/common/iServer/ClipParameter.js
  17018. function ClipParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17019. 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); } }
  17020. function ClipParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) ClipParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) ClipParameter_defineProperties(Constructor, staticProps); return Constructor; }
  17021. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17022. * This program are made available under the terms of the Apache License, Version 2.0
  17023. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17024. /**
  17025. * @class SuperMap.ClipParameter
  17026. * @category iServer SpatialAnalyst InterpolationAnalyst
  17027. * @classdesc 用于裁剪的参数。
  17028. * @description 优先使用用户指定的裁剪区域多边形进行裁剪,也可以通过指定数据源和数据集名,从而使用指定数据集的边界多边形进行裁剪。
  17029. * @param {Object} options - 参数。
  17030. * @param {string} [options.clipDatasetName] - 裁剪的数据集名。
  17031. * @param {string} [options.clipDatasourceName] - 裁剪的数据集所在数据源的名字。
  17032. * @param {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} [options.clipRegion] - 用户指定的裁剪区域。
  17033. * @param {boolean} [options.isClipInRegion=true] - 是否对裁剪区内的数据集进行裁剪。
  17034. * @param {boolean} [options.isExactClip=true] - 是否使用精确裁剪。
  17035. */
  17036. var ClipParameter = /*#__PURE__*/function () {
  17037. function ClipParameter(options) {
  17038. ClipParameter_classCallCheck(this, ClipParameter);
  17039. /**
  17040. * @member {string} SuperMap.ClipParameter.prototype.clipDatasetName
  17041. * @description 用于裁剪的数据集名,clipDatasetName 与 clipRegion 必须设置一个。
  17042. */
  17043. this.clipDatasetName = null;
  17044. /**
  17045. * @member {string} SuperMap.ClipParameter.prototype.clipDatasourceName
  17046. * @description 用于裁剪的数据集所在数据源的名字。当 clipRegion 不设置时起作用。
  17047. */
  17048. this.clipDatasourceName = null;
  17049. /**
  17050. * @member {(SuperMap.Geometry.Polygon|L.Polygon|L.GeoJSON|ol.geom.Polygon|ol.format.GeoJSON)} SuperMap.ClipParameter.prototype.clipRegion
  17051. * @description 用户指定的裁剪区域,优先使用,clipDatasetName 与 clipRegion 必须设置一个。
  17052. */
  17053. this.clipRegion = null;
  17054. /**
  17055. * @member {boolean} [SuperMap.ClipParameter.prototype.isClipInRegion=true]
  17056. * @description 是否对裁剪区内的数据集进行裁剪。若为 true,则对裁剪区域内的结果进行裁剪,若为 false,则对裁剪区域外的结果进行裁剪。
  17057. */
  17058. this.isClipInRegion = true;
  17059. /**
  17060. * @member {boolean} [SuperMap.ClipParameter.prototype.isExactClip=true]
  17061. * @description 是否使用精确裁剪。
  17062. */
  17063. this.isExactClip = null;
  17064. if (options) {
  17065. Util.extend(this, options);
  17066. }
  17067. this.CLASS_NAME = "SuperMap.ClipParameter";
  17068. }
  17069. /**
  17070. * @function SuperMap.ClipParameter.prototype.destroy
  17071. * @description 释放资源,将引用资源的属性置空。
  17072. */
  17073. ClipParameter_createClass(ClipParameter, [{
  17074. key: "destroy",
  17075. value: function destroy() {
  17076. var me = this;
  17077. me.clipDatasetName = null;
  17078. me.clipDatasourceName = null;
  17079. me.clipRegion = null;
  17080. me.isClipInRegion = null;
  17081. me.isExactClip = null;
  17082. }
  17083. /**
  17084. * @function SuperMap.ClipParameter.prototype.toJSON
  17085. * @description 将 ClipParameter 对象转化为 JSON 字符串。
  17086. * @returns {string} 返回转换后的 JSON 字符串。
  17087. */
  17088. }, {
  17089. key: "toJSON",
  17090. value: function toJSON() {
  17091. return Util.toJSON({
  17092. isClipInRegion: this.isClipInRegion,
  17093. clipDatasetName: this.clipDatasetName,
  17094. clipDatasourceName: this.clipDatasourceName,
  17095. isExactClip: this.isExactClip,
  17096. clipRegion: ServerGeometry.fromGeometry(this.clipRegion)
  17097. });
  17098. }
  17099. }]);
  17100. return ClipParameter;
  17101. }();
  17102. SuperMap.ClipParameter = ClipParameter;
  17103. ;// CONCATENATED MODULE: ./src/common/iServer/ColorDictionary.js
  17104. function ColorDictionary_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17105. 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); } }
  17106. function ColorDictionary_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorDictionary_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorDictionary_defineProperties(Constructor, staticProps); return Constructor; }
  17107. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17108. * This program are made available under the terms of the Apache License, Version 2.0
  17109. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17110. /**
  17111. * @class SuperMap.ColorDictionary
  17112. * @category iServer Map Theme
  17113. * @classdesc 颜色对照表类。
  17114. * @description 颜色对照表中的键名为具体的高程值,键值表示该高程值要显示的颜色。对于栅格图层中高程值小于颜色对照表中高程最小值的点使用颜色对照表中高程最小值对应的颜色,对于栅格图层中高程值大于颜色对照表中高程最大值的点使用颜色对照表中高程最大值对应的颜色,对于栅格图层中高程值在颜色对照表中没有对应颜色的点,则查找颜色对照表中与当前高程值相邻的两个高程对应的颜色,然后通过渐变运算要显示的颜色。如果设置了颜色对照表的话,则颜色表设置无效。
  17115. * @param {Object} options - 参数。
  17116. * @param {number} options.elevation - 高程值。
  17117. * @param {SuperMap.ServerColor} options.color - 服务端颜色类。
  17118. */
  17119. var ColorDictionary = /*#__PURE__*/function () {
  17120. function ColorDictionary(options) {
  17121. ColorDictionary_classCallCheck(this, ColorDictionary);
  17122. options = options || {};
  17123. /**
  17124. * @member {number} SuperMap.ColorDictionary.prototype.elevation
  17125. * @description 高程值。
  17126. */
  17127. this.elevation = null;
  17128. /**
  17129. * @member {SuperMap.ServerColor} SuperMap.ColorDictionary.prototype.color
  17130. * @description 服务端颜色类。
  17131. */
  17132. this.color = null;
  17133. Util.extend(this, options);
  17134. var me = this,
  17135. c = me.color;
  17136. if (c) {
  17137. me.color = new ServerColor(c.red, c.green, c.blue);
  17138. }
  17139. this.CLASS_NAME = "SuperMap.ColorDictionary";
  17140. }
  17141. /**
  17142. * @function SuperMap.ColorDictionary.prototype.destroy
  17143. * @description 释放资源,将引用资源的属性置空。
  17144. */
  17145. ColorDictionary_createClass(ColorDictionary, [{
  17146. key: "destroy",
  17147. value: function destroy() {
  17148. Util.reset(this);
  17149. }
  17150. /**
  17151. * @function SuperMap.ColorDictionary.prototype.toServerJSONObject
  17152. * @description 转换成对应的 JSON 格式对象。
  17153. * @returns {Object} JSON 对象。
  17154. */
  17155. }, {
  17156. key: "toServerJSONObject",
  17157. value: function toServerJSONObject() {
  17158. var dataObj = {};
  17159. dataObj = Util.copyAttributes(dataObj, this);
  17160. return dataObj;
  17161. }
  17162. }]);
  17163. return ColorDictionary;
  17164. }();
  17165. SuperMap.ColorDictionary = ColorDictionary;
  17166. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystResultSetting.js
  17167. function TransportationAnalystResultSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17168. 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); } }
  17169. function TransportationAnalystResultSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystResultSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystResultSetting_defineProperties(Constructor, staticProps); return Constructor; }
  17170. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17171. * This program are made available under the terms of the Apache License, Version 2.0
  17172. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17173. /**
  17174. * @class SuperMap.TransportationAnalystResultSetting
  17175. * @category iServer NetworkAnalyst
  17176. * @classdesc 交通网络分析结果参数类。
  17177. * @description 通过该类设置交通网络分析返回的结果,包括是否返回图片、是否返回弧段空间信息、是否返回结点空间信息等。
  17178. * @param {Object} options - 参数。
  17179. * @param {boolean} [options.returnEdgeFeatures=false] - 是否在分析结果中包含弧段要素集合。
  17180. * @param {boolean} [options.returnEdgeGeometry=false] - 返回的弧段要素集合中是否包含几何对象信息。
  17181. * @param {boolean} [options.returnEdgeIDs=false] - 返回结果中是否包含经过弧段 ID 集合。
  17182. * @param {boolean} [options.returnNodeFeatures=false] - 是否在分析结果中包含结点要素集合。
  17183. * @param {boolean} [options.returnNodeGeometry=false] - 返回的结点要素集合中是否包含几何对象信息。
  17184. * @param {boolean} [options.returnNodeIDs=false] - 返回结果中是否包含经过结点 ID 集合。
  17185. * @param {boolean} [options.returnPathGuides=false] - 返回分析结果中是否包含行驶导引集合。
  17186. * @param {boolean} [options.returnRoutes=false] - 返回分析结果中是否包含路由对象的集合。
  17187. */
  17188. var TransportationAnalystResultSetting = /*#__PURE__*/function () {
  17189. function TransportationAnalystResultSetting(options) {
  17190. TransportationAnalystResultSetting_classCallCheck(this, TransportationAnalystResultSetting);
  17191. if (!options) {
  17192. return;
  17193. }
  17194. /**
  17195. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeFeatures
  17196. * @description 是否在分析结果中包含弧段要素集合。弧段要素包括弧段的空间信息和属性信息。
  17197. */
  17198. this.returnEdgeFeatures = false;
  17199. /**
  17200. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeGeometry=false]
  17201. * @description 返回的弧段要素集合中是否包含几何对象信息。
  17202. */
  17203. this.returnEdgeGeometry = false;
  17204. /**
  17205. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnEdgeIDs=false]
  17206. * @description 返回结果中是否包含经过弧段 ID 集合。
  17207. */
  17208. this.returnEdgeIDs = false;
  17209. /**
  17210. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeFeatures=false]
  17211. * @description 是否在分析结果中包含结点要素集合。
  17212. * 结点要素包括结点的空间信息和属性信息。其中返回的结点要素是否包含空间信息可通过 returnNodeGeometry 字段设置。
  17213. */
  17214. this.returnNodeFeatures = false;
  17215. /**
  17216. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeGeometry=false]
  17217. * @description 返回的结点要素集合中是否包含几何对象信息。
  17218. */
  17219. this.returnNodeGeometry = false;
  17220. /**
  17221. * @member {boolean} [SuperMap.TransportationAnalystResultSetting.prototype.returnNodeIDs=false]
  17222. * @description 返回结果中是否包含经过结点 ID 集合。
  17223. */
  17224. this.returnNodeIDs = false;
  17225. /**
  17226. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnPathGuides
  17227. * @description 返回分析结果中是否包含行驶导引集合。
  17228. */
  17229. this.returnPathGuides = false;
  17230. /**
  17231. * @member {boolean} SuperMap.TransportationAnalystResultSetting.prototype.returnRoutes
  17232. * @description 返回分析结果中是否包含路由对象的集合。
  17233. */
  17234. this.returnRoutes = false;
  17235. Util.extend(this, options);
  17236. this.CLASS_NAME = "SuperMap.TransportationAnalystResultSetting";
  17237. }
  17238. /**
  17239. * @function SuperMap.TransportationAnalystResultSetting.prototype.destroy
  17240. * @description 释放资源,将引用资源的属性置空。
  17241. */
  17242. TransportationAnalystResultSetting_createClass(TransportationAnalystResultSetting, [{
  17243. key: "destroy",
  17244. value: function destroy() {
  17245. var me = this;
  17246. me.returnEdgeFeatures = null;
  17247. me.returnEdgeGeometry = null;
  17248. me.returnEdgeIDs = null;
  17249. me.returnNodeFeatures = null;
  17250. me.returnNodeGeometry = null;
  17251. me.returnNodeIDs = null;
  17252. me.returnPathGuides = null;
  17253. me.returnRoutes = null;
  17254. }
  17255. }]);
  17256. return TransportationAnalystResultSetting;
  17257. }();
  17258. SuperMap.TransportationAnalystResultSetting = TransportationAnalystResultSetting;
  17259. ;// CONCATENATED MODULE: ./src/common/iServer/TransportationAnalystParameter.js
  17260. function TransportationAnalystParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17261. 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); } }
  17262. function TransportationAnalystParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransportationAnalystParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransportationAnalystParameter_defineProperties(Constructor, staticProps); return Constructor; }
  17263. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17264. * This program are made available under the terms of the Apache License, Version 2.0
  17265. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17266. /**
  17267. * @class SuperMap.TransportationAnalystParameter
  17268. * @category iServer NetworkAnalyst
  17269. * @classdesc 交通网络分析通用参数类。
  17270. * @description 该类主要用来提供交通网络分析所需的通用参数。
  17271. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息,还可以对分析结果包含的内容进行一些设置。
  17272. * @param {Object} options - 参数。
  17273. * @param {Array.<number>} options.barrierEdgeIDs - 网络分析中障碍弧段的 ID 数组。
  17274. * @param {Array.<number>} options.barrierNodeIDs - 网络分析中障碍点的 ID 数组。
  17275. * @param {string} options.turnWeightField - 转向权重字段的名称。
  17276. * @param {SuperMap.TransportationAnalystResultSetting} options.resultSetting - 分析结果返回内容。
  17277. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [options.barrierPoints] - 网络分析中 Point2D 类型的障碍点数组。
  17278. * @param {string} [options.weightFieldName] - 阻力字段的名称。
  17279. */
  17280. var TransportationAnalystParameter = /*#__PURE__*/function () {
  17281. function TransportationAnalystParameter(options) {
  17282. TransportationAnalystParameter_classCallCheck(this, TransportationAnalystParameter);
  17283. if (!options) {
  17284. return;
  17285. }
  17286. /**
  17287. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierEdgeIDs
  17288. * @description 网络分析中障碍弧段的 ID 数组。弧段设置为障碍边之后,表示双向都不通。
  17289. */
  17290. this.barrierEdgeIDs = null;
  17291. /**
  17292. * @member {Array.<number>} SuperMap.TransportationAnalystParameter.prototype.barrierNodeIDs
  17293. * @description 网络分析中障碍点的 ID 数组。结点设置为障碍点之后,表示任何方向都不能通过此结点。
  17294. */
  17295. this.barrierNodeIDs = null;
  17296. /**
  17297. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransportationAnalystParameter.prototype.barrierPoints
  17298. * @description 网络分析中 Point2D 类型的障碍点数组。障碍点表示任何方向都不能通过此点。</br>
  17299. * 当各网络分析参数类中的 isAnalyzeById 属性设置为 false 时,该属性才生效。
  17300. */
  17301. this.barrierPoints = null;
  17302. /**
  17303. * @member {string} [SuperMap.TransportationAnalystParameter.prototype.weightFieldName]
  17304. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段,例如表示时间、长度等的字段都可以用作阻力字段。
  17305. * 该字段默值为服务器发布的所有耗费字段的第一个字段。
  17306. */
  17307. this.weightFieldName = null;
  17308. /**
  17309. * @member {string} SuperMap.TransportationAnalystParameter.prototype.turnWeightField
  17310. * @description 转向权重字段的名称。
  17311. */
  17312. this.turnWeightField = null;
  17313. /**
  17314. * @member {SuperMap.TransportationAnalystResultSetting} SuperMap.TransportationAnalystParameter.prototype.resultSetting
  17315. * @description 分析结果返回内容。
  17316. */
  17317. this.resultSetting = new TransportationAnalystResultSetting();
  17318. Util.extend(this, options);
  17319. this.CLASS_NAME = "SuperMap.TransportationAnalystParameter";
  17320. }
  17321. /**
  17322. * @function SuperMap.TransportationAnalystParameter.prototype.destroy
  17323. * @description 释放资源,将引用资源的属性置空。
  17324. */
  17325. TransportationAnalystParameter_createClass(TransportationAnalystParameter, [{
  17326. key: "destroy",
  17327. value: function destroy() {
  17328. var me = this;
  17329. me.barrierEdgeIDs = null;
  17330. me.barrierNodeIDs = null;
  17331. me.weightFieldName = null;
  17332. me.turnWeightField = null;
  17333. if (me.resultSetting) {
  17334. me.resultSetting.destroy();
  17335. me.resultSetting = null;
  17336. }
  17337. if (me.barrierPoints && me.barrierPoints.length) {
  17338. for (var i in me.barrierPoints) {
  17339. me.barrierPoints[i].destroy();
  17340. }
  17341. }
  17342. me.barrierPoints = null;
  17343. }
  17344. }]);
  17345. return TransportationAnalystParameter;
  17346. }();
  17347. SuperMap.TransportationAnalystParameter = TransportationAnalystParameter;
  17348. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixParameters.js
  17349. function ComputeWeightMatrixParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17350. 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); } }
  17351. function ComputeWeightMatrixParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17352. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17353. * This program are made available under the terms of the Apache License, Version 2.0
  17354. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17355. /**
  17356. * @class SuperMap.ComputeWeightMatrixParameters
  17357. * @category iServer NetworkAnalyst WeightMatrix
  17358. * @classdesc 耗费矩阵分析参数类。根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  17359. * @param {Object} options - 参数。
  17360. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  17361. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 要计算耗费矩阵的点数组。
  17362. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  17363. */
  17364. var ComputeWeightMatrixParameters = /*#__PURE__*/function () {
  17365. function ComputeWeightMatrixParameters(options) {
  17366. ComputeWeightMatrixParameters_classCallCheck(this, ComputeWeightMatrixParameters);
  17367. /**
  17368. * @member {boolean} [SuperMap.ComputeWeightMatrixParameters.prototype.isAnalyzeById=false]
  17369. * @description 是否通过节点 ID 指定路径分析的结点,即通过坐标点指定。
  17370. */
  17371. this.isAnalyzeById = false;
  17372. /**
  17373. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.ComputeWeightMatrixParameters.prototype.nodes
  17374. * @description 要计算耗费矩阵的点数组。
  17375. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = false 时,nodes 应为点的坐标数组;
  17376. * 当 {@link SuperMap.ComputeWeightMatrixParameters.isAnalyzeById} = true 时,nodes 应为点的 ID 数组。
  17377. */
  17378. this.nodes = null;
  17379. /**
  17380. * @member {SuperMap.TransportationAnalystParameter} SuperMap.ComputeWeightMatrixParameters.prototype.parameter
  17381. * @description 交通网络分析通用参数。
  17382. */
  17383. this.parameter = new TransportationAnalystParameter();
  17384. Util.extend(this, options);
  17385. this.CLASS_NAME = "SuperMap.ComputeWeightMatrixParameters";
  17386. }
  17387. /**
  17388. * @function SuperMap.ComputeWeightMatrixParameters.prototype.destroy
  17389. * @description 释放资源,将引用资源的属性置空。
  17390. */
  17391. ComputeWeightMatrixParameters_createClass(ComputeWeightMatrixParameters, [{
  17392. key: "destroy",
  17393. value: function destroy() {
  17394. var me = this;
  17395. me.isAnalyzeById = null;
  17396. me.nodes = null;
  17397. if (me.parameter) {
  17398. me.parameter.destroy();
  17399. me.parameter = null;
  17400. }
  17401. }
  17402. }]);
  17403. return ComputeWeightMatrixParameters;
  17404. }();
  17405. SuperMap.ComputeWeightMatrixParameters = ComputeWeightMatrixParameters;
  17406. ;// CONCATENATED MODULE: ./src/common/iServer/ComputeWeightMatrixService.js
  17407. function ComputeWeightMatrixService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ComputeWeightMatrixService_typeof = function _typeof(obj) { return typeof obj; }; } else { ComputeWeightMatrixService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ComputeWeightMatrixService_typeof(obj); }
  17408. function ComputeWeightMatrixService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17409. 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); } }
  17410. function ComputeWeightMatrixService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeWeightMatrixService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeWeightMatrixService_defineProperties(Constructor, staticProps); return Constructor; }
  17411. function ComputeWeightMatrixService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ComputeWeightMatrixService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ComputeWeightMatrixService_get(target, property, receiver || target); }
  17412. function ComputeWeightMatrixService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ComputeWeightMatrixService_getPrototypeOf(object); if (object === null) break; } return object; }
  17413. 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 } }); if (superClass) ComputeWeightMatrixService_setPrototypeOf(subClass, superClass); }
  17414. function ComputeWeightMatrixService_setPrototypeOf(o, p) { ComputeWeightMatrixService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ComputeWeightMatrixService_setPrototypeOf(o, p); }
  17415. 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); }; }
  17416. function ComputeWeightMatrixService_possibleConstructorReturn(self, call) { if (call && (ComputeWeightMatrixService_typeof(call) === "object" || typeof call === "function")) { return call; } return ComputeWeightMatrixService_assertThisInitialized(self); }
  17417. function ComputeWeightMatrixService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17418. function ComputeWeightMatrixService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  17419. function ComputeWeightMatrixService_getPrototypeOf(o) { ComputeWeightMatrixService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ComputeWeightMatrixService_getPrototypeOf(o); }
  17420. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17421. * This program are made available under the terms of the Apache License, Version 2.0
  17422. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17423. /**
  17424. * @class SuperMap.ComputeWeightMatrixService
  17425. * @category iServer NetworkAnalyst WeightMatrix
  17426. * @classdesc 耗费矩阵分析服务类。
  17427. * 耗费矩阵是根据交通网络分析参数中的耗费字段来计算一个二维数组,
  17428. * 用来存储指定的任意两点间的资源消耗。
  17429. * 耗费矩阵分析结果通过该类支持的事件的监听函数参数获取
  17430. * @extends {SuperMap.NetworkAnalystServiceBase}
  17431. * @example
  17432. * var mycomputeWeightMatrixService = new SuperMap.ComputeWeightMatrixService(url,{
  17433. * eventListeners: {
  17434. * "processCompleted": computeWeightMatrixCompleted,
  17435. * "processFailed": computeWeightMatrixnError
  17436. * }
  17437. * });
  17438. * @param {string} url - 耗费矩阵分析服务地址。请求服务的URL应为:
  17439. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  17440. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  17441. * @param {Object} options - 参数。
  17442. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  17443. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17444. * @param {Object} [options.headers] - 请求头。
  17445. */
  17446. var ComputeWeightMatrixService = /*#__PURE__*/function (_NetworkAnalystServic) {
  17447. ComputeWeightMatrixService_inherits(ComputeWeightMatrixService, _NetworkAnalystServic);
  17448. var _super = ComputeWeightMatrixService_createSuper(ComputeWeightMatrixService);
  17449. function ComputeWeightMatrixService(url, options) {
  17450. var _this;
  17451. ComputeWeightMatrixService_classCallCheck(this, ComputeWeightMatrixService);
  17452. _this = _super.call(this, url, options);
  17453. _this.CLASS_NAME = "SuperMap.ComputeWeightMatrixService";
  17454. return _this;
  17455. }
  17456. /**
  17457. * @function SuperMap.ComputeWeightMatrixService.prototype.destroy
  17458. * @override
  17459. */
  17460. ComputeWeightMatrixService_createClass(ComputeWeightMatrixService, [{
  17461. key: "destroy",
  17462. value: function destroy() {
  17463. ComputeWeightMatrixService_get(ComputeWeightMatrixService_getPrototypeOf(ComputeWeightMatrixService.prototype), "destroy", this).call(this);
  17464. }
  17465. /**
  17466. * @function SuperMap.ComputeWeightMatrixService.prototype.processAsync
  17467. * @description 负责将客户端的查询参数传递到服务端。
  17468. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析参数类
  17469. */
  17470. }, {
  17471. key: "processAsync",
  17472. value: function processAsync(params) {
  17473. if (!(params instanceof ComputeWeightMatrixParameters)) {
  17474. return;
  17475. }
  17476. var me = this,
  17477. jsonObject;
  17478. me.url = Util.urlPathAppend(me.url, 'weightmatrix');
  17479. jsonObject = {
  17480. parameter: Util.toJSON(params.parameter),
  17481. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  17482. };
  17483. me.request({
  17484. method: "GET",
  17485. params: jsonObject,
  17486. scope: me,
  17487. success: me.serviceProcessCompleted,
  17488. failure: me.serviceProcessFailed
  17489. });
  17490. }
  17491. /**
  17492. * @function SuperMap.ComputeWeightMatrixService.prototype.getJson
  17493. * @description 将对象转化为JSON字符串。
  17494. * @param {boolean} isAnalyzeById - 是否通过id分析
  17495. * @param {Array.<SuperMap.ComputeWeightMatrixParameters>} params - 分析参数数组
  17496. * @returns {string} 转化后的JSON字符串。
  17497. */
  17498. }, {
  17499. key: "getJson",
  17500. value: function getJson(isAnalyzeById, params) {
  17501. var jsonString = "[",
  17502. len = params ? params.length : 0;
  17503. if (isAnalyzeById === false) {
  17504. for (var i = 0; i < len; i++) {
  17505. if (i > 0) {
  17506. jsonString += ",";
  17507. }
  17508. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  17509. }
  17510. } else if (isAnalyzeById === true) {
  17511. for (var _i = 0; _i < len; _i++) {
  17512. if (_i > 0) {
  17513. jsonString += ",";
  17514. }
  17515. jsonString += params[_i];
  17516. }
  17517. }
  17518. jsonString += ']';
  17519. return jsonString;
  17520. }
  17521. }]);
  17522. return ComputeWeightMatrixService;
  17523. }(NetworkAnalystServiceBase);
  17524. SuperMap.ComputeWeightMatrixService = ComputeWeightMatrixService;
  17525. ;// CONCATENATED MODULE: ./src/common/iServer/DataFlowService.js
  17526. function DataFlowService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DataFlowService_typeof = function _typeof(obj) { return typeof obj; }; } else { DataFlowService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DataFlowService_typeof(obj); }
  17527. function DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17528. 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); } }
  17529. function DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  17530. 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 } }); if (superClass) DataFlowService_setPrototypeOf(subClass, superClass); }
  17531. function DataFlowService_setPrototypeOf(o, p) { DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DataFlowService_setPrototypeOf(o, p); }
  17532. 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); }; }
  17533. function DataFlowService_possibleConstructorReturn(self, call) { if (call && (DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return DataFlowService_assertThisInitialized(self); }
  17534. function DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17535. function DataFlowService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  17536. function DataFlowService_getPrototypeOf(o) { DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DataFlowService_getPrototypeOf(o); }
  17537. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17538. * This program are made available under the terms of the Apache License, Version 2.0
  17539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17540. /**
  17541. * @class SuperMap.DataFlowService
  17542. * @category iServer DataFlow
  17543. * @classdesc 数据流服务类
  17544. * @extends {SuperMap.CommonServiceBase}
  17545. * @param {string} url - 数据流服务地址
  17546. * @param {Object} options - 参数。
  17547. * @param {function} options.style - 设置数据加载样式。
  17548. * @param {function} [options.onEachFeature] - 设置每个数据加载popup等。
  17549. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  17550. * @param {Object} [options.excludeField] - -排除字段。
  17551. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  17552. * @param {Object} [options.headers] - 请求头。
  17553. */
  17554. var DataFlowService_DataFlowService = /*#__PURE__*/function (_CommonServiceBase) {
  17555. DataFlowService_inherits(DataFlowService, _CommonServiceBase);
  17556. var _super = DataFlowService_createSuper(DataFlowService);
  17557. function DataFlowService(url, options) {
  17558. var _this;
  17559. DataFlowService_classCallCheck(this, DataFlowService);
  17560. options = options || {};
  17561. /*
  17562. * @constant EVENT_TYPES
  17563. * {Array.<string>}
  17564. * 此类支持的事件类型
  17565. */
  17566. options.EVENT_TYPES = ["broadcastSocketConnected", "broadcastSocketError", "broadcastFailed", "broadcastSucceeded", "subscribeSocketConnected", "subscribeSocketError", "messageSucceeded", "setFilterParamSucceeded"];
  17567. _this = _super.call(this, url, options);
  17568. /**
  17569. * @member {GeoJSONObject} SuperMap.DataFlowService.prototype.geometry
  17570. * @description 指定几何范围,该范围内的要素才能被订阅。
  17571. */
  17572. _this.geometry = null;
  17573. /**
  17574. * @member {Object} SuperMap.DataFlowService.prototype.prjCoordSys
  17575. * @description 动态投影参数
  17576. */
  17577. _this.prjCoordSys = null;
  17578. /**
  17579. * @member {Object} SuperMap.DataFlowService.prototype.excludeField
  17580. * @description 排除字段
  17581. */
  17582. _this.excludeField = null;
  17583. Util.extend(DataFlowService_assertThisInitialized(_this), options);
  17584. _this.CLASS_NAME = "SuperMap.DataFlowService";
  17585. return _this;
  17586. }
  17587. /**
  17588. * @function SuperMap.DataFlowService.prototype.initBroadcast
  17589. * @description 初始化广播
  17590. * @returns {SuperMap.DataFlowService}
  17591. */
  17592. DataFlowService_createClass(DataFlowService, [{
  17593. key: "initBroadcast",
  17594. value: function initBroadcast() {
  17595. var me = this;
  17596. this.broadcastWebSocket = this._connect(Util.urlPathAppend(me.url, 'broadcast'));
  17597. this.broadcastWebSocket.onopen = function (e) {
  17598. me.broadcastWebSocket.isOpen = true;
  17599. e.eventType = 'broadcastSocketConnected';
  17600. me.events.triggerEvent('broadcastSocketConnected', e);
  17601. };
  17602. this.broadcastWebSocket.onclose = function (e) {
  17603. me.broadcastWebSocket.isOpen = false;
  17604. e.eventType = 'broadcastSocketConnected';
  17605. me.events.triggerEvent('broadcastSocketConnected', e);
  17606. };
  17607. this.broadcastWebSocket.onerror = function (e) {
  17608. e.eventType = 'broadcastSocketError';
  17609. me.events.triggerEvent('broadcastSocketError', e);
  17610. };
  17611. return this;
  17612. }
  17613. /**
  17614. * @function SuperMap.DataFlowService.prototype.broadcast
  17615. * @description 加载广播数据。
  17616. * @param {GeoJSONObject} geoJSONFeature - JSON 格式的要素数据。
  17617. */
  17618. }, {
  17619. key: "broadcast",
  17620. value: function broadcast(geoJSONFeature) {
  17621. if (!this.broadcastWebSocket || !this.broadcastWebSocket.isOpen) {
  17622. this.events.triggerEvent('broadcastFailed');
  17623. return;
  17624. }
  17625. this.broadcastWebSocket.send(JSON.stringify(geoJSONFeature));
  17626. this.events.triggerEvent('broadcastSucceeded');
  17627. }
  17628. /**
  17629. * @function SuperMap.DataFlowService.prototype.initSubscribe
  17630. * @description 初始化订阅数据
  17631. * @returns {this} this
  17632. */
  17633. }, {
  17634. key: "initSubscribe",
  17635. value: function initSubscribe() {
  17636. var me = this;
  17637. this.subscribeWebSocket = this._connect(Util.urlPathAppend(me.url, 'subscribe'));
  17638. this.subscribeWebSocket.onopen = function (e) {
  17639. me.subscribeWebSocket.send(me._getFilterParams());
  17640. e.eventType = 'subscribeSocketConnected';
  17641. me.events.triggerEvent('subscribeSocketConnected', e);
  17642. };
  17643. this.subscribeWebSocket.onerror = function (e) {
  17644. e.eventType = 'subscribeSocketError';
  17645. me.events.triggerEvent('subscribeSocketError', e);
  17646. };
  17647. this.subscribeWebSocket.onmessage = function (e) {
  17648. me._onMessage(e);
  17649. };
  17650. return this;
  17651. }
  17652. /**
  17653. * @function SuperMap.DataFlowService.prototype.setExcludeField
  17654. * @description 设置排除字段
  17655. * @param {Object} excludeField - 排除字段
  17656. * @returns {this} this
  17657. */
  17658. }, {
  17659. key: "setExcludeField",
  17660. value: function setExcludeField(excludeField) {
  17661. this.excludeField = excludeField;
  17662. this.subscribeWebSocket.send(this._getFilterParams());
  17663. return this;
  17664. }
  17665. /**
  17666. * @function SuperMap.DataFlowService.prototype.setGeometry
  17667. * @description 设置添加的几何要素数据
  17668. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  17669. * @returns {this} this
  17670. */
  17671. }, {
  17672. key: "setGeometry",
  17673. value: function setGeometry(geometry) {
  17674. this.geometry = geometry;
  17675. this.subscribeWebSocket.send(this._getFilterParams());
  17676. return this;
  17677. }
  17678. /**
  17679. * @function SuperMap.DataFlowService.prototype.unSubscribe
  17680. * @description 结束订阅数据
  17681. */
  17682. }, {
  17683. key: "unSubscribe",
  17684. value: function unSubscribe() {
  17685. if (!this.subscribeWebSocket) {
  17686. return;
  17687. }
  17688. this.subscribeWebSocket.close();
  17689. this.subscribeWebSocket = null;
  17690. }
  17691. /**
  17692. * @function SuperMap.DataFlowService.prototype.unBroadcast
  17693. * @description 结束加载广播
  17694. */
  17695. }, {
  17696. key: "unBroadcast",
  17697. value: function unBroadcast() {
  17698. if (!this.broadcastWebSocket) {
  17699. return;
  17700. }
  17701. this.broadcastWebSocket.close();
  17702. this.broadcastWebSocket = null;
  17703. }
  17704. /**
  17705. * @function SuperMap.DataFlowService.prototype.destroy
  17706. * @override
  17707. */
  17708. }, {
  17709. key: "destroy",
  17710. value: function destroy() {
  17711. CommonServiceBase.prototype.destroy.apply(this, arguments);
  17712. var me = this;
  17713. me.geometry = null;
  17714. me.prjCoordSys = null;
  17715. me.excludeField = null;
  17716. this.unBroadcast();
  17717. this.unSubscribe();
  17718. }
  17719. }, {
  17720. key: "_getFilterParams",
  17721. value: function _getFilterParams() {
  17722. var filter = {
  17723. filterParam: {
  17724. prjCoordSys: this.prjCoordSys,
  17725. excludeField: this.excludeField,
  17726. geometry: this.geometry
  17727. }
  17728. };
  17729. return Util.toJSON(filter);
  17730. }
  17731. }, {
  17732. key: "_onMessage",
  17733. value: function _onMessage(e) {
  17734. if (e.data && e.data.indexOf("filterParam") >= 0) {
  17735. var filterParam = JSON.parse(e.data);
  17736. e.filterParam = filterParam;
  17737. e.eventType = 'setFilterParamSucceeded';
  17738. this.events.triggerEvent('setFilterParamSucceeded', e);
  17739. return;
  17740. }
  17741. var feature = JSON.parse(e.data);
  17742. e.featureResult = feature;
  17743. e.eventType = 'messageSucceeded';
  17744. this.events.triggerEvent('messageSucceeded', e);
  17745. }
  17746. }, {
  17747. key: "_connect",
  17748. value: function _connect(url) {
  17749. url = this._appendCredentials(url);
  17750. if ("WebSocket" in window) {
  17751. return new WebSocket(url);
  17752. } else if ("MozWebSocket" in window) {
  17753. var mozWebSocket = window.MozWebSocket;
  17754. return new mozWebSocket(url);
  17755. } else {
  17756. console.log("no WebSocket");
  17757. return null;
  17758. }
  17759. }
  17760. }, {
  17761. key: "_appendCredentials",
  17762. value: function _appendCredentials(url) {
  17763. var token = SecurityManager.getToken(url);
  17764. if (token) {
  17765. url = Util.urlAppend(url, "token=" + token);
  17766. }
  17767. return url;
  17768. }
  17769. }]);
  17770. return DataFlowService;
  17771. }(CommonServiceBase);
  17772. SuperMap.DataFlowService = DataFlowService_DataFlowService;
  17773. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetInfo.js
  17774. function DatasetInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17775. 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); } }
  17776. function DatasetInfo_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetInfo_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetInfo_defineProperties(Constructor, staticProps); return Constructor; }
  17777. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17778. * This program are made available under the terms of the Apache License, Version 2.0
  17779. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17780. /**
  17781. * @class SuperMap.DatasetInfo
  17782. * @category iServer Data
  17783. * @classdesc 数据集信息类。
  17784. * @description 数据集一般为存储在一起的相关数据的集合;根据数据类型的不同,分为矢量数据集、栅格数据集(griddataset)和
  17785. * 影像数据集(image dataset),以及为了处理特定问题而设计的数据集,如拓扑数据集,网络数据集等。
  17786. * 数据集是 GIS 数据组织的最小单位。其中矢量数据集是由同种类型空间要素组成的集合,
  17787. * 所以也可以称为要素集。根据要素的空间特征的不同,矢量数据集又分为点数据集,
  17788. * 线数据集,面数据集等,各矢量数据集是空间特征和性质相同的数据组织起来的集合。
  17789. * 目前版本支持的数据集主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、
  17790. * 网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  17791. * @param {Object} options - 参数。
  17792. * @param {SuperMap.Bounds} [options.bounds] - 数据集范围,该字段只读。
  17793. * @param {string} [options.dataSourceName] - 数据源名称,该字段只读。
  17794. * @param {string} [options.description] - 数据集的描述信息。
  17795. * @param {string} [options.encodeType] - 数据集存储时的压缩编码方式,该字段只读。
  17796. * @param {boolean} [options.isReadOnly] - 数据集是否为只读。
  17797. * @param {string} options.name - 数据集名称,该字段必须且只读。
  17798. * @param {SuperMap.Projection} [options.prjCoordSys] - 数据集的投影信息。
  17799. * @param {string} [options.tableName] - 表名,该字段只读。
  17800. * @param {string} options.type - 数据集类型。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  17801. */
  17802. var DatasetInfo = /*#__PURE__*/function () {
  17803. function DatasetInfo(options) {
  17804. DatasetInfo_classCallCheck(this, DatasetInfo);
  17805. options = options || {};
  17806. /**
  17807. * @member {SuperMap.Bounds} [SuperMap.DatasetInfo.prototype.bounds]
  17808. * @description 数据集范围,该字段只读。
  17809. */
  17810. this.bounds = null;
  17811. /**
  17812. * @member {string} [SuperMap.DatasetInfo.prototype.dataSourceName]
  17813. * @description 数据源名称,该字段只读。
  17814. */
  17815. this.dataSourceName = null;
  17816. /**
  17817. * @member {string} [SuperMap.DatasetInfo.prototype.description]
  17818. * @description 数据集的描述信息。
  17819. */
  17820. this.description = null;
  17821. /**
  17822. * @member {string} [SuperMap.DatasetInfo.prototype.encodeType]
  17823. * @description 数据集存储时的压缩编码方式,该字段只读。
  17824. */
  17825. this.encodeType = null;
  17826. /**
  17827. * @member {boolean} [SuperMap.DatasetInfo.prototype.isReadOnly]
  17828. * @description 数据集是否为只读。
  17829. */
  17830. this.isReadOnly = null;
  17831. /**
  17832. * @member {string} SuperMap.DatasetInfo.prototype.name
  17833. * @description 数据集名称,该字段必须且只读。
  17834. */
  17835. this.name = null;
  17836. /**
  17837. * @member {SuperMap.Projection} [SuperMap.DatasetInfo.prototype.prjCoordSys]
  17838. * @description 数据集的投影信息。
  17839. */
  17840. this.prjCoordSys = null;
  17841. /**
  17842. * @member {string} [SuperMap.DatasetInfo.prototype.tableName]
  17843. * @description 表名,该字段只读。
  17844. */
  17845. this.tableName = null;
  17846. /**
  17847. * @member {string} SuperMap.DatasetInfo.prototype.type
  17848. * @description 数据集类型,该字段必设。主要有点数据集,线数据集,面数据集,文本数据集,复合数据集(CAD 数据集)、网络数据集,栅格数据集(grid dataset)和影像数据集(image dataset)。
  17849. */
  17850. this.type = null;
  17851. Util.extend(this, options);
  17852. var b = this.bounds;
  17853. if (b) {
  17854. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  17855. }
  17856. this.CLASS_NAME = "SuperMap.DatasetInfo";
  17857. }
  17858. /**
  17859. * @function SuperMap.DatasetInfo.prototype.destroy
  17860. * @description 释放资源,将引用资源的属性置空。
  17861. */
  17862. DatasetInfo_createClass(DatasetInfo, [{
  17863. key: "destroy",
  17864. value: function destroy() {
  17865. Util.reset(this);
  17866. }
  17867. /**
  17868. * @function SuperMap.DatasetInfo.prototype.toServerJSONObject
  17869. * @description 转换成对应的 JSON 格式对象。
  17870. * @returns {Object} JSON 对象。
  17871. */
  17872. }, {
  17873. key: "toServerJSONObject",
  17874. value: function toServerJSONObject() {
  17875. var dataObj = {};
  17876. dataObj = Util.copyAttributes(dataObj, this);
  17877. if (dataObj.bounds) {
  17878. if (dataObj.bounds.toServerJSONObject) {
  17879. dataObj.bounds = dataObj.bounds.toServerJSONObject();
  17880. }
  17881. }
  17882. return dataObj;
  17883. }
  17884. }]);
  17885. return DatasetInfo;
  17886. }();
  17887. SuperMap.DatasetInfo = DatasetInfo;
  17888. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystParameters.js
  17889. function OverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17890. 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); } }
  17891. function OverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17892. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17893. * This program are made available under the terms of the Apache License, Version 2.0
  17894. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17895. /**
  17896. * @class SuperMap.OverlayAnalystParameters
  17897. * @category iServer SpatialAnalyst OverlayAnalyst
  17898. * @classdesc 叠加分析参数基类。数据集叠加分析参数和几何对象叠加分析参数均继承此基类。
  17899. * @param {Object} options - 参数。
  17900. */
  17901. var OverlayAnalystParameters = /*#__PURE__*/function () {
  17902. function OverlayAnalystParameters(options) {
  17903. OverlayAnalystParameters_classCallCheck(this, OverlayAnalystParameters);
  17904. /**
  17905. * @member {SuperMap.OverlayOperationType} [SuperMap.OverlayAnalystParameters.prototype.operation=SuperMap.OverlayOperationType.UNION]
  17906. * @description 指定叠加分析操作类型。
  17907. */
  17908. this.operation = OverlayOperationType.UNION;
  17909. if (options) {
  17910. Util.extend(this, options);
  17911. }
  17912. this.CLASS_NAME = "SuperMap.OverlayAnalystParameters";
  17913. }
  17914. /**
  17915. * @function SuperMap.OverlayAnalystParameters.prototype.destroy
  17916. * @description 释放资源,将引用资源的属性置空。
  17917. */
  17918. OverlayAnalystParameters_createClass(OverlayAnalystParameters, [{
  17919. key: "destroy",
  17920. value: function destroy() {
  17921. var me = this;
  17922. me.operation = null;
  17923. }
  17924. }]);
  17925. return OverlayAnalystParameters;
  17926. }();
  17927. SuperMap.OverlayAnalystParameters = OverlayAnalystParameters;
  17928. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetOverlayAnalystParameters.js
  17929. function DatasetOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetOverlayAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetOverlayAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetOverlayAnalystParameters_typeof(obj); }
  17930. function DatasetOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  17931. 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); } }
  17932. function DatasetOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  17933. function DatasetOverlayAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetOverlayAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return DatasetOverlayAnalystParameters_get(target, property, receiver || target); }
  17934. function DatasetOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  17935. 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 } }); if (superClass) DatasetOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  17936. function DatasetOverlayAnalystParameters_setPrototypeOf(o, p) { DatasetOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetOverlayAnalystParameters_setPrototypeOf(o, p); }
  17937. 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); }; }
  17938. function DatasetOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetOverlayAnalystParameters_assertThisInitialized(self); }
  17939. function DatasetOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  17940. function DatasetOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  17941. function DatasetOverlayAnalystParameters_getPrototypeOf(o) { DatasetOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetOverlayAnalystParameters_getPrototypeOf(o); }
  17942. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  17943. * This program are made available under the terms of the Apache License, Version 2.0
  17944. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  17945. /**
  17946. * @class SuperMap.DatasetOverlayAnalystParameters
  17947. * @category iServer SpatialAnalyst OverlayAnalyst
  17948. * @classdesc 数据集叠加分析参数类。
  17949. * @param {Object} options - 参数。
  17950. * @param {string} options.operateDataset - 叠加分析中操作数据集的名称。
  17951. * @param {string} options.sourceDataset - 叠加分析中源数据集的名称。
  17952. * @param {Array.<string>} [options.operateDatasetFields] - 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  17953. * @param {SuperMap.FilterParameter} [options.operateDatasetFilter] - 设置操作数据集中空间对象过滤条件。
  17954. * @param {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [options.operateRegions] - 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  17955. * @param {Array.<string>} [options.sourceDatasetFields] - 叠加分析中源数据集保留在结果数据集中的字段名列表。
  17956. * @param {SuperMap.FilterParameter} [options.sourceDatasetFilter] - 设置源数据集中空间对象过滤条件。
  17957. * @param {number} [options.tolerance=0] - 容限。
  17958. * @param {SuperMap.OverlayOperationType} options.operation - 叠加操作枚举值。
  17959. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  17960. * @extends {SuperMap.GetFeaturesParametersBase}
  17961. */
  17962. var DatasetOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  17963. DatasetOverlayAnalystParameters_inherits(DatasetOverlayAnalystParameters, _OverlayAnalystParame);
  17964. var _super = DatasetOverlayAnalystParameters_createSuper(DatasetOverlayAnalystParameters);
  17965. function DatasetOverlayAnalystParameters(options) {
  17966. var _this;
  17967. DatasetOverlayAnalystParameters_classCallCheck(this, DatasetOverlayAnalystParameters);
  17968. _this = _super.call(this, options);
  17969. /**
  17970. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDataset
  17971. * @description 叠加分析中操作数据集的名称。
  17972. */
  17973. _this.operateDataset = null;
  17974. /**
  17975. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFields]
  17976. * @description 叠加分析中操作数据集保留在结果数据集中的字段名列表。
  17977. */
  17978. _this.operateDatasetFields = [];
  17979. /**
  17980. * @member {SuperMap.FilterParameter} SuperMap.DatasetOverlayAnalystParameters.prototype.operateDatasetFilter
  17981. * @description 设置操作数据集中空间对象过滤条件。
  17982. */
  17983. _this.operateDatasetFilter = new FilterParameter();
  17984. /**
  17985. * @member {Array.<SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon>} [SuperMap.DatasetOverlayAnalystParameters.prototype.operateRegions]
  17986. * @description 操作面对象集合,表示与这些面对象进行叠加分析。与 operateDataset 参数互斥,冲突时以 operateDataset 为准。
  17987. */
  17988. _this.operateRegions = [];
  17989. /**
  17990. * @member {string} SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDataset
  17991. * @description 叠加分析中源数据集的名称。
  17992. */
  17993. _this.sourceDataset = null;
  17994. /**
  17995. * @member {Array.<string>} [SuperMap.DatasetOverlayAnalystParameters.prototype.sourceDatasetFields]
  17996. * @description 叠加分析中源数据集保留在结果数据集中的字段名列表。
  17997. */
  17998. _this.sourceDatasetFields = [];
  17999. /**
  18000. * @member {SuperMap.FilterParameter} [SuperMap.DatasetOverlayAnalystParameters.prototype.filterQueryParameter]
  18001. * @description 设置源数据集中空间对象过滤条件。
  18002. */
  18003. _this.sourceDatasetFilter = new FilterParameter();
  18004. /**
  18005. * @member {number} [SuperMap.DatasetOverlayAnalystParameters.prototype.tolerance=0]
  18006. * @description 容限。
  18007. */
  18008. _this.tolerance = 0;
  18009. /**
  18010. * @member {SuperMap.DataReturnOption} [SuperMap.DatasetOverlayAnalystParameters.prototype.resultSetting]
  18011. * @description 结果返回设置类。
  18012. */
  18013. _this.resultSetting = new DataReturnOption();
  18014. Util.extend(DatasetOverlayAnalystParameters_assertThisInitialized(_this), options);
  18015. _this.CLASS_NAME = "SuperMap.DatasetOverlayAnalystParameters";
  18016. return _this;
  18017. }
  18018. /**
  18019. * @function SuperMap.DatasetOverlayAnalystParameters.prototype.destroy
  18020. * @override
  18021. */
  18022. DatasetOverlayAnalystParameters_createClass(DatasetOverlayAnalystParameters, [{
  18023. key: "destroy",
  18024. value: function destroy() {
  18025. DatasetOverlayAnalystParameters_get(DatasetOverlayAnalystParameters_getPrototypeOf(DatasetOverlayAnalystParameters.prototype), "destroy", this).call(this);
  18026. var me = this;
  18027. me.operateDataset = null;
  18028. me.operateDatasetFields = null;
  18029. if (me.operateDatasetFilter) {
  18030. me.operateDatasetFilter.destroy();
  18031. me.operateDatasetFilter = null;
  18032. }
  18033. if (me.operateRegions) {
  18034. for (var i = 0, opRegions = me.operateRegions, len = opRegions.length; i < len; i++) {
  18035. opRegions[i].destroy();
  18036. }
  18037. me.operateRegions = null;
  18038. }
  18039. me.sourceDataset = null;
  18040. me.sourceDatasetFields = null;
  18041. if (me.sourceDatasetFilter) {
  18042. me.sourceDatasetFilter.destroy();
  18043. me.sourceDatasetFilter = null;
  18044. }
  18045. me.tolerance = null;
  18046. if (me.resultSetting) {
  18047. me.resultSetting.destroy();
  18048. me.resultSetting = null;
  18049. }
  18050. }
  18051. /**
  18052. * @function SuperMap.DatasetOverlayAnalystParameters.toObject
  18053. * @param {SuperMap.DatasetOverlayAnalystParameters} datasetOverlayAnalystParameters - 数据集叠加分析参数类。
  18054. * @param {SuperMap.DatasetOverlayAnalystParameters} tempObj - 数据集叠加分析参数对象。
  18055. * @description 将数据集叠加分析参数类转换为 JSON 对象。
  18056. * @returns {Object} JSON 对象。
  18057. */
  18058. }], [{
  18059. key: "toObject",
  18060. value: function toObject(datasetOverlayAnalystParameters, tempObj) {
  18061. for (var name in datasetOverlayAnalystParameters) {
  18062. if (name === "sourceDataset") {
  18063. continue;
  18064. } else if (name === "operateRegions") {
  18065. tempObj.operateRegions = [];
  18066. var ors = datasetOverlayAnalystParameters.operateRegions;
  18067. for (var index in ors) {
  18068. if (ors.hasOwnProperty(index)) {
  18069. //icl542
  18070. tempObj.operateRegions[index] = ServerGeometry.fromGeometry(ors[index]);
  18071. }
  18072. }
  18073. } else if (name === "resultSetting") {
  18074. tempObj.dataReturnOption = datasetOverlayAnalystParameters.resultSetting;
  18075. } else {
  18076. tempObj[name] = datasetOverlayAnalystParameters[name];
  18077. }
  18078. }
  18079. }
  18080. }]);
  18081. return DatasetOverlayAnalystParameters;
  18082. }(OverlayAnalystParameters);
  18083. SuperMap.DatasetOverlayAnalystParameters = DatasetOverlayAnalystParameters;
  18084. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParametersSetting.js
  18085. function SurfaceAnalystParametersSetting_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18086. 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); } }
  18087. function SurfaceAnalystParametersSetting_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParametersSetting_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParametersSetting_defineProperties(Constructor, staticProps); return Constructor; }
  18088. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18089. * This program are made available under the terms of the Apache License, Version 2.0
  18090. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18091. /**
  18092. * @class SuperMap.SurfaceAnalystParametersSetting
  18093. * @category iServer SpatialAnalyst SurfaceAnalyst
  18094. * @classdesc 表面分析参数设置类。
  18095. * 通过该类可以设置表面分析提取等值线、提取等值面的一些参数,包括基准值、等值距、光滑度、光滑方法等。
  18096. * @param {Object} options - 参数。
  18097. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  18098. * @param {number} [options.datumValue=0] - 获取或设置表面分析中提取等值线、提取等值面的基准值。
  18099. * @param {Array.<number>} options.expectedZValues - 获取或设置期望分析结果的 Z 值集合。
  18100. * @param {number} [options.interval=0] - 获取或设置等值距。等值距是两条等值线之间的间隔值。
  18101. * @param {number} [options.resampleTolerance=0] - 获取或设置重采样容限。
  18102. * @param {SuperMap.SmoothMethod} [options.smoothMethod=SuperMap.SmoothMethod.BSPLINE] - 获取或设置光滑处理所使用的方法。
  18103. * @param {number} [options.smoothness=0] - 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  18104. */
  18105. var SurfaceAnalystParametersSetting = /*#__PURE__*/function () {
  18106. function SurfaceAnalystParametersSetting(options) {
  18107. SurfaceAnalystParametersSetting_classCallCheck(this, SurfaceAnalystParametersSetting);
  18108. /**
  18109. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.SurfaceAnalystParametersSetting.prototype.clipRegion]
  18110. * @description 获取或设置裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数。
  18111. */
  18112. this.clipRegion = null;
  18113. /**
  18114. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.datumValue=0]
  18115. * @description 获取或设置表面分析中提取等值线、提取等值面的基准值。
  18116. * 基准值是作为一个生成等值线的初始起算值,并不一定是最小等值线的值。 例如,高程范围为 220 -1550 的 DEM 栅格数据,
  18117. * 如果设基准值为 0, 等值距为 50,则提取等值线时,以基准值 0 为起点,等值距 50 为间隔提取等值线,
  18118. * 因为给定高程的最小值是 220,所以,在给定范围内提取等值线的最小高程是 250。
  18119. * 提取等值线的结果是:最小等值线值为 250,最大等值线值为 1550。
  18120. */
  18121. this.datumValue = 0;
  18122. /**
  18123. * @member {Array.<number>} SuperMap.SurfaceAnalystParametersSetting.prototype.expectedZValues
  18124. * @description 获取或设置期望分析结果的 Z 值集合。
  18125. * Z 值集合存储一系列数值,该数值为待提取等值线的值。即仅高程值在 Z 值集合中的等值线会被提取。
  18126. */
  18127. this.expectedZValues = null;
  18128. /**
  18129. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.interval=0]
  18130. * @description 获取或设置等值距。等值距是两条等值线之间的间隔值。
  18131. */
  18132. this.interval = 0;
  18133. /**
  18134. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.resampleTolerance=0]
  18135. * @description 获取或设置重采样容限。
  18136. * 容限值越大,采样结果数据越简化。当分析结果出现交叉时,可通过调整重采样容限为较小的值来处理。
  18137. */
  18138. this.resampleTolerance = 0;
  18139. /**
  18140. * @member {SuperMap.SmoothMethod} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothMethod=SuperMap.SmoothMethod.BSPLINE]
  18141. * @description 获取或设置光滑处理所使用的方法。
  18142. */
  18143. this.smoothMethod = SmoothMethod.BSPLINE;
  18144. /**
  18145. * @member {number} [SuperMap.SurfaceAnalystParametersSetting.prototype.smoothness=0]
  18146. * @description 获取或设置表面分析中等值线或等值面的边界线的光滑度。
  18147. * 以为 0-5 为例,光滑度为 0 表示不进行光滑操作,值越大表示光滑度越高。
  18148. * 随着光滑度的增加,提取的等值线越光滑.当然光滑度越大,
  18149. * 计算所需的时间和占用的内存也就越大。而且,当等值距较小时,
  18150. * 光滑度太高会出现等值线相交的问题。
  18151. */
  18152. this.smoothness = 0;
  18153. if (options) {
  18154. Util.extend(this, options);
  18155. }
  18156. this.CLASS_NAME = "SuperMap.SurfaceAnalystParametersSetting";
  18157. }
  18158. /**
  18159. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.destroy
  18160. * @description 释放资源,将引用资源的属性置空。
  18161. */
  18162. SurfaceAnalystParametersSetting_createClass(SurfaceAnalystParametersSetting, [{
  18163. key: "destroy",
  18164. value: function destroy() {
  18165. var me = this;
  18166. if (me.clipRegion) {
  18167. me.clipRegion.destroy();
  18168. me.clipRegion = null;
  18169. }
  18170. me.datumValue = null;
  18171. me.expectedZValues = null;
  18172. me.interval = null;
  18173. me.resampleTolerance = null;
  18174. me.smoothMethod = null;
  18175. me.smoothness = null;
  18176. }
  18177. /**
  18178. * @function SuperMap.SurfaceAnalystParametersSetting.prototype.toJSON
  18179. * @description 将对象转化为 JSON 字符串。
  18180. * @returns {string} 对象 JSON 字符串。
  18181. */
  18182. }, {
  18183. key: "toJSON",
  18184. value: function toJSON() {
  18185. var json = "'datumValue':" + Util.toJSON(this.datumValue);
  18186. json += ",'interval':" + Util.toJSON(this.interval);
  18187. json += ",'resampleTolerance':" + Util.toJSON(this.resampleTolerance);
  18188. json += ",'smoothMethod':" + Util.toJSON(this.smoothMethod);
  18189. json += ",'smoothness':" + Util.toJSON(this.smoothness);
  18190. if (this.expectedZValues != null) {
  18191. json += "," + "'expectedZValues':" + Util.toJSON(this.expectedZValues);
  18192. }
  18193. if (this.clipRegion != null) {
  18194. var serverGeometry = this.clipRegion;
  18195. if (this.clipRegion instanceof Geometry && this.clipRegion.components) {
  18196. serverGeometry = ServerGeometry.fromGeometry(this.clipRegion);
  18197. }
  18198. json += ",'clipRegion':" + Util.toJSON(serverGeometry);
  18199. }
  18200. return "{" + json + "}";
  18201. }
  18202. }]);
  18203. return SurfaceAnalystParametersSetting;
  18204. }();
  18205. SuperMap.SurfaceAnalystParametersSetting = SurfaceAnalystParametersSetting;
  18206. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystParameters.js
  18207. function SurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18208. 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); } }
  18209. function SurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18210. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18211. * This program are made available under the terms of the Apache License, Version 2.0
  18212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18213. /**
  18214. * @class SuperMap.SurfaceAnalystParameters
  18215. * @category iServer SpatialAnalyst SurfaceAnalyst
  18216. * @classdesc 表面分析提取操作参数类。
  18217. * @description 通过该类可以为进行表面分析提供参数信息,包括表面分析的方法提取等值线、提取等值面和中间结果的分辨率,
  18218. * {@link SuperMap.DatasetSurfaceAnalystParameters} 和 {@link SuperMap.GeometrySurfaceAnalystParameters} 继承自该类。
  18219. * @param {Object} options - 参数。
  18220. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  18221. * @param {number} options.resolution - 指定中间结果(栅格数据集)的分辨率。
  18222. * @param {SuperMap.DataReturnOption} options.resultSetting - 结果返回设置类。
  18223. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  18224. */
  18225. var SurfaceAnalystParameters = /*#__PURE__*/function () {
  18226. function SurfaceAnalystParameters(options) {
  18227. SurfaceAnalystParameters_classCallCheck(this, SurfaceAnalystParameters);
  18228. /**
  18229. * @member {number} SuperMap.SurfaceAnalystParameters.prototype.resolution
  18230. * @description 获取或设置指定中间结果(栅格数据集)的分辨率。
  18231. */
  18232. this.resolution = 0;
  18233. /**
  18234. * @member {SuperMap.SurfaceAnalystParametersSetting} SuperMap.SurfaceAnalystParameters.prototype.extractParameter
  18235. * @description 获取或设置表面分析参数。
  18236. * 在进行点数据集进行提取等值面分析时,暂时不支持 SurfaceAnalystParametersSetting 类中的 expectedZValues 字段。
  18237. */
  18238. this.extractParameter = new SurfaceAnalystParametersSetting();
  18239. /**
  18240. * @member {SuperMap.DataReturnOption} SuperMap.SurfaceAnalystParameters.prototype.resultSetting
  18241. * @description 结果返回设置类。
  18242. */
  18243. this.resultSetting = new DataReturnOption();
  18244. /**
  18245. * @member {SuperMap.SurfaceAnalystMethod} [SuperMap.SurfaceAnalystParameters.prototype.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE]
  18246. * @description 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  18247. */
  18248. this.surfaceAnalystMethod = SurfaceAnalystMethod.ISOLINE;
  18249. if (options) {
  18250. Util.extend(this, options);
  18251. }
  18252. this.CLASS_NAME = "SuperMap.SurfaceAnalystParameters";
  18253. }
  18254. /**
  18255. * @function SuperMap.SurfaceAnalystParameters.prototype.destroy
  18256. * @description 释放资源,将引用资源的属性置空。
  18257. */
  18258. SurfaceAnalystParameters_createClass(SurfaceAnalystParameters, [{
  18259. key: "destroy",
  18260. value: function destroy() {
  18261. var me = this;
  18262. me.resolution = null;
  18263. if (me.extractParameter) {
  18264. me.extractParameter.destroy();
  18265. me.extractParameter = null;
  18266. }
  18267. if (me.resultSetting) {
  18268. me.resultSetting.destroy();
  18269. me.resultSetting = null;
  18270. }
  18271. me.surfaceAnalystMethod = null;
  18272. }
  18273. }]);
  18274. return SurfaceAnalystParameters;
  18275. }();
  18276. SuperMap.SurfaceAnalystParameters = SurfaceAnalystParameters;
  18277. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetSurfaceAnalystParameters.js
  18278. function DatasetSurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetSurfaceAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetSurfaceAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetSurfaceAnalystParameters_typeof(obj); }
  18279. function DatasetSurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18280. 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); } }
  18281. function DatasetSurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetSurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18282. function DatasetSurfaceAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetSurfaceAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return DatasetSurfaceAnalystParameters_get(target, property, receiver || target); }
  18283. function DatasetSurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetSurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  18284. 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 } }); if (superClass) DatasetSurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  18285. function DatasetSurfaceAnalystParameters_setPrototypeOf(o, p) { DatasetSurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetSurfaceAnalystParameters_setPrototypeOf(o, p); }
  18286. 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); }; }
  18287. function DatasetSurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetSurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetSurfaceAnalystParameters_assertThisInitialized(self); }
  18288. function DatasetSurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18289. function DatasetSurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18290. function DatasetSurfaceAnalystParameters_getPrototypeOf(o) { DatasetSurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetSurfaceAnalystParameters_getPrototypeOf(o); }
  18291. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18292. * This program are made available under the terms of the Apache License, Version 2.0
  18293. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18294. /**
  18295. * @class SuperMap.DatasetSurfaceAnalystParameters
  18296. * @category iServer SpatialAnalyst SurfaceAnalyst
  18297. * @classdesc 数据集表面分析参数类。该类对数据集表面分析所用到的参数进行设置。
  18298. * @param {Object} options - 参数。
  18299. * @param {string} options.dataset - 要用来做数据集表面分析的数据源中数据集的名称。
  18300. * @param {string} options.zValueFieldName - 获取或设置用于提取操作的字段名称。
  18301. * @param {integer} options.resolution - 获取或设置指定中间结果(栅格数据集)的分辨率。
  18302. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 表面分析参数设置类。获取或设置表面分析参数。
  18303. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 获取或设置查询过滤条件参数。
  18304. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  18305. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod=SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  18306. * @extends {SuperMap.SurfaceAnalystParameters}
  18307. */
  18308. var DatasetSurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  18309. DatasetSurfaceAnalystParameters_inherits(DatasetSurfaceAnalystParameters, _SurfaceAnalystParame);
  18310. var _super = DatasetSurfaceAnalystParameters_createSuper(DatasetSurfaceAnalystParameters);
  18311. function DatasetSurfaceAnalystParameters(options) {
  18312. var _this;
  18313. DatasetSurfaceAnalystParameters_classCallCheck(this, DatasetSurfaceAnalystParameters);
  18314. _this = _super.call(this, options);
  18315. /**
  18316. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.dataset
  18317. * @description 要用来做数据集表面分析的数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Country@World。
  18318. */
  18319. _this.dataset = null;
  18320. /**
  18321. * @member {SuperMap.FilterParameter} SuperMap.DatasetSurfaceAnalystParameters.prototype.filterQueryParameter
  18322. * @description 获取或设置查询过滤条件参数。
  18323. */
  18324. _this.filterQueryParameter = new FilterParameter();
  18325. /**
  18326. * @member {string} SuperMap.DatasetSurfaceAnalystParameters.prototype.zValueFieldName
  18327. * @description 获取或设置用于提取操作的字段名称。提取等值线时,将使用该字段中的值,对点记录集中的点数据进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  18328. */
  18329. _this.zValueFieldName = null;
  18330. if (options) {
  18331. Util.extend(DatasetSurfaceAnalystParameters_assertThisInitialized(_this), options);
  18332. }
  18333. _this.CLASS_NAME = "SuperMap.DatasetSurfaceAnalystParameters";
  18334. return _this;
  18335. }
  18336. /**
  18337. * @function SuperMap.DatasetSurfaceAnalystParameters.prototype.destroy
  18338. * @override
  18339. */
  18340. DatasetSurfaceAnalystParameters_createClass(DatasetSurfaceAnalystParameters, [{
  18341. key: "destroy",
  18342. value: function destroy() {
  18343. DatasetSurfaceAnalystParameters_get(DatasetSurfaceAnalystParameters_getPrototypeOf(DatasetSurfaceAnalystParameters.prototype), "destroy", this).call(this);
  18344. var me = this;
  18345. me.dataset = null;
  18346. if (me.filterQueryParameter) {
  18347. me.filterQueryParameter.destroy();
  18348. me.filterQueryParameter = null;
  18349. }
  18350. me.zValueFieldName = null;
  18351. }
  18352. /**
  18353. * @function SuperMap.DatasetSurfaceAnalystParameters.toObject
  18354. * @param {SuperMap.DatasetSurfaceAnalystParameters} datasetSurfaceAnalystParameters - 数据集表面分析参数类。
  18355. * @param {SuperMap.DatasetSurfaceAnalystParameters} tempObj - 数据集表面分析参数对象。
  18356. * @description 将数据集表面分析参数对象转换为 JSON 对象。
  18357. * @returns JSON 对象。
  18358. */
  18359. }], [{
  18360. key: "toObject",
  18361. value: function toObject(datasetSurfaceAnalystParameters, tempObj) {
  18362. for (var name in datasetSurfaceAnalystParameters) {
  18363. if (name === "filterQueryParameter") {
  18364. tempObj.filterQueryParameter = datasetSurfaceAnalystParameters.filterQueryParameter;
  18365. }
  18366. if (name === "extractParameter") {
  18367. if (datasetSurfaceAnalystParameters.extractParameter.clipRegion instanceof Geometry && datasetSurfaceAnalystParameters.extractParameter.clipRegion.components) {
  18368. datasetSurfaceAnalystParameters.extractParameter.clipRegion = ServerGeometry.fromGeometry(datasetSurfaceAnalystParameters.extractParameter.clipRegion);
  18369. }
  18370. tempObj.extractParameter = datasetSurfaceAnalystParameters.extractParameter;
  18371. } else if (name === "dataset") {
  18372. continue;
  18373. } else if (name === "surfaceAnalystMethod") {
  18374. continue;
  18375. } else {
  18376. tempObj[name] = datasetSurfaceAnalystParameters[name];
  18377. }
  18378. }
  18379. }
  18380. }]);
  18381. return DatasetSurfaceAnalystParameters;
  18382. }(SurfaceAnalystParameters);
  18383. SuperMap.DatasetSurfaceAnalystParameters = DatasetSurfaceAnalystParameters;
  18384. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystParameters.js
  18385. function ThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18386. 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); } }
  18387. function ThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18388. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18389. * This program are made available under the terms of the Apache License, Version 2.0
  18390. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18391. /**
  18392. * @class SuperMap.ThiessenAnalystParameters
  18393. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  18394. * @classdesc 泰森多边形分析参数基类。
  18395. * @param {Object} options - 参数。
  18396. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.clipRegion] - 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  18397. * @param {boolean} [options.createResultDataset=false] - 是否返回结果数据集。
  18398. * @param {string} [options.resultDatasetName] - 指定结果数据集名称。
  18399. * @param {string} [options.resultDatasourceName] - 指定结果数据集所在数据源,默认为当前数据源。
  18400. * @param {boolean} [options.returnResultRegion=true] - 是否返回分析得到的多边形面数组。
  18401. */
  18402. var ThiessenAnalystParameters = /*#__PURE__*/function () {
  18403. function ThiessenAnalystParameters(options) {
  18404. ThiessenAnalystParameters_classCallCheck(this, ThiessenAnalystParameters);
  18405. if (!options) {
  18406. return;
  18407. }
  18408. /**
  18409. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.ThiessenAnalystParameters.prototype.clipRegion]
  18410. * @description 结果数据裁剪区域,可以为 null,表示不对结果进行裁剪。
  18411. */
  18412. this.clipRegion = null;
  18413. /**
  18414. * @member {boolean} [SuperMap.ThiessenAnalystParameters.prototype.createResultDataset=false]
  18415. * @description 是否返回结果数据集。如果为 true,则必须设置属性 resultDatasetName 和 resultDatasourceName。
  18416. */
  18417. this.createResultDataset = false;
  18418. /**
  18419. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasetName
  18420. * @description 指定结果数据集名称。
  18421. */
  18422. this.resultDatasetName = null;
  18423. /**
  18424. * @member {string} SuperMap.ThiessenAnalystParameters.prototype.resultDatasourceName
  18425. * @description 指定结果数据集所在数据源。
  18426. */
  18427. this.resultDatasourceName = null;
  18428. /**
  18429. * @member {boolean} SuperMap.ThiessenAnalystParameters.prototype.returnResultRegion
  18430. * @description 是否返回分析得到的多边形面数组。
  18431. */
  18432. this.returnResultRegion = true;
  18433. Util.extend(this, options);
  18434. this.CLASS_NAME = "SuperMap.ThiessenAnalystParameters";
  18435. }
  18436. /**
  18437. * @function SuperMap.ThiessenAnalystParameters.prototype.destroy
  18438. * @description 释放资源,将引用资源的属性置空。
  18439. */
  18440. ThiessenAnalystParameters_createClass(ThiessenAnalystParameters, [{
  18441. key: "destroy",
  18442. value: function destroy() {
  18443. var me = this;
  18444. if (me.clipRegion) {
  18445. me.clipRegion.destroy();
  18446. me.clipRegion = null;
  18447. }
  18448. me.createResultDataset = null;
  18449. me.resultDatasetName = null;
  18450. me.resultDatasourceName = null;
  18451. me.returnResultRegion = null;
  18452. }
  18453. }]);
  18454. return ThiessenAnalystParameters;
  18455. }();
  18456. SuperMap.ThiessenAnalystParameters = ThiessenAnalystParameters;
  18457. ;// CONCATENATED MODULE: ./src/common/iServer/DatasetThiessenAnalystParameters.js
  18458. function DatasetThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DatasetThiessenAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { DatasetThiessenAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DatasetThiessenAnalystParameters_typeof(obj); }
  18459. function DatasetThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18460. 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); } }
  18461. function DatasetThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DatasetThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DatasetThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18462. function DatasetThiessenAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DatasetThiessenAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return DatasetThiessenAnalystParameters_get(target, property, receiver || target); }
  18463. function DatasetThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DatasetThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  18464. 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 } }); if (superClass) DatasetThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  18465. function DatasetThiessenAnalystParameters_setPrototypeOf(o, p) { DatasetThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DatasetThiessenAnalystParameters_setPrototypeOf(o, p); }
  18466. 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); }; }
  18467. function DatasetThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (DatasetThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return DatasetThiessenAnalystParameters_assertThisInitialized(self); }
  18468. function DatasetThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18469. function DatasetThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18470. function DatasetThiessenAnalystParameters_getPrototypeOf(o) { DatasetThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DatasetThiessenAnalystParameters_getPrototypeOf(o); }
  18471. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18472. * This program are made available under the terms of the Apache License, Version 2.0
  18473. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18474. /**
  18475. * @class SuperMap.DatasetThiessenAnalystParameters
  18476. * @category iServer SpatialAnalyst ThiessenAnalyst
  18477. * @classdesc 数据集泰森多边形分析参数类。
  18478. * @param {Object} options - 参数。
  18479. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  18480. * @extends {SuperMap.ThiessenAnalystParameters}
  18481. */
  18482. var DatasetThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  18483. DatasetThiessenAnalystParameters_inherits(DatasetThiessenAnalystParameters, _ThiessenAnalystParam);
  18484. var _super = DatasetThiessenAnalystParameters_createSuper(DatasetThiessenAnalystParameters);
  18485. function DatasetThiessenAnalystParameters(options) {
  18486. var _this;
  18487. DatasetThiessenAnalystParameters_classCallCheck(this, DatasetThiessenAnalystParameters);
  18488. _this = _super.call(this, options);
  18489. /**
  18490. * @member {SuperMap.FilterParameter} [SuperMap.DatasetThiessenAnalystParameters.prototype.filterQueryParameter]
  18491. * @description 过滤条件,对待分析数据集中的点进行过滤,即对数据集中的所有点进行分析。
  18492. * @example
  18493. * var filterQueryParameter = new SuperMap.FilterParameter({
  18494. * name: "Countries@World",
  18495. * attributeFilter: "SmID>100"
  18496. * });
  18497. */
  18498. _this.filterQueryParameter = null;
  18499. /**
  18500. * @member {string} SuperMap.DatasetThiessenAnalystParameters.prototype.dataset
  18501. * @description 数据集名称待分析的数据集名称,请使用 "datasetName@datasourceName" 格式来表示。
  18502. */
  18503. _this.dataset = null;
  18504. if (options) {
  18505. Util.extend(DatasetThiessenAnalystParameters_assertThisInitialized(_this), options);
  18506. }
  18507. _this.CLASS_NAME = "SuperMap.DatasetThiessenAnalystParameters";
  18508. return _this;
  18509. }
  18510. /**
  18511. * @function SuperMap.DatasetThiessenAnalystParameters.prototype.destroy
  18512. * @override
  18513. */
  18514. DatasetThiessenAnalystParameters_createClass(DatasetThiessenAnalystParameters, [{
  18515. key: "destroy",
  18516. value: function destroy() {
  18517. DatasetThiessenAnalystParameters_get(DatasetThiessenAnalystParameters_getPrototypeOf(DatasetThiessenAnalystParameters.prototype), "destroy", this).call(this);
  18518. var me = this;
  18519. if (me.filterQueryParameter) {
  18520. me.filterQueryParameter.destroy();
  18521. me.filterQueryParameter = null;
  18522. }
  18523. }
  18524. /**
  18525. * @function SuperMap.DatasetThiessenAnalystParameters.toObject
  18526. * @param {SuperMap.DatasetThiessenAnalystParameters} datasetThiessenAnalystParameters - 泰森多边形分析服务参数类。
  18527. * @param {SuperMap.DatasetThiessenAnalystParameters} tempObj - 泰森多边形分析服务参数对象。
  18528. * @description 将泰森多边形分析服务参数对象转换为 JSON 对象。
  18529. * @returns JSON 对象。
  18530. */
  18531. }], [{
  18532. key: "toObject",
  18533. value: function toObject(datasetThiessenAnalystParameters, tempObj) {
  18534. for (var name in datasetThiessenAnalystParameters) {
  18535. if (name === "clipRegion") {
  18536. tempObj.clipRegion = ServerGeometry.fromGeometry(datasetThiessenAnalystParameters.clipRegion);
  18537. } else {
  18538. tempObj[name] = datasetThiessenAnalystParameters[name];
  18539. }
  18540. }
  18541. }
  18542. }]);
  18543. return DatasetThiessenAnalystParameters;
  18544. }(ThiessenAnalystParameters);
  18545. SuperMap.DatasetThiessenAnalystParameters = DatasetThiessenAnalystParameters;
  18546. ;// CONCATENATED MODULE: ./src/common/iServer/DensityKernelAnalystParameters.js
  18547. function DensityKernelAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18548. 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); } }
  18549. function DensityKernelAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityKernelAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityKernelAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18550. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18551. * This program are made available under the terms of the Apache License, Version 2.0
  18552. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18553. /**
  18554. * @class SuperMap.DensityKernelAnalystParameters
  18555. * @category iServer SpatialAnalyst DensityAnalyst
  18556. * @classdesc 核密度分析参数类。
  18557. * @param {Object} options - 参数。
  18558. * @param {string} options.dataset - 要用来做核密度分析数据源中数据集的名称。该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:BaseMap_P@Jingjin。
  18559. * @param {string} options.fieldName - 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  18560. * @param {string} options.resultGridName - 指定结果数据集名称。
  18561. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.bounds] - 核密度分析的范围,用于确定结果栅格数据集的范围。如果缺省,则默认为原数据集的范围。
  18562. * @param {number} [options.searchRadius] - 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  18563. * @param {number} [options.resultGridDatasetResolution] - 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  18564. * @param {string} [options.targetDatasource] - 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  18565. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  18566. */
  18567. var DensityKernelAnalystParameters = /*#__PURE__*/function () {
  18568. function DensityKernelAnalystParameters(options) {
  18569. DensityKernelAnalystParameters_classCallCheck(this, DensityKernelAnalystParameters);
  18570. /**
  18571. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.dataset
  18572. * @description 要用来做核密度分析数据源中数据集的名称。
  18573. * 该名称用形如 "数据集名称@数据源别名" 形式来表示,例如:Railway@Changchun。
  18574. * 注:核密度分析支持点数据集和线数据集。
  18575. */
  18576. this.dataset = null;
  18577. /**
  18578. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} [SuperMap.DensityKernelAnalystParameters.prototype.bounds]
  18579. * @description 核密度分析的范围,用于确定结果栅格数据集的范围。
  18580. * 如果缺省,则默认为原数据集的范围。
  18581. */
  18582. this.bounds = null;
  18583. /**
  18584. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.fieldName
  18585. * @description 用于进行核密度分析的测量值的字段名称,核密度分析不支持文本类型的字段。
  18586. */
  18587. this.fieldName = null;
  18588. /**
  18589. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.resultGridDatasetResolution]
  18590. * @description 密度分析结果栅格数据的分辨率,单位与当前数据集相同。默认值为当前数据集的长宽中的最小值除500。
  18591. */
  18592. this.resultGridDatasetResolution = null;
  18593. /**
  18594. * @member {number} [SuperMap.DensityKernelAnalystParameters.prototype.searchRadius]
  18595. * @description 栅格邻域内用于计算密度的查找半径,单位与当前数据集相同。默认值为当前数据集的长宽中的最大值除30。
  18596. */
  18597. this.searchRadius = null;
  18598. /**
  18599. * @member {string} [SuperMap.DensityKernelAnalystParameters.prototype.targetDatasource]
  18600. * @description 指定的存储结果数据集的数据源,默认为当前分析的数据集所在的数据源。
  18601. */
  18602. this.targetDatasource = null;
  18603. /**
  18604. * @member {string} SuperMap.DensityKernelAnalystParameters.prototype.resultGridName
  18605. * @description 指定结果数据集名称。
  18606. */
  18607. this.resultGridName = null;
  18608. /**
  18609. * @member {boolean} [SuperMap.DensityKernelAnalystParameters.prototype.deleteExistResultDataset=false]
  18610. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  18611. */
  18612. this.deleteExistResultDataset = false;
  18613. Util.extend(this, options);
  18614. this.CLASS_NAME = "SuperMap.DensityKernelAnalystParameters";
  18615. }
  18616. /**
  18617. * @function SuperMap.DensityKernelAnalystParameters.prototype.destroy
  18618. * @description 释放资源,将引用资源的属性置空。
  18619. */
  18620. DensityKernelAnalystParameters_createClass(DensityKernelAnalystParameters, [{
  18621. key: "destroy",
  18622. value: function destroy() {
  18623. var me = this;
  18624. me.dataset = null;
  18625. me.bounds = null;
  18626. me.fieldName = null;
  18627. me.resultGridDatasetResolution = null;
  18628. me.searchRadius = null;
  18629. me.targetDatasource = null;
  18630. me.resultGridName = null;
  18631. me.deleteExistResultDataset = null;
  18632. }
  18633. /**
  18634. * @function SuperMap.DensityKernelAnalystParameters.toObject
  18635. * @param {SuperMap.DensityKernelAnalystParameters} densityKernelAnalystParameters -核密度分析参数类。
  18636. * @param {SuperMap.DensityKernelAnalystParameters} tempObj - 核密度分析参数对象。
  18637. * @description 将核密度分析参数对象转换成 JSON 对象。
  18638. * @returns JSON 对象。
  18639. */
  18640. }], [{
  18641. key: "toObject",
  18642. value: function toObject(densityKernelAnalystParameters, tempObj) {
  18643. for (var name in densityKernelAnalystParameters) {
  18644. if (name !== "dataset") {
  18645. tempObj[name] = densityKernelAnalystParameters[name];
  18646. }
  18647. }
  18648. }
  18649. }]);
  18650. return DensityKernelAnalystParameters;
  18651. }();
  18652. SuperMap.DensityKernelAnalystParameters = DensityKernelAnalystParameters;
  18653. ;// CONCATENATED MODULE: ./src/common/iServer/DensityAnalystService.js
  18654. function DensityAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DensityAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { DensityAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DensityAnalystService_typeof(obj); }
  18655. function DensityAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18656. 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); } }
  18657. function DensityAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) DensityAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) DensityAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  18658. function DensityAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { DensityAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return DensityAnalystService_get(target, property, receiver || target); }
  18659. function DensityAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = DensityAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  18660. 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 } }); if (superClass) DensityAnalystService_setPrototypeOf(subClass, superClass); }
  18661. function DensityAnalystService_setPrototypeOf(o, p) { DensityAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DensityAnalystService_setPrototypeOf(o, p); }
  18662. 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); }; }
  18663. function DensityAnalystService_possibleConstructorReturn(self, call) { if (call && (DensityAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return DensityAnalystService_assertThisInitialized(self); }
  18664. function DensityAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18665. function DensityAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18666. function DensityAnalystService_getPrototypeOf(o) { DensityAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DensityAnalystService_getPrototypeOf(o); }
  18667. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18668. * This program are made available under the terms of the Apache License, Version 2.0
  18669. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18670. /**
  18671. * @class SuperMap.DensityAnalystService
  18672. * @category iServer SpatialAnalyst DensityAnalyst
  18673. * @classdesc
  18674. * 密度分析服务类,密度分析可计算每个输出栅格像元周围圆形邻域内输入的点或线对象的密度。
  18675. * 密度分析,在某种意义上来说,相当于在表面上将输入的点线对象的测量值散开来,将每个点或线对象的测量量分布在整个研究区域,并计算输出栅格中每个像元的密度值。目前提供1种密度分析:核密度分析(Kernel)。
  18676. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  18677. * @param {Object} options - 参数。</br>
  18678. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  18679. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18680. * @param {Object} [options.headers] - 请求头。
  18681. * @extends {SuperMap.SpatialAnalystBase}
  18682. * @example 例如:
  18683. * var myDensityAnalystService = new SuperMap.DensityAnalystService(url);
  18684. * myDensityAnalystService.on({
  18685. * "processCompleted": processCompleted,
  18686. * "processFailed": processFailed
  18687. * }
  18688. * );
  18689. */
  18690. var DensityAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  18691. DensityAnalystService_inherits(DensityAnalystService, _SpatialAnalystBase);
  18692. var _super = DensityAnalystService_createSuper(DensityAnalystService);
  18693. function DensityAnalystService(url, options) {
  18694. var _this;
  18695. DensityAnalystService_classCallCheck(this, DensityAnalystService);
  18696. _this = _super.call(this, url, options);
  18697. /**
  18698. * @member {string} SuperMap.DensityAnalystService.prototype.mode
  18699. * @description 密度分析类型。
  18700. */
  18701. _this.mode = null;
  18702. if (options) {
  18703. Util.extend(DensityAnalystService_assertThisInitialized(_this), options);
  18704. }
  18705. _this.CLASS_NAME = "SuperMap.DensityAnalystService";
  18706. return _this;
  18707. }
  18708. /**
  18709. * @function SuperMap.DensityAnalystService.prototype.destroy
  18710. * @description 释放资源,将引用资源的属性置空。
  18711. */
  18712. DensityAnalystService_createClass(DensityAnalystService, [{
  18713. key: "destroy",
  18714. value: function destroy() {
  18715. DensityAnalystService_get(DensityAnalystService_getPrototypeOf(DensityAnalystService.prototype), "destroy", this).call(this);
  18716. this.mode = null;
  18717. }
  18718. /**
  18719. * @function SuperMap.DensityAnalystService.prototype.processAsync
  18720. * @description 负责将客户端的查询参数传递到服务端。
  18721. * @param {SuperMap.DensityKernelAnalystParameters} parameter - 核密度分析参数。
  18722. */
  18723. }, {
  18724. key: "processAsync",
  18725. value: function processAsync(parameter) {
  18726. var me = this;
  18727. var parameterObject = new Object();
  18728. if (parameter instanceof DensityKernelAnalystParameters) {
  18729. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/densityanalyst/kernel');
  18730. me.mode = "kernel";
  18731. }
  18732. DensityKernelAnalystParameters.toObject(parameter, parameterObject);
  18733. var jsonParameters = Util.toJSON(parameterObject);
  18734. me.url = Util.urlAppend(me.url, 'returnContent=true');
  18735. me.request({
  18736. method: "POST",
  18737. data: jsonParameters,
  18738. scope: me,
  18739. success: me.serviceProcessCompleted,
  18740. failure: me.serviceProcessFailed
  18741. });
  18742. }
  18743. }]);
  18744. return DensityAnalystService;
  18745. }(SpatialAnalystBase);
  18746. SuperMap.DensityAnalystService = DensityAnalystService;
  18747. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesParameters.js
  18748. function EditFeaturesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18749. 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); } }
  18750. function EditFeaturesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18751. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18752. * This program are made available under the terms of the Apache License, Version 2.0
  18753. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18754. /**
  18755. * @class SuperMap.EditFeaturesParameters
  18756. * @category iServer Data Feature
  18757. * @classdesc 数据服务中数据集添加、修改、删除参数类。
  18758. * @category iServer Data
  18759. * @param {Object} options - 参数。
  18760. * @param {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} options.features - 当前需要创建或者是修改的要素集。
  18761. * @param {boolean} [options.returnContent=false] - 是返回创建要素的 ID 数组还是返回 featureResult 资源的 URI。
  18762. * @param {SuperMap.EditType} [options.editType=SuperMap.EditType.ADD] - POST 动作类型 (ADD、UPDATE、DELETE)。
  18763. * @param {Array.<string|integer>} [options.IDs] - 删除要素时的要素的 ID 数组。
  18764. */
  18765. var EditFeaturesParameters = /*#__PURE__*/function () {
  18766. function EditFeaturesParameters(options) {
  18767. EditFeaturesParameters_classCallCheck(this, EditFeaturesParameters);
  18768. /**
  18769. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSourceName
  18770. * @description 当前需要创建或者是修改的要素的数据源。
  18771. */
  18772. this.dataSourceName = null;
  18773. /**
  18774. * @member {string} SuperMap.EditFeaturesParameters.prototype.dataSetName
  18775. * @description 当前需要创建或者是修改的要素的数据集。
  18776. */
  18777. this.dataSetName = null;
  18778. /**
  18779. * @member {Array.<SuperMap.Feature.Vector|GeoJSONObject|ol.feature>} SuperMap.EditFeaturesParameters.prototype.features
  18780. * @description 当前需要创建或者是修改的要素集。
  18781. */
  18782. this.features = null;
  18783. /**
  18784. * @member {SuperMap.EditType} [SuperMap.EditFeaturesParameters.prototype.editType=SuperMap.EditType.ADD]
  18785. * @description 要素集更新类型 (add、update、delete)。
  18786. */
  18787. this.editType = EditType.ADD;
  18788. /**
  18789. * @member {Array.<string|number>} [SuperMap.EditFeaturesParameters.prototype.IDs]
  18790. * @description 执行删除时要素集 ID 集合。
  18791. */
  18792. this.IDs = null;
  18793. /**
  18794. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.returnContent=false]
  18795. * @description 要素添加时,isUseBatch 不传或传为 false 的情况下有效。
  18796. * true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  18797. */
  18798. this.returnContent = false;
  18799. /**
  18800. * @member {boolean} [SuperMap.EditFeaturesParameters.prototype.isUseBatch=false]
  18801. * @description 是否使用批量添加要素功能,要素添加时有效。批量添加能够提高要素编辑效率。true 表示批量添加;false 表示不使用批量添加。
  18802. */
  18803. this.isUseBatch = false;
  18804. Util.extend(this, options);
  18805. this.CLASS_NAME = "SuperMap.EditFeaturesParameters";
  18806. }
  18807. /**
  18808. * @function SuperMap.EditFeaturesParameters.prototype.destroy
  18809. * @description 释放资源,将引用资源的属性置空。
  18810. */
  18811. EditFeaturesParameters_createClass(EditFeaturesParameters, [{
  18812. key: "destroy",
  18813. value: function destroy() {
  18814. var me = this;
  18815. me.dataSourceName = null;
  18816. me.dataSetName = null;
  18817. me.features = null;
  18818. me.editType = null;
  18819. me.IDs = null;
  18820. me.returnContent = null;
  18821. }
  18822. /**
  18823. * @function SuperMap.EditFeaturesParameters.prototype.toJsonParameters
  18824. * @description 将 EditFeaturesParameters 对象参数转换为 JSON 字符串。
  18825. * @param {SuperMap.EditFeaturesParameters} params - 地物编辑参数。
  18826. * @returns {string} JSON 字符串。
  18827. */
  18828. }], [{
  18829. key: "toJsonParameters",
  18830. value: function toJsonParameters(params) {
  18831. var feature,
  18832. len,
  18833. features,
  18834. editType = params.editType;
  18835. if (editType === EditType.DELETE) {
  18836. if (params.IDs === null) {
  18837. return;
  18838. }
  18839. features = {
  18840. ids: params.IDs
  18841. };
  18842. } else {
  18843. features = [];
  18844. if (params.features) {
  18845. len = params.features.length;
  18846. for (var i = 0; i < len; i++) {
  18847. feature = params.features[i];
  18848. feature.geometry = ServerGeometry.fromGeometry(feature.geometry);
  18849. features.push(feature);
  18850. }
  18851. }
  18852. }
  18853. return Util.toJSON(features);
  18854. }
  18855. }]);
  18856. return EditFeaturesParameters;
  18857. }();
  18858. SuperMap.EditFeaturesParameters = EditFeaturesParameters;
  18859. ;// CONCATENATED MODULE: ./src/common/iServer/EditFeaturesService.js
  18860. function EditFeaturesService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { EditFeaturesService_typeof = function _typeof(obj) { return typeof obj; }; } else { EditFeaturesService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return EditFeaturesService_typeof(obj); }
  18861. function EditFeaturesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18862. 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); } }
  18863. function EditFeaturesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) EditFeaturesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) EditFeaturesService_defineProperties(Constructor, staticProps); return Constructor; }
  18864. function EditFeaturesService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { EditFeaturesService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return EditFeaturesService_get(target, property, receiver || target); }
  18865. function EditFeaturesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = EditFeaturesService_getPrototypeOf(object); if (object === null) break; } return object; }
  18866. 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 } }); if (superClass) EditFeaturesService_setPrototypeOf(subClass, superClass); }
  18867. function EditFeaturesService_setPrototypeOf(o, p) { EditFeaturesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return EditFeaturesService_setPrototypeOf(o, p); }
  18868. 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); }; }
  18869. function EditFeaturesService_possibleConstructorReturn(self, call) { if (call && (EditFeaturesService_typeof(call) === "object" || typeof call === "function")) { return call; } return EditFeaturesService_assertThisInitialized(self); }
  18870. function EditFeaturesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  18871. function EditFeaturesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  18872. function EditFeaturesService_getPrototypeOf(o) { EditFeaturesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return EditFeaturesService_getPrototypeOf(o); }
  18873. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18874. * This program are made available under the terms of the Apache License, Version 2.0
  18875. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18876. /**
  18877. * @class SuperMap.EditFeaturesService
  18878. * @category iServer Data Feature
  18879. * @classdesc 数据服务中数据集添加、更新、删除服务类。
  18880. * @extends {SuperMap.CommonServiceBase}
  18881. * @param {string} url - 服务端的数据服务资源地址。请求数据服务中数据集编辑服务,URL 应为:</br>
  18882. * http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/datasources/name/{数据源名}/datasets/name/{数据集名} 。</br>
  18883. * 例如:http://localhost:8090/iserver/services/data-jingjin/rest/data/datasources/name/Jingjin/datasets/name/Landuse_R
  18884. * @param {Object} options - 参数。</br>
  18885. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  18886. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  18887. * @param {SuperMap.DataFormat} [format] -查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  18888. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  18889. * @param {Object} [options.headers] - 请求头。
  18890. * @example
  18891. * var myService = new SuperMap.EditFeaturesService(url, {eventListeners: {
  18892. * "processCompleted": editFeatureCompleted,
  18893. * "processFailed": editFeatureError
  18894. * }
  18895. * };
  18896. *
  18897. */
  18898. var EditFeaturesService = /*#__PURE__*/function (_CommonServiceBase) {
  18899. EditFeaturesService_inherits(EditFeaturesService, _CommonServiceBase);
  18900. var _super = EditFeaturesService_createSuper(EditFeaturesService);
  18901. function EditFeaturesService(url, options) {
  18902. var _this;
  18903. EditFeaturesService_classCallCheck(this, EditFeaturesService);
  18904. _this = _super.call(this, url, options);
  18905. /**
  18906. * @member {boolean} [SuperMap.EditFeaturesService.prototype.returnContent=false]
  18907. * @description要素添加时,isUseBatch 不传或传为 false 的情况下有效。true 表示直接返回新创建的要素的 ID 数组;false 表示返回创建的 featureResult 资源的 URI。
  18908. */
  18909. _this.returnContent = false;
  18910. /**
  18911. * @member {boolean} [SuperMap.EditFeaturesService.prototype.isUseBatch=false]
  18912. * @description 是否使用批量添加要素功能,要素添加时有效。
  18913. * 批量添加能够提高要素编辑效率。
  18914. * true 表示批量添加;false 表示不使用批量添加。
  18915. */
  18916. _this.isUseBatch = false;
  18917. if (options) {
  18918. Util.extend(EditFeaturesService_assertThisInitialized(_this), options);
  18919. }
  18920. _this.url = Util.urlPathAppend(_this.url, 'features');
  18921. _this.CLASS_NAME = "SuperMap.EditFeaturesService";
  18922. return _this;
  18923. }
  18924. /**
  18925. * @function SuperMap.EditFeaturesService.prototype.destroy
  18926. * @override
  18927. */
  18928. EditFeaturesService_createClass(EditFeaturesService, [{
  18929. key: "destroy",
  18930. value: function destroy() {
  18931. EditFeaturesService_get(EditFeaturesService_getPrototypeOf(EditFeaturesService.prototype), "destroy", this).call(this);
  18932. var me = this;
  18933. me.returnContent = null;
  18934. me.isUseBatch = null;
  18935. me.fromIndex = null;
  18936. me.toIndex = null;
  18937. }
  18938. /**
  18939. * @function SuperMap.EditFeaturesService.prototype.processAsync
  18940. * @description 负责将客户端的更新参数传递到服务端。
  18941. * @param {SuperMap.EditFeaturesParameters} params - 编辑要素参数。
  18942. */
  18943. }, {
  18944. key: "processAsync",
  18945. value: function processAsync(params) {
  18946. if (!(params instanceof EditFeaturesParameters)) {
  18947. return;
  18948. }
  18949. var me = this,
  18950. method = "POST",
  18951. ids = "",
  18952. editType = params.editType,
  18953. jsonParameters = null;
  18954. me.returnContent = params.returnContent;
  18955. me.isUseBatch = params.isUseBatch;
  18956. jsonParameters = EditFeaturesParameters.toJsonParameters(params);
  18957. if (editType === EditType.DELETE) {
  18958. ids = Util.toJSON(params.IDs);
  18959. me.url = Util.urlAppend(me.url, "ids=" + ids);
  18960. method = "DELETE";
  18961. jsonParameters = ids;
  18962. } else if (editType === EditType.UPDATE) {
  18963. method = "PUT";
  18964. } else {
  18965. if (me.isUseBatch) {
  18966. me.url = Util.urlAppend(me.url, "isUseBatch=".concat(me.isUseBatch));
  18967. me.returnContent = false;
  18968. }
  18969. if (me.returnContent) {
  18970. me.url = Util.urlAppend(me.url, 'returnContent=true');
  18971. method = "POST";
  18972. }
  18973. }
  18974. me.request({
  18975. method: method,
  18976. data: jsonParameters,
  18977. scope: me,
  18978. success: me.serviceProcessCompleted,
  18979. failure: me.serviceProcessFailed
  18980. });
  18981. }
  18982. }]);
  18983. return EditFeaturesService;
  18984. }(CommonServiceBase);
  18985. SuperMap.EditFeaturesService = EditFeaturesService;
  18986. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalyst3DParameters.js
  18987. function FacilityAnalyst3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  18988. 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); } }
  18989. function FacilityAnalyst3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalyst3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalyst3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  18990. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  18991. * This program are made available under the terms of the Apache License, Version 2.0
  18992. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  18993. /**
  18994. * @class SuperMap.FacilityAnalyst3DParameters
  18995. * @category iServer FacilityAnalyst3D
  18996. * @classdesc 最近设施分析参数基类。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  18997. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,
  18998. * 超过 10 分钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起
  18999. * 作用的障碍边、障碍点、转向表、耗费等属性在最近设施分析时同样可设置。
  19000. * @param {Object} options - 参数。
  19001. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19002. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19003. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19004. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19005. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19006. */
  19007. var FacilityAnalyst3DParameters = /*#__PURE__*/function () {
  19008. function FacilityAnalyst3DParameters(options) {
  19009. FacilityAnalyst3DParameters_classCallCheck(this, FacilityAnalyst3DParameters);
  19010. /**
  19011. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.edgeID]
  19012. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19013. */
  19014. this.edgeID = null;
  19015. /**
  19016. * @member {number} [SuperMap.FacilityAnalyst3DParameters.prototype.nodeID]
  19017. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19018. */
  19019. this.nodeID = null;
  19020. /**
  19021. * @member {string} SuperMap.FacilityAnalyst3DParameters.prototype.weightName
  19022. * @description 指定的权值字段信息对象的名称。
  19023. */
  19024. this.weightName = null;
  19025. /**
  19026. * @member {boolean} [SuperMap.FacilityAnalyst3DParameters.prototype.isUncertainDirectionValid=false]
  19027. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19028. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找
  19029. */
  19030. this.isUncertainDirectionValid = false;
  19031. Util.extend(this, options);
  19032. this.CLASS_NAME = "SuperMap.FacilityAnalyst3DParameters";
  19033. }
  19034. /**
  19035. * @function SuperMap.FacilityAnalyst3DParameters.prototype.destroy
  19036. * @override
  19037. */
  19038. FacilityAnalyst3DParameters_createClass(FacilityAnalyst3DParameters, [{
  19039. key: "destroy",
  19040. value: function destroy() {
  19041. var me = this;
  19042. me.edgeID = null;
  19043. me.nodeID = null;
  19044. me.weightName = null;
  19045. me.isUncertainDirectionValid = null;
  19046. }
  19047. }]);
  19048. return FacilityAnalyst3DParameters;
  19049. }();
  19050. SuperMap.FacilityAnalyst3DParameters = FacilityAnalyst3DParameters;
  19051. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DParameters.js
  19052. function FacilityAnalystSinks3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSinks3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSinks3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSinks3DParameters_typeof(obj); }
  19053. function FacilityAnalystSinks3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19054. 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); } }
  19055. function FacilityAnalystSinks3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19056. function FacilityAnalystSinks3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSinks3DParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystSinks3DParameters_get(target, property, receiver || target); }
  19057. function FacilityAnalystSinks3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSinks3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19058. 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 } }); if (superClass) FacilityAnalystSinks3DParameters_setPrototypeOf(subClass, superClass); }
  19059. function FacilityAnalystSinks3DParameters_setPrototypeOf(o, p) { FacilityAnalystSinks3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DParameters_setPrototypeOf(o, p); }
  19060. 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); }; }
  19061. function FacilityAnalystSinks3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DParameters_assertThisInitialized(self); }
  19062. function FacilityAnalystSinks3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19063. function FacilityAnalystSinks3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19064. function FacilityAnalystSinks3DParameters_getPrototypeOf(o) { FacilityAnalystSinks3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DParameters_getPrototypeOf(o); }
  19065. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19066. * This program are made available under the terms of the Apache License, Version 2.0
  19067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19068. /**
  19069. * @class SuperMap.FacilityAnalystSinks3DParameters
  19070. * @category iServer FacilityAnalyst3D Sinks
  19071. * @classdesc 最近设施分析参数类(汇查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19072. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分钟
  19073. * 能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍点、
  19074. * 转向表、耗费等属性在最近设施分析时同样可设置。
  19075. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19076. * @param {Object} options - 参数。
  19077. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19078. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19079. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19080. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19081. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19082. */
  19083. var FacilityAnalystSinks3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19084. FacilityAnalystSinks3DParameters_inherits(FacilityAnalystSinks3DParameters, _FacilityAnalyst3DPar);
  19085. var _super = FacilityAnalystSinks3DParameters_createSuper(FacilityAnalystSinks3DParameters);
  19086. function FacilityAnalystSinks3DParameters(options) {
  19087. var _this;
  19088. FacilityAnalystSinks3DParameters_classCallCheck(this, FacilityAnalystSinks3DParameters);
  19089. _this = _super.call(this, options);
  19090. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DParameters";
  19091. return _this;
  19092. }
  19093. /**
  19094. * @function SuperMap.FacilityAnalystSinks3DParameters.prototype.destroy
  19095. * @override
  19096. */
  19097. FacilityAnalystSinks3DParameters_createClass(FacilityAnalystSinks3DParameters, [{
  19098. key: "destroy",
  19099. value: function destroy() {
  19100. FacilityAnalystSinks3DParameters_get(FacilityAnalystSinks3DParameters_getPrototypeOf(FacilityAnalystSinks3DParameters.prototype), "destroy", this).call(this);
  19101. }
  19102. }]);
  19103. return FacilityAnalystSinks3DParameters;
  19104. }(FacilityAnalyst3DParameters);
  19105. SuperMap.FacilityAnalystSinks3DParameters = FacilityAnalystSinks3DParameters;
  19106. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSinks3DService.js
  19107. function FacilityAnalystSinks3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSinks3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSinks3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSinks3DService_typeof(obj); }
  19108. function FacilityAnalystSinks3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19109. 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); } }
  19110. function FacilityAnalystSinks3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSinks3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSinks3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19111. 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 } }); if (superClass) FacilityAnalystSinks3DService_setPrototypeOf(subClass, superClass); }
  19112. function FacilityAnalystSinks3DService_setPrototypeOf(o, p) { FacilityAnalystSinks3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSinks3DService_setPrototypeOf(o, p); }
  19113. 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); }; }
  19114. function FacilityAnalystSinks3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSinks3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSinks3DService_assertThisInitialized(self); }
  19115. function FacilityAnalystSinks3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19116. function FacilityAnalystSinks3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19117. function FacilityAnalystSinks3DService_getPrototypeOf(o) { FacilityAnalystSinks3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSinks3DService_getPrototypeOf(o); }
  19118. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19119. * This program are made available under the terms of the Apache License, Version 2.0
  19120. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19121. /**
  19122. * @class SuperMap.FacilityAnalystSinks3DService
  19123. * @category iServer FacilityAnalyst3D Sinks
  19124. * @classdesc 最近设施分析服务类(汇查找资源)<br>
  19125. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  19126. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19127. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  19128. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  19129. * @extends {SuperMap.CommonServiceBase}
  19130. * @example
  19131. * var myFacilityAnalystSinks3DService = new SuperMap.FacilityAnalystSinks3DService(url, {
  19132. * eventListeners: {
  19133. * "processCompleted": facilityAnalystSinks3DCompleted,
  19134. * "processFailed": facilityAnalystSinks3DError
  19135. * }
  19136. * });
  19137. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:<br>
  19138. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};<br>
  19139. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。<br>
  19140. * @param {Object} options - 参数。<br>
  19141. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19142. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19143. * @param {Object} [options.headers] - 请求头。
  19144. */
  19145. var FacilityAnalystSinks3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19146. FacilityAnalystSinks3DService_inherits(FacilityAnalystSinks3DService, _CommonServiceBase);
  19147. var _super = FacilityAnalystSinks3DService_createSuper(FacilityAnalystSinks3DService);
  19148. function FacilityAnalystSinks3DService(url, options) {
  19149. var _this;
  19150. FacilityAnalystSinks3DService_classCallCheck(this, FacilityAnalystSinks3DService);
  19151. _this = _super.call(this, url, options);
  19152. _this.CLASS_NAME = "SuperMap.FacilityAnalystSinks3DService";
  19153. return _this;
  19154. }
  19155. /**
  19156. * @function SuperMap.FacilityAnalystSinks3DService.prototype.destroy
  19157. * @override
  19158. */
  19159. FacilityAnalystSinks3DService_createClass(FacilityAnalystSinks3DService, [{
  19160. key: "destroy",
  19161. value: function destroy() {
  19162. CommonServiceBase.prototype.destroy.apply(this, arguments);
  19163. }
  19164. /**
  19165. * @function SuperMap.FacilityAnalystSinks3DService.prototype.processAsync
  19166. * @description 负责将客户端的查询参数传递到服务端。
  19167. * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)
  19168. */
  19169. }, {
  19170. key: "processAsync",
  19171. value: function processAsync(params) {
  19172. if (!(params instanceof FacilityAnalystSinks3DParameters)) {
  19173. return;
  19174. }
  19175. var me = this,
  19176. jsonObject;
  19177. me.url = Util.urlPathAppend(me.url, 'sinks');
  19178. jsonObject = {
  19179. edgeID: params.edgeID,
  19180. nodeID: params.nodeID,
  19181. weightName: params.weightName,
  19182. isUncertainDirectionValid: params.isUncertainDirectionValid
  19183. };
  19184. me.request({
  19185. method: "GET",
  19186. params: jsonObject,
  19187. scope: me,
  19188. success: me.serviceProcessCompleted,
  19189. failure: me.serviceProcessFailed
  19190. });
  19191. }
  19192. }]);
  19193. return FacilityAnalystSinks3DService;
  19194. }(CommonServiceBase);
  19195. SuperMap.FacilityAnalystSinks3DService = FacilityAnalystSinks3DService;
  19196. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DParameters.js
  19197. function FacilityAnalystSources3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSources3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSources3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSources3DParameters_typeof(obj); }
  19198. function FacilityAnalystSources3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19199. 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); } }
  19200. function FacilityAnalystSources3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19201. function FacilityAnalystSources3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystSources3DParameters_get(target, property, receiver || target); }
  19202. function FacilityAnalystSources3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19203. 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 } }); if (superClass) FacilityAnalystSources3DParameters_setPrototypeOf(subClass, superClass); }
  19204. function FacilityAnalystSources3DParameters_setPrototypeOf(o, p) { FacilityAnalystSources3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DParameters_setPrototypeOf(o, p); }
  19205. 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); }; }
  19206. function FacilityAnalystSources3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DParameters_assertThisInitialized(self); }
  19207. function FacilityAnalystSources3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19208. function FacilityAnalystSources3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19209. function FacilityAnalystSources3DParameters_getPrototypeOf(o) { FacilityAnalystSources3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DParameters_getPrototypeOf(o); }
  19210. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19211. * This program are made available under the terms of the Apache License, Version 2.0
  19212. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19213. /**
  19214. * @class SuperMap.FacilityAnalystSources3DParameters
  19215. * @category iServer FacilityAnalyst3D Sources
  19216. * @classdesc 最近设施分析参数类(源查找资源)。最近设施分析是指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19217. * 设施点一般为学校、超市、加油站等服务设施;事件点为需要服务设施的事件位置。例如事件发生点是一起交通事故,要求查找在10分钟内能到达的最近医院,超过10分
  19218. * 钟能到达的都不予考虑。此例中,事故发生地即是一个事件点,周边的医院则是设施点。最近设施查找实际上也是一种路径分析,因此对路径分析起作用的障碍边、障碍
  19219. * 点、转向表、耗费等属性在最近设施分析时同样可设置。
  19220. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19221. * @param {Object} options - 参数。
  19222. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19223. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19224. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19225. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19226. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19227. */
  19228. var FacilityAnalystSources3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19229. FacilityAnalystSources3DParameters_inherits(FacilityAnalystSources3DParameters, _FacilityAnalyst3DPar);
  19230. var _super = FacilityAnalystSources3DParameters_createSuper(FacilityAnalystSources3DParameters);
  19231. function FacilityAnalystSources3DParameters(options) {
  19232. var _this;
  19233. FacilityAnalystSources3DParameters_classCallCheck(this, FacilityAnalystSources3DParameters);
  19234. _this = _super.call(this, options);
  19235. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DParameters";
  19236. return _this;
  19237. }
  19238. /**
  19239. * @function SuperMap.FacilityAnalystSources3DParameters.prototype.destroy
  19240. * @override
  19241. */
  19242. FacilityAnalystSources3DParameters_createClass(FacilityAnalystSources3DParameters, [{
  19243. key: "destroy",
  19244. value: function destroy() {
  19245. FacilityAnalystSources3DParameters_get(FacilityAnalystSources3DParameters_getPrototypeOf(FacilityAnalystSources3DParameters.prototype), "destroy", this).call(this);
  19246. }
  19247. }]);
  19248. return FacilityAnalystSources3DParameters;
  19249. }(FacilityAnalyst3DParameters);
  19250. SuperMap.FacilityAnalystSources3DParameters = FacilityAnalystSources3DParameters;
  19251. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystSources3DService.js
  19252. function FacilityAnalystSources3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystSources3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystSources3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystSources3DService_typeof(obj); }
  19253. function FacilityAnalystSources3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19254. 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); } }
  19255. function FacilityAnalystSources3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystSources3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystSources3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19256. function FacilityAnalystSources3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystSources3DService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystSources3DService_get(target, property, receiver || target); }
  19257. function FacilityAnalystSources3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystSources3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  19258. 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 } }); if (superClass) FacilityAnalystSources3DService_setPrototypeOf(subClass, superClass); }
  19259. function FacilityAnalystSources3DService_setPrototypeOf(o, p) { FacilityAnalystSources3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystSources3DService_setPrototypeOf(o, p); }
  19260. 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); }; }
  19261. function FacilityAnalystSources3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystSources3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystSources3DService_assertThisInitialized(self); }
  19262. function FacilityAnalystSources3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19263. function FacilityAnalystSources3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19264. function FacilityAnalystSources3DService_getPrototypeOf(o) { FacilityAnalystSources3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystSources3DService_getPrototypeOf(o); }
  19265. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19266. * This program are made available under the terms of the Apache License, Version 2.0
  19267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19268. /**
  19269. * @class SuperMap.FacilityAnalystSources3DService
  19270. * @category iServer FacilityAnalyst3D Sources
  19271. * @classdesc 最近设施分析服务类(源查找资源)
  19272. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  19273. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  19274. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  19275. * 最近设施分析结果通过该类支持的事件的监听函数参数获取。
  19276. * @extends {SuperMap.CommonServiceBase}
  19277. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19278. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19279. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  19280. * @param {Object} options - 参数。
  19281. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19282. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19283. * @param {Object} [options.headers] - 请求头。
  19284. */
  19285. var FacilityAnalystSources3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19286. FacilityAnalystSources3DService_inherits(FacilityAnalystSources3DService, _CommonServiceBase);
  19287. var _super = FacilityAnalystSources3DService_createSuper(FacilityAnalystSources3DService);
  19288. function FacilityAnalystSources3DService(url, options) {
  19289. var _this;
  19290. FacilityAnalystSources3DService_classCallCheck(this, FacilityAnalystSources3DService);
  19291. _this = _super.call(this, url, options);
  19292. _this.CLASS_NAME = "SuperMap.FacilityAnalystSources3DService";
  19293. return _this;
  19294. }
  19295. /**
  19296. * @function SuperMap.FacilityAnalystSources3DService.prototype.destroy
  19297. * @override
  19298. */
  19299. FacilityAnalystSources3DService_createClass(FacilityAnalystSources3DService, [{
  19300. key: "destroy",
  19301. value: function destroy() {
  19302. FacilityAnalystSources3DService_get(FacilityAnalystSources3DService_getPrototypeOf(FacilityAnalystSources3DService.prototype), "destroy", this).call(this);
  19303. }
  19304. /**
  19305. * @function SuperMap.FacilityAnalystSources3DService.prototype.processAsync
  19306. * @description 负责将客户端的查询参数传递到服务端。
  19307. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找资源)
  19308. */
  19309. }, {
  19310. key: "processAsync",
  19311. value: function processAsync(params) {
  19312. if (!(params instanceof FacilityAnalystSources3DParameters)) {
  19313. return;
  19314. }
  19315. var me = this,
  19316. jsonObject;
  19317. me.url = Util.urlPathAppend(me.url, 'sources');
  19318. jsonObject = {
  19319. edgeID: params.edgeID,
  19320. nodeID: params.nodeID,
  19321. weightName: params.weightName,
  19322. isUncertainDirectionValid: params.isUncertainDirectionValid
  19323. };
  19324. me.request({
  19325. method: "GET",
  19326. params: jsonObject,
  19327. scope: me,
  19328. success: me.serviceProcessCompleted,
  19329. failure: me.serviceProcessFailed
  19330. });
  19331. }
  19332. }]);
  19333. return FacilityAnalystSources3DService;
  19334. }(CommonServiceBase);
  19335. SuperMap.FacilityAnalystSources3DService = FacilityAnalystSources3DService;
  19336. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamParameters.js
  19337. function FacilityAnalystStreamParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19338. 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); } }
  19339. function FacilityAnalystStreamParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19340. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19341. * This program are made available under the terms of the Apache License, Version 2.0
  19342. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19343. /**
  19344. * @class SuperMap.FacilityAnalystStreamParameters
  19345. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  19346. * @classdesc 上游/下游关键设施查找资源参数类。
  19347. * @param {Object} options - 参数。
  19348. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  19349. * @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  19350. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19351. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19352. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
  19353. */
  19354. var FacilityAnalystStreamParameters = /*#__PURE__*/function () {
  19355. function FacilityAnalystStreamParameters(options) {
  19356. FacilityAnalystStreamParameters_classCallCheck(this, FacilityAnalystStreamParameters);
  19357. /**
  19358. * @member {Array.<number>} [SuperMap.FacilityAnalystStreamParameters.prototype.sourceNodeIDs]
  19359. * @description 指定的设施点 ID 数组。
  19360. */
  19361. this.sourceNodeIDs = null;
  19362. /**
  19363. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.edgeID]
  19364. * @description 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19365. */
  19366. this.edgeID = null;
  19367. /**
  19368. * @member {number} [SuperMap.FacilityAnalystStreamParameters.prototype.nodeID]
  19369. * @description 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19370. */
  19371. this.nodeID = null;
  19372. /**
  19373. * @member {boolean} [SuperMap.FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
  19374. * @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19375. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19376. */
  19377. this.isUncertainDirectionValid = false;
  19378. /**
  19379. * @member {number} SuperMap.FacilityAnalystStreamParameters.prototype.queryType
  19380. * @description 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
  19381. */
  19382. this.queryType = null;
  19383. Util.extend(this, options);
  19384. this.CLASS_NAME = "SuperMap.FacilityAnalystStreamParameters";
  19385. }
  19386. /**
  19387. * @function SuperMap.FacilityAnalystStreamParameters.prototype.destroy
  19388. * @description 释放资源,将引用资源的属性置空。
  19389. */
  19390. FacilityAnalystStreamParameters_createClass(FacilityAnalystStreamParameters, [{
  19391. key: "destroy",
  19392. value: function destroy() {
  19393. var me = this;
  19394. me.edgeID = null;
  19395. me.nodeID = null;
  19396. me.weightName = null;
  19397. me.isUncertainDirectionValid = null;
  19398. me.type = null;
  19399. }
  19400. }]);
  19401. return FacilityAnalystStreamParameters;
  19402. }();
  19403. SuperMap.FacilityAnalystStreamParameters = FacilityAnalystStreamParameters;
  19404. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystStreamService.js
  19405. function FacilityAnalystStreamService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystStreamService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystStreamService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystStreamService_typeof(obj); }
  19406. function FacilityAnalystStreamService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19407. 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); } }
  19408. function FacilityAnalystStreamService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystStreamService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystStreamService_defineProperties(Constructor, staticProps); return Constructor; }
  19409. function FacilityAnalystStreamService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystStreamService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystStreamService_get(target, property, receiver || target); }
  19410. function FacilityAnalystStreamService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystStreamService_getPrototypeOf(object); if (object === null) break; } return object; }
  19411. 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 } }); if (superClass) FacilityAnalystStreamService_setPrototypeOf(subClass, superClass); }
  19412. function FacilityAnalystStreamService_setPrototypeOf(o, p) { FacilityAnalystStreamService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystStreamService_setPrototypeOf(o, p); }
  19413. 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); }; }
  19414. function FacilityAnalystStreamService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystStreamService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystStreamService_assertThisInitialized(self); }
  19415. function FacilityAnalystStreamService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19416. function FacilityAnalystStreamService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19417. function FacilityAnalystStreamService_getPrototypeOf(o) { FacilityAnalystStreamService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystStreamService_getPrototypeOf(o); }
  19418. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19419. * This program are made available under the terms of the Apache License, Version 2.0
  19420. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19421. /**
  19422. * @class SuperMap.FacilityAnalystStreamService
  19423. * @category iServer NetworkAnalyst UpstreamCriticalFacilities
  19424. * @classdesc 上游/下游 关键设施查找资源服务类;即查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  19425. * @extends SuperMap.NetworkAnalystServiceBase
  19426. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19427. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19428. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet";
  19429. * @param {Object} options - 参数。
  19430. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19431. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19432. * @param {Object} [options.headers] - 请求头。
  19433. */
  19434. var FacilityAnalystStreamService = /*#__PURE__*/function (_NetworkAnalystServic) {
  19435. FacilityAnalystStreamService_inherits(FacilityAnalystStreamService, _NetworkAnalystServic);
  19436. var _super = FacilityAnalystStreamService_createSuper(FacilityAnalystStreamService);
  19437. function FacilityAnalystStreamService(url, options) {
  19438. var _this;
  19439. FacilityAnalystStreamService_classCallCheck(this, FacilityAnalystStreamService);
  19440. _this = _super.call(this, url, options);
  19441. _this.CLASS_NAME = "SuperMap.FacilityAnalystStreamService";
  19442. return _this;
  19443. }
  19444. /**
  19445. * @function SuperMap.FacilityAnalystStreamService.prototype.destroy
  19446. * @override
  19447. */
  19448. FacilityAnalystStreamService_createClass(FacilityAnalystStreamService, [{
  19449. key: "destroy",
  19450. value: function destroy() {
  19451. FacilityAnalystStreamService_get(FacilityAnalystStreamService_getPrototypeOf(FacilityAnalystStreamService.prototype), "destroy", this).call(this);
  19452. }
  19453. /**
  19454. * @function SuperMap.FacilityAnalystStreamService.prototype.processAsync
  19455. * @description 负责将客户端的查询参数传递到服务端。
  19456. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游关键设施查找资源参数类。
  19457. */
  19458. }, {
  19459. key: "processAsync",
  19460. value: function processAsync(params) {
  19461. if (!(params instanceof FacilityAnalystStreamParameters)) {
  19462. return;
  19463. }
  19464. var me = this,
  19465. jsonObject; //URL 通过参数类型来判断是 上游 还是下游 查询
  19466. if (params.queryType === 0) {
  19467. me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  19468. } else if (params.queryType === 1) {
  19469. me.url = Util.urlPathAppend(me.url, 'downstreamcirticalfaclilities');
  19470. } else {
  19471. return;
  19472. }
  19473. jsonObject = {
  19474. sourceNodeIDs: params.sourceNodeIDs,
  19475. isUncertainDirectionValid: params.isUncertainDirectionValid
  19476. };
  19477. if (params.edgeID !== null && params.nodeID !== null) {
  19478. return;
  19479. }
  19480. if (params.edgeID === null && params.nodeID === null) {
  19481. return;
  19482. }
  19483. if (params.edgeID !== null) {
  19484. jsonObject.edgeID = params.edgeID;
  19485. } else {
  19486. jsonObject.nodeID = params.nodeID;
  19487. }
  19488. me.request({
  19489. method: "GET",
  19490. params: jsonObject,
  19491. scope: me,
  19492. success: me.serviceProcessCompleted,
  19493. failure: me.serviceProcessFailed
  19494. });
  19495. }
  19496. }]);
  19497. return FacilityAnalystStreamService;
  19498. }(NetworkAnalystServiceBase);
  19499. SuperMap.FacilityAnalystStreamService = FacilityAnalystStreamService;
  19500. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DParameters.js
  19501. function FacilityAnalystTracedown3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTracedown3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTracedown3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTracedown3DParameters_typeof(obj); }
  19502. function FacilityAnalystTracedown3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19503. 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); } }
  19504. function FacilityAnalystTracedown3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19505. function FacilityAnalystTracedown3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystTracedown3DParameters_get(target, property, receiver || target); }
  19506. function FacilityAnalystTracedown3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19507. 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 } }); if (superClass) FacilityAnalystTracedown3DParameters_setPrototypeOf(subClass, superClass); }
  19508. function FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p) { FacilityAnalystTracedown3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DParameters_setPrototypeOf(o, p); }
  19509. 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); }; }
  19510. function FacilityAnalystTracedown3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DParameters_assertThisInitialized(self); }
  19511. function FacilityAnalystTracedown3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19512. function FacilityAnalystTracedown3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19513. function FacilityAnalystTracedown3DParameters_getPrototypeOf(o) { FacilityAnalystTracedown3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DParameters_getPrototypeOf(o); }
  19514. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19515. * This program are made available under the terms of the Apache License, Version 2.0
  19516. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19517. /**
  19518. * @class SuperMap.FacilityAnalystTracedown3DParameters
  19519. * @category iServer FacilityAnalyst3D TraceDownResult
  19520. * @classdesc 下游追踪资源参数类。
  19521. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19522. * @param {Object} options - 参数。
  19523. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19524. * @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
  19525. * @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
  19526. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19527. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19528. */
  19529. var FacilityAnalystTracedown3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19530. FacilityAnalystTracedown3DParameters_inherits(FacilityAnalystTracedown3DParameters, _FacilityAnalyst3DPar);
  19531. var _super = FacilityAnalystTracedown3DParameters_createSuper(FacilityAnalystTracedown3DParameters);
  19532. function FacilityAnalystTracedown3DParameters(options) {
  19533. var _this;
  19534. FacilityAnalystTracedown3DParameters_classCallCheck(this, FacilityAnalystTracedown3DParameters);
  19535. _this = _super.call(this, options);
  19536. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DParameters";
  19537. return _this;
  19538. }
  19539. /**
  19540. * @function SuperMap.FacilityAnalystTracedown3DParameters.prototype.destroy
  19541. * @override
  19542. */
  19543. FacilityAnalystTracedown3DParameters_createClass(FacilityAnalystTracedown3DParameters, [{
  19544. key: "destroy",
  19545. value: function destroy() {
  19546. FacilityAnalystTracedown3DParameters_get(FacilityAnalystTracedown3DParameters_getPrototypeOf(FacilityAnalystTracedown3DParameters.prototype), "destroy", this).call(this);
  19547. }
  19548. }]);
  19549. return FacilityAnalystTracedown3DParameters;
  19550. }(FacilityAnalyst3DParameters);
  19551. SuperMap.FacilityAnalystTracedown3DParameters = FacilityAnalystTracedown3DParameters;
  19552. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTracedown3DService.js
  19553. function FacilityAnalystTracedown3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTracedown3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTracedown3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTracedown3DService_typeof(obj); }
  19554. function FacilityAnalystTracedown3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19555. 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); } }
  19556. function FacilityAnalystTracedown3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTracedown3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTracedown3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19557. function FacilityAnalystTracedown3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTracedown3DService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystTracedown3DService_get(target, property, receiver || target); }
  19558. function FacilityAnalystTracedown3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTracedown3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  19559. 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 } }); if (superClass) FacilityAnalystTracedown3DService_setPrototypeOf(subClass, superClass); }
  19560. function FacilityAnalystTracedown3DService_setPrototypeOf(o, p) { FacilityAnalystTracedown3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTracedown3DService_setPrototypeOf(o, p); }
  19561. 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); }; }
  19562. function FacilityAnalystTracedown3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTracedown3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTracedown3DService_assertThisInitialized(self); }
  19563. function FacilityAnalystTracedown3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19564. function FacilityAnalystTracedown3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19565. function FacilityAnalystTracedown3DService_getPrototypeOf(o) { FacilityAnalystTracedown3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTracedown3DService_getPrototypeOf(o); }
  19566. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19567. * This program are made available under the terms of the Apache License, Version 2.0
  19568. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19569. /**
  19570. * @class SuperMap.FacilityAnalystTracedown3DService
  19571. * @category iServer FacilityAnalyst3D TraceDownResult
  19572. * @classdesc 下游追踪资源服务类
  19573. * @extends {SuperMap.CommonServiceBase}
  19574. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19575. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19576. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  19577. * @param {Object} options - 参数。
  19578. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19579. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19580. * @param {Object} [options.headers] - 请求头。
  19581. */
  19582. var FacilityAnalystTracedown3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19583. FacilityAnalystTracedown3DService_inherits(FacilityAnalystTracedown3DService, _CommonServiceBase);
  19584. var _super = FacilityAnalystTracedown3DService_createSuper(FacilityAnalystTracedown3DService);
  19585. function FacilityAnalystTracedown3DService(url, options) {
  19586. var _this;
  19587. FacilityAnalystTracedown3DService_classCallCheck(this, FacilityAnalystTracedown3DService);
  19588. _this = _super.call(this, url, options);
  19589. _this.CLASS_NAME = "SuperMap.FacilityAnalystTracedown3DService";
  19590. return _this;
  19591. }
  19592. /**
  19593. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.destroy
  19594. * @override
  19595. */
  19596. FacilityAnalystTracedown3DService_createClass(FacilityAnalystTracedown3DService, [{
  19597. key: "destroy",
  19598. value: function destroy() {
  19599. FacilityAnalystTracedown3DService_get(FacilityAnalystTracedown3DService_getPrototypeOf(FacilityAnalystTracedown3DService.prototype), "destroy", this).call(this);
  19600. }
  19601. /**
  19602. * @function SuperMap.FacilityAnalystTracedown3DService.prototype.processAsync
  19603. * @description 负责将客户端的查询参数传递到服务端。
  19604. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源参数类。
  19605. */
  19606. }, {
  19607. key: "processAsync",
  19608. value: function processAsync(params) {
  19609. if (!(params instanceof FacilityAnalystTracedown3DParameters)) {
  19610. return;
  19611. }
  19612. var me = this,
  19613. jsonObject;
  19614. me.url = Util.urlPathAppend(me.url, 'tracedownresult');
  19615. jsonObject = {
  19616. edgeID: params.edgeID,
  19617. nodeID: params.nodeID,
  19618. weightName: params.weightName,
  19619. isUncertainDirectionValid: params.isUncertainDirectionValid
  19620. };
  19621. me.request({
  19622. method: "GET",
  19623. params: jsonObject,
  19624. scope: me,
  19625. success: me.serviceProcessCompleted,
  19626. failure: me.serviceProcessFailed
  19627. });
  19628. }
  19629. }]);
  19630. return FacilityAnalystTracedown3DService;
  19631. }(CommonServiceBase);
  19632. SuperMap.FacilityAnalystTracedown3DService = FacilityAnalystTracedown3DService;
  19633. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DParameters.js
  19634. function FacilityAnalystTraceup3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTraceup3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTraceup3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTraceup3DParameters_typeof(obj); }
  19635. function FacilityAnalystTraceup3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19636. 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); } }
  19637. function FacilityAnalystTraceup3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19638. function FacilityAnalystTraceup3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystTraceup3DParameters_get(target, property, receiver || target); }
  19639. function FacilityAnalystTraceup3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19640. 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 } }); if (superClass) FacilityAnalystTraceup3DParameters_setPrototypeOf(subClass, superClass); }
  19641. function FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p) { FacilityAnalystTraceup3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DParameters_setPrototypeOf(o, p); }
  19642. 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); }; }
  19643. function FacilityAnalystTraceup3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DParameters_assertThisInitialized(self); }
  19644. function FacilityAnalystTraceup3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19645. function FacilityAnalystTraceup3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19646. function FacilityAnalystTraceup3DParameters_getPrototypeOf(o) { FacilityAnalystTraceup3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DParameters_getPrototypeOf(o); }
  19647. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19648. * This program are made available under the terms of the Apache License, Version 2.0
  19649. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19650. /**
  19651. * @class SuperMap.FacilityAnalystTraceup3DParameters
  19652. * @category iServer FacilityAnalyst3D TraceUpResult
  19653. * @classdesc 上游追踪资源参数类。
  19654. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19655. * @param {Object} options - 参数。
  19656. * @param {string} options.weightName - 指定的权值字段信息对象的名称。
  19657. * @param {number} [options.edgeID] - 指定的弧段ID,edgeID 与 nodeID 必须指定一个。
  19658. * @param {number} [options.nodeID] - 指定的结点ID,edgeID 与 nodeID 必须指定一个。
  19659. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19660. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19661. */
  19662. var FacilityAnalystTraceup3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19663. FacilityAnalystTraceup3DParameters_inherits(FacilityAnalystTraceup3DParameters, _FacilityAnalyst3DPar);
  19664. var _super = FacilityAnalystTraceup3DParameters_createSuper(FacilityAnalystTraceup3DParameters);
  19665. function FacilityAnalystTraceup3DParameters(options) {
  19666. var _this;
  19667. FacilityAnalystTraceup3DParameters_classCallCheck(this, FacilityAnalystTraceup3DParameters);
  19668. _this = _super.call(this, options);
  19669. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DParameters";
  19670. return _this;
  19671. }
  19672. /**
  19673. * @function SuperMap.FacilityAnalystTraceup3DParameters.prototype.destroy
  19674. * @override
  19675. */
  19676. FacilityAnalystTraceup3DParameters_createClass(FacilityAnalystTraceup3DParameters, [{
  19677. key: "destroy",
  19678. value: function destroy() {
  19679. FacilityAnalystTraceup3DParameters_get(FacilityAnalystTraceup3DParameters_getPrototypeOf(FacilityAnalystTraceup3DParameters.prototype), "destroy", this).call(this);
  19680. }
  19681. }]);
  19682. return FacilityAnalystTraceup3DParameters;
  19683. }(FacilityAnalyst3DParameters);
  19684. SuperMap.FacilityAnalystTraceup3DParameters = FacilityAnalystTraceup3DParameters;
  19685. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystTraceup3DService.js
  19686. function FacilityAnalystTraceup3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystTraceup3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystTraceup3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystTraceup3DService_typeof(obj); }
  19687. function FacilityAnalystTraceup3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19688. 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); } }
  19689. function FacilityAnalystTraceup3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystTraceup3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystTraceup3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19690. function FacilityAnalystTraceup3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystTraceup3DService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystTraceup3DService_get(target, property, receiver || target); }
  19691. function FacilityAnalystTraceup3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystTraceup3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  19692. 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 } }); if (superClass) FacilityAnalystTraceup3DService_setPrototypeOf(subClass, superClass); }
  19693. function FacilityAnalystTraceup3DService_setPrototypeOf(o, p) { FacilityAnalystTraceup3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystTraceup3DService_setPrototypeOf(o, p); }
  19694. 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); }; }
  19695. function FacilityAnalystTraceup3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystTraceup3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystTraceup3DService_assertThisInitialized(self); }
  19696. function FacilityAnalystTraceup3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19697. function FacilityAnalystTraceup3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19698. function FacilityAnalystTraceup3DService_getPrototypeOf(o) { FacilityAnalystTraceup3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystTraceup3DService_getPrototypeOf(o); }
  19699. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19700. * This program are made available under the terms of the Apache License, Version 2.0
  19701. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19702. /**
  19703. * @class SuperMap.FacilityAnalystTraceup3DService
  19704. * @category iServer FacilityAnalyst3D TraceUpResult
  19705. * @classdesc 上游追踪资源服务类
  19706. * @extends {SuperMap.CommonServiceBase}
  19707. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19708. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19709. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  19710. * @param {Object} options - 参数。
  19711. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19712. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19713. * @param {Object} [options.headers] - 请求头。
  19714. */
  19715. var FacilityAnalystTraceup3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19716. FacilityAnalystTraceup3DService_inherits(FacilityAnalystTraceup3DService, _CommonServiceBase);
  19717. var _super = FacilityAnalystTraceup3DService_createSuper(FacilityAnalystTraceup3DService);
  19718. /**
  19719. * @function SuperMap.FacilityAnalystTraceup3DService.constructor
  19720. * @description 上游追踪资源服务类构造函数。
  19721. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19722. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19723. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  19724. * @param {Object} options - 参数。
  19725. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19726. */
  19727. function FacilityAnalystTraceup3DService(url, options) {
  19728. var _this;
  19729. FacilityAnalystTraceup3DService_classCallCheck(this, FacilityAnalystTraceup3DService);
  19730. _this = _super.call(this, url, options);
  19731. _this.CLASS_NAME = "SuperMap.FacilityAnalystTraceup3DService";
  19732. return _this;
  19733. }
  19734. /**
  19735. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.destroy
  19736. * @override
  19737. */
  19738. FacilityAnalystTraceup3DService_createClass(FacilityAnalystTraceup3DService, [{
  19739. key: "destroy",
  19740. value: function destroy() {
  19741. FacilityAnalystTraceup3DService_get(FacilityAnalystTraceup3DService_getPrototypeOf(FacilityAnalystTraceup3DService.prototype), "destroy", this).call(this);
  19742. }
  19743. /**
  19744. * @function SuperMap.FacilityAnalystTraceup3DService.prototype.processAsync
  19745. * @description 负责将客户端的查询参数传递到服务端。
  19746. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类
  19747. */
  19748. }, {
  19749. key: "processAsync",
  19750. value: function processAsync(params) {
  19751. if (!(params instanceof FacilityAnalystTraceup3DParameters)) {
  19752. return;
  19753. }
  19754. var me = this,
  19755. jsonObject;
  19756. me.url = Util.urlPathAppend(me.url, 'traceupresult');
  19757. jsonObject = {
  19758. edgeID: params.edgeID,
  19759. nodeID: params.nodeID,
  19760. weightName: params.weightName,
  19761. isUncertainDirectionValid: params.isUncertainDirectionValid
  19762. };
  19763. me.request({
  19764. method: "GET",
  19765. params: jsonObject,
  19766. scope: me,
  19767. success: me.serviceProcessCompleted,
  19768. failure: me.serviceProcessFailed
  19769. });
  19770. }
  19771. }]);
  19772. return FacilityAnalystTraceup3DService;
  19773. }(CommonServiceBase);
  19774. SuperMap.FacilityAnalystTraceup3DService = FacilityAnalystTraceup3DService;
  19775. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DParameters.js
  19776. function FacilityAnalystUpstream3DParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystUpstream3DParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystUpstream3DParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystUpstream3DParameters_typeof(obj); }
  19777. function FacilityAnalystUpstream3DParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19778. 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); } }
  19779. function FacilityAnalystUpstream3DParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19780. function FacilityAnalystUpstream3DParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystUpstream3DParameters_get(target, property, receiver || target); }
  19781. function FacilityAnalystUpstream3DParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  19782. 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 } }); if (superClass) FacilityAnalystUpstream3DParameters_setPrototypeOf(subClass, superClass); }
  19783. function FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p) { FacilityAnalystUpstream3DParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DParameters_setPrototypeOf(o, p); }
  19784. 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); }; }
  19785. function FacilityAnalystUpstream3DParameters_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DParameters_assertThisInitialized(self); }
  19786. function FacilityAnalystUpstream3DParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19787. function FacilityAnalystUpstream3DParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19788. function FacilityAnalystUpstream3DParameters_getPrototypeOf(o) { FacilityAnalystUpstream3DParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DParameters_getPrototypeOf(o); }
  19789. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19790. * This program are made available under the terms of the Apache License, Version 2.0
  19791. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19792. /**
  19793. * @class SuperMap.FacilityAnalystUpstream3DParameters
  19794. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  19795. * @classdesc 上游关键设施查找资源参数类。
  19796. * @extends {SuperMap.FacilityAnalyst3DParameters}
  19797. * @param {Object} options - 参数。
  19798. * @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
  19799. * @param {number} [options.edgeID] - 指定的弧段ID。edgeID 与 nodeID 必须指定一个。
  19800. * @param {number} [options.nodeID] - 指定的结点ID。edgeID 与 edgeID 必须指定一个。
  19801. * @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
  19802. * 指定为 false,表示不确定流向无效,遇到不确定流向将停止在该方向上继续查找。
  19803. */
  19804. var FacilityAnalystUpstream3DParameters = /*#__PURE__*/function (_FacilityAnalyst3DPar) {
  19805. FacilityAnalystUpstream3DParameters_inherits(FacilityAnalystUpstream3DParameters, _FacilityAnalyst3DPar);
  19806. var _super = FacilityAnalystUpstream3DParameters_createSuper(FacilityAnalystUpstream3DParameters);
  19807. function FacilityAnalystUpstream3DParameters(options) {
  19808. var _this;
  19809. FacilityAnalystUpstream3DParameters_classCallCheck(this, FacilityAnalystUpstream3DParameters);
  19810. _this = _super.call(this, options);
  19811. options = options || {};
  19812. _this.sourceNodeIDs = null;
  19813. Util.extend(FacilityAnalystUpstream3DParameters_assertThisInitialized(_this), options);
  19814. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DParameters";
  19815. return _this;
  19816. }
  19817. /**
  19818. * @function SuperMap.FacilityAnalystUpstream3DParameters.prototype.destroy
  19819. * @override
  19820. */
  19821. FacilityAnalystUpstream3DParameters_createClass(FacilityAnalystUpstream3DParameters, [{
  19822. key: "destroy",
  19823. value: function destroy() {
  19824. FacilityAnalystUpstream3DParameters_get(FacilityAnalystUpstream3DParameters_getPrototypeOf(FacilityAnalystUpstream3DParameters.prototype), "destroy", this).call(this);
  19825. this.sourceNodeIDs = null;
  19826. }
  19827. }]);
  19828. return FacilityAnalystUpstream3DParameters;
  19829. }(FacilityAnalyst3DParameters);
  19830. SuperMap.FacilityAnalystUpstream3DParameters = FacilityAnalystUpstream3DParameters;
  19831. ;// CONCATENATED MODULE: ./src/common/iServer/FacilityAnalystUpstream3DService.js
  19832. function FacilityAnalystUpstream3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FacilityAnalystUpstream3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { FacilityAnalystUpstream3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FacilityAnalystUpstream3DService_typeof(obj); }
  19833. function FacilityAnalystUpstream3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19834. 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); } }
  19835. function FacilityAnalystUpstream3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FacilityAnalystUpstream3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FacilityAnalystUpstream3DService_defineProperties(Constructor, staticProps); return Constructor; }
  19836. function FacilityAnalystUpstream3DService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FacilityAnalystUpstream3DService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FacilityAnalystUpstream3DService_get(target, property, receiver || target); }
  19837. function FacilityAnalystUpstream3DService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FacilityAnalystUpstream3DService_getPrototypeOf(object); if (object === null) break; } return object; }
  19838. 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 } }); if (superClass) FacilityAnalystUpstream3DService_setPrototypeOf(subClass, superClass); }
  19839. function FacilityAnalystUpstream3DService_setPrototypeOf(o, p) { FacilityAnalystUpstream3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FacilityAnalystUpstream3DService_setPrototypeOf(o, p); }
  19840. 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); }; }
  19841. function FacilityAnalystUpstream3DService_possibleConstructorReturn(self, call) { if (call && (FacilityAnalystUpstream3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return FacilityAnalystUpstream3DService_assertThisInitialized(self); }
  19842. function FacilityAnalystUpstream3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19843. function FacilityAnalystUpstream3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19844. function FacilityAnalystUpstream3DService_getPrototypeOf(o) { FacilityAnalystUpstream3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FacilityAnalystUpstream3DService_getPrototypeOf(o); }
  19845. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19846. * This program are made available under the terms of the Apache License, Version 2.0
  19847. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19848. /**
  19849. * @class SuperMap.FacilityAnalystUpstream3DService
  19850. * @category iServer FacilityAnalyst3D UpstreamCriticalFacilities
  19851. * @classdesc 上游关键设施查找资源服务类
  19852. * @extends {SuperMap.CommonServiceBase}
  19853. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  19854. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  19855. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  19856. * @param {Object} options - 参数。
  19857. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  19858. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  19859. * @param {Object} [options.headers] - 请求头。
  19860. */
  19861. var FacilityAnalystUpstream3DService = /*#__PURE__*/function (_CommonServiceBase) {
  19862. FacilityAnalystUpstream3DService_inherits(FacilityAnalystUpstream3DService, _CommonServiceBase);
  19863. var _super = FacilityAnalystUpstream3DService_createSuper(FacilityAnalystUpstream3DService);
  19864. function FacilityAnalystUpstream3DService(url, options) {
  19865. var _this;
  19866. FacilityAnalystUpstream3DService_classCallCheck(this, FacilityAnalystUpstream3DService);
  19867. _this = _super.call(this, url, options);
  19868. _this.CLASS_NAME = "SuperMap.FacilityAnalystUpstream3DService";
  19869. return _this;
  19870. }
  19871. /**
  19872. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.destroy
  19873. * @override
  19874. */
  19875. FacilityAnalystUpstream3DService_createClass(FacilityAnalystUpstream3DService, [{
  19876. key: "destroy",
  19877. value: function destroy() {
  19878. FacilityAnalystUpstream3DService_get(FacilityAnalystUpstream3DService_getPrototypeOf(FacilityAnalystUpstream3DService.prototype), "destroy", this).call(this);
  19879. }
  19880. /**
  19881. * @function SuperMap.FacilityAnalystUpstream3DService.prototype.processAsync
  19882. * @description 负责将客户端的查询参数传递到服务端。
  19883. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找资源参数类
  19884. */
  19885. }, {
  19886. key: "processAsync",
  19887. value: function processAsync(params) {
  19888. if (!(params instanceof FacilityAnalystUpstream3DParameters)) {
  19889. return;
  19890. }
  19891. var me = this,
  19892. jsonObject;
  19893. me.url = Util.urlPathAppend(me.url, 'upstreamcirticalfaclilities');
  19894. jsonObject = {
  19895. sourceNodeIDs: params.sourceNodeIDs,
  19896. edgeID: params.edgeID,
  19897. nodeID: params.nodeID,
  19898. isUncertainDirectionValid: params.isUncertainDirectionValid
  19899. };
  19900. me.request({
  19901. method: "GET",
  19902. params: jsonObject,
  19903. scope: me,
  19904. success: me.serviceProcessCompleted,
  19905. failure: me.serviceProcessFailed
  19906. });
  19907. }
  19908. }]);
  19909. return FacilityAnalystUpstream3DService;
  19910. }(CommonServiceBase);
  19911. SuperMap.FacilityAnalystUpstream3DService = FacilityAnalystUpstream3DService;
  19912. ;// CONCATENATED MODULE: ./src/common/iServer/FilterAggParameter.js
  19913. function FilterAggParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FilterAggParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { FilterAggParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FilterAggParameter_typeof(obj); }
  19914. function FilterAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19915. function FilterAggParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  19916. function FilterAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) FilterAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) FilterAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  19917. function FilterAggParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FilterAggParameter_get = Reflect.get; } else { FilterAggParameter_get = function _get(target, property, receiver) { var base = FilterAggParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return FilterAggParameter_get(target, property, receiver || target); }
  19918. function FilterAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FilterAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  19919. function FilterAggParameter_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 } }); if (superClass) FilterAggParameter_setPrototypeOf(subClass, superClass); }
  19920. function FilterAggParameter_setPrototypeOf(o, p) { FilterAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FilterAggParameter_setPrototypeOf(o, p); }
  19921. function FilterAggParameter_createSuper(Derived) { var hasNativeReflectConstruct = FilterAggParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FilterAggParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FilterAggParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FilterAggParameter_possibleConstructorReturn(this, result); }; }
  19922. function FilterAggParameter_possibleConstructorReturn(self, call) { if (call && (FilterAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return FilterAggParameter_assertThisInitialized(self); }
  19923. function FilterAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  19924. function FilterAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  19925. function FilterAggParameter_getPrototypeOf(o) { FilterAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FilterAggParameter_getPrototypeOf(o); }
  19926. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19927. * This program are made available under the terms of the Apache License, Version 2.0
  19928. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19929. /**
  19930. * @class SuperMap.FilterAggParameter
  19931. * @classdesc 过滤条件参数设置,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  19932. * @category iServer Data FeatureResults
  19933. * @param {Object} options - 初始化参数。
  19934. * @param {SuperMap.AggQueryBuilderParameter} options.filterParam - 过滤条件参数设置类。
  19935. * @param {SuperMap.AggregationType} [options.aggType=AggregationType.FILTER] - 聚合类型。
  19936. */
  19937. var FilterAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  19938. FilterAggParameter_inherits(FilterAggParameter, _AggregationParameter);
  19939. var _super = FilterAggParameter_createSuper(FilterAggParameter);
  19940. function FilterAggParameter(options) {
  19941. var _this;
  19942. FilterAggParameter_classCallCheck(this, FilterAggParameter);
  19943. _this = _super.call(this, options);
  19944. /**
  19945. * @member {SuperMap.AggQueryBuilderParameter} SuperMap.FilterAggParameter.prototype.filterParam
  19946. * @description 过滤条件参数设置类。
  19947. */
  19948. _this.filterParam = null;
  19949. /**
  19950. * @member {SuperMap.AggregationType} [SuperMap.FilterAggParameter.prototype.aggType=AggregationType.FILTER]
  19951. * @description 聚合类型。
  19952. */
  19953. _this.aggType = AggregationType.FILTER;
  19954. _this.CLASS_NAME = "SuperMap.FilterAggParameter";
  19955. Util.extend(FilterAggParameter_assertThisInitialized(_this), options);
  19956. return _this;
  19957. }
  19958. FilterAggParameter_createClass(FilterAggParameter, [{
  19959. key: "destroy",
  19960. value: function destroy() {
  19961. FilterAggParameter_get(FilterAggParameter_getPrototypeOf(FilterAggParameter.prototype), "destroy", this).call(this);
  19962. var me = this;
  19963. if (me.filterParam) {
  19964. me.filterParam = null;
  19965. }
  19966. }
  19967. }]);
  19968. return FilterAggParameter;
  19969. }(AggregationParameter);
  19970. SuperMap.FilterAggParameter = FilterAggParameter;
  19971. ;// CONCATENATED MODULE: ./src/common/iServer/FieldParameters.js
  19972. function FieldParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  19973. 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); } }
  19974. function FieldParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldParameters_defineProperties(Constructor, staticProps); return Constructor; }
  19975. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  19976. * This program are made available under the terms of the Apache License, Version 2.0
  19977. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  19978. /**
  19979. * @class SuperMap.FieldParameters
  19980. * @category iServer Data Field
  19981. * @classdesc 字段信息查询参数类。
  19982. * @param {Object} options - 参数。
  19983. * @param {string} options.datasource - 数据源名称。
  19984. * @param {string} options.dataset - 数据集名称。
  19985. */
  19986. var FieldParameters = /*#__PURE__*/function () {
  19987. function FieldParameters(options) {
  19988. FieldParameters_classCallCheck(this, FieldParameters);
  19989. /**
  19990. * @member {string} SuperMap.FieldParameters.prototype.datasource
  19991. * @description 要查询的数据集所在的数据源名称。
  19992. */
  19993. this.datasource = null;
  19994. /**
  19995. * @member {string} SuperMap.FieldParameters.prototype.dataset
  19996. * @description 要查询的数据集名称。
  19997. */
  19998. this.dataset = null;
  19999. if (options) {
  20000. Util.extend(this, options);
  20001. }
  20002. this.CLASS_NAME = "SuperMap.FieldParameters";
  20003. }
  20004. /**
  20005. * @function SuperMap.FieldParameters.prototype.destroy
  20006. * @description 释放资源,将引用资源的属性置空。
  20007. */
  20008. FieldParameters_createClass(FieldParameters, [{
  20009. key: "destroy",
  20010. value: function destroy() {
  20011. var me = this;
  20012. me.datasource = null;
  20013. me.dataset = null;
  20014. }
  20015. }]);
  20016. return FieldParameters;
  20017. }();
  20018. SuperMap.FieldParameters = FieldParameters;
  20019. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticsParameters.js
  20020. function FieldStatisticsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldStatisticsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldStatisticsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldStatisticsParameters_typeof(obj); }
  20021. function FieldStatisticsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20022. 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); } }
  20023. function FieldStatisticsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20024. 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 } }); if (superClass) FieldStatisticsParameters_setPrototypeOf(subClass, superClass); }
  20025. function FieldStatisticsParameters_setPrototypeOf(o, p) { FieldStatisticsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticsParameters_setPrototypeOf(o, p); }
  20026. 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); }; }
  20027. function FieldStatisticsParameters_possibleConstructorReturn(self, call) { if (call && (FieldStatisticsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticsParameters_assertThisInitialized(self); }
  20028. function FieldStatisticsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20029. function FieldStatisticsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20030. function FieldStatisticsParameters_getPrototypeOf(o) { FieldStatisticsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticsParameters_getPrototypeOf(o); }
  20031. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20032. * This program are made available under the terms of the Apache License, Version 2.0
  20033. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20034. /**
  20035. * @class SuperMap.FieldStatisticsParameters
  20036. * @category iServer Data Field
  20037. * @classdesc 字段统计信息查询参数类。
  20038. * @param {Object} options - 参数。
  20039. * @param {string} options.datasource - 数据源名称。
  20040. * @param {string} options.dataset - 数据集名称。
  20041. * @param {string} options.fieldName - 字段名。
  20042. * @param {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} statisticMode - 字段统计方法类型。
  20043. * @extends {SuperMap.FieldParameters}
  20044. */
  20045. var FieldStatisticsParameters = /*#__PURE__*/function (_FieldParameters) {
  20046. FieldStatisticsParameters_inherits(FieldStatisticsParameters, _FieldParameters);
  20047. var _super = FieldStatisticsParameters_createSuper(FieldStatisticsParameters);
  20048. function FieldStatisticsParameters(options) {
  20049. var _this;
  20050. FieldStatisticsParameters_classCallCheck(this, FieldStatisticsParameters);
  20051. _this = _super.call(this, options);
  20052. /**
  20053. * @member {string} SuperMap.FieldStatisticsParameters.prototype.fieldName
  20054. * @description 字段名
  20055. */
  20056. _this.fieldName = null;
  20057. /**
  20058. * @member {(string.<SuperMap.StatisticMode>|Array.<string.<SuperMap.StatisticMode>>)} SuperMap.FieldStatisticsParameters.prototype.statisticMode
  20059. * @description 字段统计方法类型
  20060. */
  20061. _this.statisticMode = null;
  20062. if (options) {
  20063. Util.extend(FieldStatisticsParameters_assertThisInitialized(_this), options);
  20064. }
  20065. _this.CLASS_NAME = "SuperMap.FieldStatisticsParameters";
  20066. return _this;
  20067. }
  20068. /**
  20069. * @function SuperMap.FieldStatisticsParameters.prototype.destroy
  20070. * @description 释放资源,将引用资源的属性置空。
  20071. */
  20072. FieldStatisticsParameters_createClass(FieldStatisticsParameters, [{
  20073. key: "destroy",
  20074. value: function destroy() {
  20075. var me = this;
  20076. me.fieldName = null;
  20077. me.statisticMode = null;
  20078. }
  20079. }]);
  20080. return FieldStatisticsParameters;
  20081. }(FieldParameters);
  20082. SuperMap.FieldStatisticsParameters = FieldStatisticsParameters;
  20083. ;// CONCATENATED MODULE: ./src/common/iServer/FieldStatisticService.js
  20084. function FieldStatisticService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldStatisticService_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldStatisticService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldStatisticService_typeof(obj); }
  20085. function FieldStatisticService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20086. 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); } }
  20087. function FieldStatisticService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldStatisticService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldStatisticService_defineProperties(Constructor, staticProps); return Constructor; }
  20088. function FieldStatisticService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FieldStatisticService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FieldStatisticService_get(target, property, receiver || target); }
  20089. function FieldStatisticService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FieldStatisticService_getPrototypeOf(object); if (object === null) break; } return object; }
  20090. 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 } }); if (superClass) FieldStatisticService_setPrototypeOf(subClass, superClass); }
  20091. function FieldStatisticService_setPrototypeOf(o, p) { FieldStatisticService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldStatisticService_setPrototypeOf(o, p); }
  20092. 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); }; }
  20093. function FieldStatisticService_possibleConstructorReturn(self, call) { if (call && (FieldStatisticService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldStatisticService_assertThisInitialized(self); }
  20094. function FieldStatisticService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20095. function FieldStatisticService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20096. function FieldStatisticService_getPrototypeOf(o) { FieldStatisticService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldStatisticService_getPrototypeOf(o); }
  20097. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20098. * This program are made available under the terms of the Apache License, Version 2.0
  20099. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20100. /**
  20101. * @class SuperMap.FieldStatisticService
  20102. * @category iServer Data Field
  20103. * @classdesc 字段查询统计服务类。用来完成对指定数据集指定字段的查询统计分析,即求平均值,最大值等。
  20104. * @extends {SuperMap.CommonServiceBase}
  20105. * @param {string} url - 服务的访问地址。如访问 World Map 服务,只需将 url 设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  20106. * @param {Object} options - 参数。
  20107. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  20108. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  20109. * @param {SuperMap.DataFormat} [options.format] - 查询结果返回格式,目前支持 iServerJSON 和GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  20110. * @param {string} options.datasource - 数据集所在的数据源名称。
  20111. * @param {string} options.dataset - 数据集名称。
  20112. * @param {string} options.field - 查询统计的目标字段名称。
  20113. * @param {SuperMap.StatisticMode} options.statisticMode - 字段查询统计的方法类型。
  20114. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20115. * @param {Object} [options.headers] - 请求头。
  20116. * @example
  20117. * var myService = new SuperMap.FieldStatisticService(url, {eventListeners: {
  20118. * "processCompleted": fieldStatisticCompleted,
  20119. * "processFailed": fieldStatisticError
  20120. * },
  20121. * datasource: "World",
  20122. * dataset: "Countries",
  20123. * field: "SmID",
  20124. * statisticMode: StatisticMode.AVERAGE
  20125. * };
  20126. */
  20127. var FieldStatisticService = /*#__PURE__*/function (_CommonServiceBase) {
  20128. FieldStatisticService_inherits(FieldStatisticService, _CommonServiceBase);
  20129. var _super = FieldStatisticService_createSuper(FieldStatisticService);
  20130. function FieldStatisticService(url, options) {
  20131. var _this;
  20132. FieldStatisticService_classCallCheck(this, FieldStatisticService);
  20133. _this = _super.call(this, url, options);
  20134. /**
  20135. * @member {string} SuperMap.FieldStatisticService.prototype.datasource
  20136. * @description 数据集所在的数据源名称。
  20137. */
  20138. _this.datasource = null;
  20139. /**
  20140. * @member {string} SuperMap.FieldStatisticService.prototype.dataset
  20141. * @description 数据集名称。
  20142. */
  20143. _this.dataset = null;
  20144. /**
  20145. * @member {string} SuperMap.FieldStatisticService.prototype.field
  20146. * @description 查询统计的目标字段名称。
  20147. */
  20148. _this.field = null;
  20149. /**
  20150. * @member {SuperMap.StatisticMode} SuperMap.FieldStatisticService.prototype.statisticMode
  20151. * @description 字段查询统计的方法类型。
  20152. */
  20153. _this.statisticMode = null;
  20154. if (options) {
  20155. Util.extend(FieldStatisticService_assertThisInitialized(_this), options);
  20156. }
  20157. _this.CLASS_NAME = "SuperMap.FieldStatisticService";
  20158. return _this;
  20159. }
  20160. /**
  20161. * @function SuperMap.FieldStatisticService.prototype.destroy
  20162. * @override
  20163. */
  20164. FieldStatisticService_createClass(FieldStatisticService, [{
  20165. key: "destroy",
  20166. value: function destroy() {
  20167. FieldStatisticService_get(FieldStatisticService_getPrototypeOf(FieldStatisticService.prototype), "destroy", this).call(this);
  20168. var me = this;
  20169. me.datasource = null;
  20170. me.dataset = null;
  20171. me.field = null;
  20172. me.statisticMode = null;
  20173. }
  20174. /**
  20175. * @function SuperMap.FieldStatisticService.prototype.processAsync
  20176. * @description 执行服务,进行指定字段的查询统计。
  20177. */
  20178. }, {
  20179. key: "processAsync",
  20180. value: function processAsync() {
  20181. var me = this,
  20182. fieldStatisticURL = "datasources/" + me.datasource + "/datasets/" + me.dataset + "/fields/" + me.field + "/" + me.statisticMode;
  20183. me.url = Util.urlPathAppend(me.url, fieldStatisticURL);
  20184. me.request({
  20185. method: "GET",
  20186. data: null,
  20187. scope: me,
  20188. success: me.serviceProcessCompleted,
  20189. failure: me.serviceProcessFailed
  20190. });
  20191. }
  20192. }]);
  20193. return FieldStatisticService;
  20194. }(CommonServiceBase);
  20195. SuperMap.FieldStatisticService = FieldStatisticService;
  20196. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesParameters.js
  20197. function FindClosestFacilitiesParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20198. 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); } }
  20199. function FindClosestFacilitiesParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20200. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20201. * This program are made available under the terms of the Apache License, Version 2.0
  20202. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20203. /**
  20204. * @class SuperMap.FindClosestFacilitiesParameters
  20205. * @category iServer NetworkAnalyst ClosestFacility
  20206. * @classdesc 最近设施分析参数类。
  20207. * @param {Object} options - 参数。
  20208. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} options.event - 事件点,一般为需要获得服务设施服务的事件位置。
  20209. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.facilities - 设施点集合,一般为提供服务的服务设施位置。
  20210. * @param {number} [options.expectFacilityCount=1] - 要查找的设施点数量。
  20211. * @param {boolean} [options.fromEvent=false] - 是否从事件点到设施点进行查找。
  20212. * @param {boolean} [options.isAnalyzeById=false] - 事件点和设施点是否通过节点 ID 号来指定。
  20213. * @param {number} [options.maxWeight=0] - 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  20214. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  20215. */
  20216. var FindClosestFacilitiesParameters = /*#__PURE__*/function () {
  20217. function FindClosestFacilitiesParameters(options) {
  20218. FindClosestFacilitiesParameters_classCallCheck(this, FindClosestFacilitiesParameters);
  20219. /**
  20220. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)} SuperMap.FindClosestFacilitiesParameters.prototype.event
  20221. * @description 事件点,一般为需要获得服务设施服务的事件位置。
  20222. * 可以通过两种方式赋予事件点:当该类中字段 isAnalyzeById = true 时,应输入事件点 ID 号;当 isAnalyzeById = false 时,应输入事件点坐标。
  20223. */
  20224. this.event = null;
  20225. /**
  20226. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.expectFacilityCount=1]
  20227. * @description 要查找的设施点数量。
  20228. */
  20229. this.expectFacilityCount = 1;
  20230. /**
  20231. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} [SuperMap.FindClosestFacilitiesParameters.prototype.facilities=false]
  20232. * @description 设施点集合,一般为提供服务的服务设施位置。
  20233. * 可以通过两种方式赋予设施点:当该类中字段 isAnalyzeById = true 时,应输入设施点 ID 号;当 isAnalyzeById = false 时,应输入设施点坐标。
  20234. */
  20235. this.facilities = null;
  20236. /**
  20237. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.fromEvent=false]
  20238. * @description 是否从事件点到设施点进行查找。最近设施分析主要是通过设施点和事件点之间最优的路线来分析在一定范围内哪个或哪些设施与事件点有最优路线的关系。
  20239. * 这个行走线路是通过网络图层进行网络分析算法计算出来的两点间的最优路线。由于存在从 A 点到 B 点与从 B 点到 A 点的耗费不一样的情况,因此起止点
  20240. * 不同可能会得到不同的最优路线。因此在进行最近设施分析之前,需要设置获取的最优路线的方向,即是以事件点作为起点到最近设施点的方向分析,还是以最
  20241. * 近设施点为起点到事件点的方向分析。如果需要以事件点作为起点到设施点方向进行查找,设置该字段值为 true;设置为 false,表示从设施点到事件点进行查找。
  20242. */
  20243. this.fromEvent = false;
  20244. /**
  20245. * @member {boolean} [SuperMap.FindClosestFacilitiesParameters.prototype.isAnalyzeById=false]
  20246. * @description 事件点和设施点是否通过节点 ID 号来指定,设置为 false,表示通过坐标点指定事件点和设施点。
  20247. */
  20248. this.isAnalyzeById = false;
  20249. /**
  20250. * @member {number} [SuperMap.FindClosestFacilitiesParameters.prototype.maxWeight=0]
  20251. * @description 查找半径。单位与该类中 parameter 字段(交通网络分析通用参数)中设置的耗费字段一致。
  20252. * 例如事件发生点是一起交通事故,要求查找在 10 分钟内能到达的最近医院,超过 10 分钟能到达的都不予考虑。
  20253. * 那么需要将网络分析参数中 parameter.weightFieldName 设置为表示时间的字段,然后设置查找范围的半径值为10。
  20254. */
  20255. this.maxWeight = 0;
  20256. /**
  20257. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindClosestFacilitiesParameters.prototype.parameter]
  20258. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  20259. * 它为 SuperMap.TransportationAnalystParameter 类型,虽然为可选参数,但是如果不设置其中的 resultSetting 字段,
  20260. * 则返回结果空间信息等都为空。
  20261. */
  20262. this.parameter = new TransportationAnalystParameter();
  20263. Util.extend(this, options);
  20264. this.CLASS_NAME = "SuperMap.FindClosestFacilitiesParameters";
  20265. }
  20266. /**
  20267. * @function SuperMap.FindClosestFacilitiesParameters.prototype.destroy
  20268. * @description 释放资源,将引用资源的属性置空。
  20269. */
  20270. FindClosestFacilitiesParameters_createClass(FindClosestFacilitiesParameters, [{
  20271. key: "destroy",
  20272. value: function destroy() {
  20273. var me = this;
  20274. me.event = null;
  20275. me.expectFacilityCount = null;
  20276. me.facilities = null;
  20277. me.fromEvent = null;
  20278. me.isAnalyzeById = null;
  20279. me.maxWeight = null;
  20280. if (me.parameter) {
  20281. me.parameter.destroy();
  20282. me.parameter = null;
  20283. }
  20284. }
  20285. }]);
  20286. return FindClosestFacilitiesParameters;
  20287. }();
  20288. SuperMap.FindClosestFacilitiesParameters = FindClosestFacilitiesParameters;
  20289. ;// CONCATENATED MODULE: ./src/common/iServer/FindClosestFacilitiesService.js
  20290. function FindClosestFacilitiesService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindClosestFacilitiesService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindClosestFacilitiesService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindClosestFacilitiesService_typeof(obj); }
  20291. function FindClosestFacilitiesService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20292. 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); } }
  20293. function FindClosestFacilitiesService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindClosestFacilitiesService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindClosestFacilitiesService_defineProperties(Constructor, staticProps); return Constructor; }
  20294. function FindClosestFacilitiesService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindClosestFacilitiesService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindClosestFacilitiesService_get(target, property, receiver || target); }
  20295. function FindClosestFacilitiesService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindClosestFacilitiesService_getPrototypeOf(object); if (object === null) break; } return object; }
  20296. 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 } }); if (superClass) FindClosestFacilitiesService_setPrototypeOf(subClass, superClass); }
  20297. function FindClosestFacilitiesService_setPrototypeOf(o, p) { FindClosestFacilitiesService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindClosestFacilitiesService_setPrototypeOf(o, p); }
  20298. 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); }; }
  20299. function FindClosestFacilitiesService_possibleConstructorReturn(self, call) { if (call && (FindClosestFacilitiesService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindClosestFacilitiesService_assertThisInitialized(self); }
  20300. function FindClosestFacilitiesService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20301. function FindClosestFacilitiesService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20302. function FindClosestFacilitiesService_getPrototypeOf(o) { FindClosestFacilitiesService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindClosestFacilitiesService_getPrototypeOf(o); }
  20303. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20304. * This program are made available under the terms of the Apache License, Version 2.0
  20305. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20306. /**
  20307. * @class SuperMap.FindClosestFacilitiesService
  20308. * @category iServer NetworkAnalyst ClosestFacility
  20309. * @classdesc 最近设施分析服务类。
  20310. * 最近设施分析是指在网络上给定一个事件点和一组设施点,
  20311. * 查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  20312. * 该类负责将客户端指定的最近设施分析参数传递给服务端,并接收服务端返回的结果数据。
  20313. * 最近设施分析结果通过该类支持的事件的监听函数参数获取
  20314. * @extends {SuperMap.NetworkAnalystServiceBase}
  20315. * @example
  20316. * var myfindClosestFacilitiesService = new SuperMap.FindClosestFacilitiesService(url, {
  20317. * eventListeners: {
  20318. * "processCompleted": findClosestFacilitiesCompleted,
  20319. * "processFailed": findClosestFacilitiesError
  20320. * }
  20321. * });
  20322. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20323. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20324. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20325. * @param {Object} options - 参数。
  20326. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20327. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20328. * @param {Object} [options.headers] - 请求头。
  20329. */
  20330. var FindClosestFacilitiesService = /*#__PURE__*/function (_NetworkAnalystServic) {
  20331. FindClosestFacilitiesService_inherits(FindClosestFacilitiesService, _NetworkAnalystServic);
  20332. var _super = FindClosestFacilitiesService_createSuper(FindClosestFacilitiesService);
  20333. /*
  20334. * @function SuperMap.FindClosestFacilitiesService.prototype.constructor
  20335. * @description 最近设施分析服务类构造函数。
  20336. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20337. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20338. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20339. * @param {Object} options - 选参数。<br>
  20340. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20341. */
  20342. function FindClosestFacilitiesService(url, options) {
  20343. var _this;
  20344. FindClosestFacilitiesService_classCallCheck(this, FindClosestFacilitiesService);
  20345. _this = _super.call(this, url, options);
  20346. _this.CLASS_NAME = "SuperMap.FindClosestFacilitiesService";
  20347. return _this;
  20348. }
  20349. /**
  20350. * @function SuperMap.FindClosestFacilitiesService.prototype.destroy
  20351. * @override
  20352. */
  20353. FindClosestFacilitiesService_createClass(FindClosestFacilitiesService, [{
  20354. key: "destroy",
  20355. value: function destroy() {
  20356. FindClosestFacilitiesService_get(FindClosestFacilitiesService_getPrototypeOf(FindClosestFacilitiesService.prototype), "destroy", this).call(this);
  20357. }
  20358. /**
  20359. * @function SuperMap.FindClosestFacilitiesService.prototype.processAsync
  20360. * @description 负责将客户端的查询参数传递到服务端。
  20361. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类
  20362. */
  20363. }, {
  20364. key: "processAsync",
  20365. value: function processAsync(params) {
  20366. if (!(params instanceof FindClosestFacilitiesParameters)) {
  20367. return;
  20368. }
  20369. var me = this,
  20370. jsonObject;
  20371. me.url = Util.urlPathAppend(me.url, 'closestfacility');
  20372. jsonObject = {
  20373. expectFacilityCount: params.expectFacilityCount,
  20374. fromEvent: params.fromEvent,
  20375. maxWeight: params.maxWeight,
  20376. parameter: Util.toJSON(params.parameter),
  20377. event: Util.toJSON(params.event),
  20378. facilities: me.getJson(params.isAnalyzeById, params.facilities)
  20379. };
  20380. me.request({
  20381. method: "GET",
  20382. params: jsonObject,
  20383. scope: me,
  20384. success: me.serviceProcessCompleted,
  20385. failure: me.serviceProcessFailed
  20386. });
  20387. }
  20388. /**
  20389. * @function SuperMap.FindClosestFacilitiesService.prototype.getJson
  20390. * @description 将对象转化为JSON字符串。
  20391. * @param {boolean} isAnalyzeById - 是否通过ID来分析
  20392. * @param {Array} params - 分析参数数组
  20393. * @returns {Object} 转化后的JSON字符串。
  20394. */
  20395. }, {
  20396. key: "getJson",
  20397. value: function getJson(isAnalyzeById, params) {
  20398. var jsonString = "[",
  20399. len = params ? params.length : 0;
  20400. if (isAnalyzeById === false) {
  20401. for (var i = 0; i < len; i++) {
  20402. if (i > 0) {
  20403. jsonString += ",";
  20404. }
  20405. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  20406. }
  20407. } else if (isAnalyzeById === true) {
  20408. for (var _i = 0; _i < len; _i++) {
  20409. if (_i > 0) {
  20410. jsonString += ",";
  20411. }
  20412. jsonString += params[_i];
  20413. }
  20414. }
  20415. jsonString += ']';
  20416. return jsonString;
  20417. }
  20418. /**
  20419. * @function SuperMap.FindClosestFacilitiesService.prototype.toGeoJSONResult
  20420. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  20421. * @param {Object} result - 服务器返回的结果对象。
  20422. */
  20423. }, {
  20424. key: "toGeoJSONResult",
  20425. value: function toGeoJSONResult(result) {
  20426. if (!result || !result.facilityPathList) {
  20427. return result;
  20428. }
  20429. var geoJSONFormat = new GeoJSON();
  20430. result.facilityPathList.map(function (path) {
  20431. if (path.route) {
  20432. path.route = geoJSONFormat.toGeoJSON(path.route);
  20433. }
  20434. if (path.pathGuideItems) {
  20435. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  20436. }
  20437. if (path.edgeFeatures) {
  20438. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  20439. }
  20440. if (path.nodeFeatures) {
  20441. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  20442. }
  20443. return path;
  20444. });
  20445. return result;
  20446. }
  20447. }]);
  20448. return FindClosestFacilitiesService;
  20449. }(NetworkAnalystServiceBase);
  20450. SuperMap.FindClosestFacilitiesService = FindClosestFacilitiesService;
  20451. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationParameters.js
  20452. function FindLocationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20453. 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); } }
  20454. function FindLocationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20455. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20456. * This program are made available under the terms of the Apache License, Version 2.0
  20457. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20458. /**
  20459. * @class SuperMap.FindLocationParameters
  20460. * @category iServer NetworkAnalyst Location
  20461. * @classdesc 选址分区分析参数类。
  20462. * @param {Object} options - 参数。
  20463. * @param {string} options.turnWeightField - 转向权值字段的名称。
  20464. * @param {string} options.weightName - 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  20465. * @param {Array.<SuperMap.SupplyCenter>} options.supplyCenters - 资源供给中心集合。
  20466. * @param {number} [options.expectedSupplyCenterCount=1] - 期望用于最终设施选址的资源供给中心数量。
  20467. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分配资源。
  20468. */
  20469. var FindLocationParameters = /*#__PURE__*/function () {
  20470. function FindLocationParameters(options) {
  20471. FindLocationParameters_classCallCheck(this, FindLocationParameters);
  20472. /**
  20473. * @member {number} [SuperMap.FindLocationParameters.prototype.expectedSupplyCenterCount=1]
  20474. * @description 期望用于最终设施选址的资源供给中心数量。
  20475. * 当输入值为 0 时,最终设施选址的资源供给中心数量默认为覆盖分析区域内的所需最少的供给中心数。
  20476. */
  20477. this.expectedSupplyCenterCount = null;
  20478. /**
  20479. * @member {boolean} [SuperMap.FindLocationParameters.prototype.isFromCenter=false]
  20480. * @description 是否从中心点开始分配资源。
  20481. * 由于网路数据中的弧段具有正反阻力,即弧段的正向阻力值与其反向阻力值可能不同,
  20482. * 因此,在进行分析时,从资源供给中心开始分配资源到需求点与从需求点向资源供给中心分配这两种分配形式下,所得的分析结果会不同。
  20483. */
  20484. this.isFromCenter = false;
  20485. /**
  20486. * @member {Array.<SuperMap.SupplyCenter>} SuperMap.FindLocationParameters.prototype.supplyCenters
  20487. * @description 资源供给中心集合。
  20488. * 资源供给中心是提供资源和服务的设施,对应于网络结点,
  20489. * 资源供给中心的相关信息包括资源量、最大阻力值、资源供给中心类型,资源供给中心在网络中所处结点的 ID 等,以便在进行选址分区分析时使用。
  20490. */
  20491. this.supplyCenters = null;
  20492. /**
  20493. * @member {string} SuperMap.FindLocationParameters.prototype.turnWeightField
  20494. * @description 转向权值字段的名称。
  20495. */
  20496. this.turnWeightField = null;
  20497. /**
  20498. * @member {string} SuperMap.FindLocationParameters.prototype.weightName
  20499. * @description 阻力字段的名称,标识了进行网络分析时所使用的阻力字段。
  20500. */
  20501. this.weightName = null;
  20502. Util.extend(this, options);
  20503. this.CLASS_NAME = "SuperMap.FindLocationParameters";
  20504. }
  20505. /**
  20506. * @function SuperMap.FindLocationParameters.prototype.destroy
  20507. * @description 释放资源,将引用资源的属性置空。
  20508. */
  20509. FindLocationParameters_createClass(FindLocationParameters, [{
  20510. key: "destroy",
  20511. value: function destroy() {
  20512. var me = this;
  20513. me.expectedSupplyCenterCount = null;
  20514. me.isFromCenter = null;
  20515. me.turnWeightField = null;
  20516. me.weightName = null;
  20517. if (me.supplyCenters) {
  20518. for (var i = 0, supplyCenters = me.supplyCenters, len = supplyCenters.length; i < len; i++) {
  20519. supplyCenters[i].destroy();
  20520. }
  20521. me.supplyCenters = null;
  20522. }
  20523. }
  20524. }]);
  20525. return FindLocationParameters;
  20526. }();
  20527. SuperMap.FindLocationParameters = FindLocationParameters;
  20528. ;// CONCATENATED MODULE: ./src/common/iServer/FindLocationService.js
  20529. function FindLocationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindLocationService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindLocationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindLocationService_typeof(obj); }
  20530. function FindLocationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20531. 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); } }
  20532. function FindLocationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindLocationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindLocationService_defineProperties(Constructor, staticProps); return Constructor; }
  20533. function FindLocationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindLocationService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindLocationService_get(target, property, receiver || target); }
  20534. function FindLocationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindLocationService_getPrototypeOf(object); if (object === null) break; } return object; }
  20535. 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 } }); if (superClass) FindLocationService_setPrototypeOf(subClass, superClass); }
  20536. function FindLocationService_setPrototypeOf(o, p) { FindLocationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindLocationService_setPrototypeOf(o, p); }
  20537. 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); }; }
  20538. function FindLocationService_possibleConstructorReturn(self, call) { if (call && (FindLocationService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindLocationService_assertThisInitialized(self); }
  20539. function FindLocationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20540. function FindLocationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20541. function FindLocationService_getPrototypeOf(o) { FindLocationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindLocationService_getPrototypeOf(o); }
  20542. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20543. * This program are made available under the terms of the Apache License, Version 2.0
  20544. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20545. /**
  20546. * @class SuperMap.FindLocationService
  20547. * @category iServer NetworkAnalyst Location
  20548. * @classdesc 选址分区分析服务类。
  20549. * 选址分区分析是为了确定一个或多个待建设施的最佳或最优位置,使得设施可以用一种最经济有效的方式为需求方提供服务或者商品。
  20550. * 选址分区不仅仅是一个选址过程,还要将需求点的需求分配到相应的新建设施的服务区中,因此称之为选址与分区。
  20551. * 选址分区分析结果通过该类支持的事件的监听函数参数获取
  20552. * @extends {SuperMap.NetworkAnalystServiceBase}
  20553. * @example
  20554. * (start code)
  20555. * var findLocationService = new SuperMap.FindLocationService(url, {
  20556. * eventListeners: {
  20557. * "processCompleted": findLocationCompleted,
  20558. * "processFailed": findLocationError
  20559. * }
  20560. * });
  20561. * (end)
  20562. * @param {string} url - 服务的访问地址。
  20563. * 如 http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  20564. * @param {Object} options - 参数。
  20565. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20566. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20567. * @param {Object} [options.headers] - 请求头。
  20568. */
  20569. var FindLocationService = /*#__PURE__*/function (_NetworkAnalystServic) {
  20570. FindLocationService_inherits(FindLocationService, _NetworkAnalystServic);
  20571. var _super = FindLocationService_createSuper(FindLocationService);
  20572. function FindLocationService(url, options) {
  20573. var _this;
  20574. FindLocationService_classCallCheck(this, FindLocationService);
  20575. _this = _super.call(this, url, options);
  20576. _this.CLASS_NAME = "SuperMap.FindLocationService";
  20577. return _this;
  20578. }
  20579. /**
  20580. * @function SuperMap.FindLocationService.prototype.destroy
  20581. * @override
  20582. */
  20583. FindLocationService_createClass(FindLocationService, [{
  20584. key: "destroy",
  20585. value: function destroy() {
  20586. FindLocationService_get(FindLocationService_getPrototypeOf(FindLocationService.prototype), "destroy", this).call(this);
  20587. }
  20588. /**
  20589. * @function SuperMap.FindLocationService.prototype.processAsync
  20590. * @description 负责将客户端的查询参数传递到服务端。
  20591. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类
  20592. */
  20593. }, {
  20594. key: "processAsync",
  20595. value: function processAsync(params) {
  20596. if (!(params instanceof FindLocationParameters)) {
  20597. return;
  20598. }
  20599. var me = this,
  20600. jsonObject;
  20601. me.url = Util.urlPathAppend(me.url, 'location');
  20602. jsonObject = {
  20603. isFromCenter: params.isFromCenter,
  20604. expectedSupplyCenterCount: params.expectedSupplyCenterCount,
  20605. weightName: params.weightName,
  20606. turnWeightField: params.turnWeightField,
  20607. returnEdgeFeature: true,
  20608. returnEdgeGeometry: true,
  20609. returnNodeFeature: true,
  20610. mapParameter: Util.toJSON(params.mapParameter),
  20611. supplyCenters: me.getCentersJson(params.supplyCenters)
  20612. };
  20613. me.request({
  20614. method: "GET",
  20615. params: jsonObject,
  20616. scope: me,
  20617. success: me.serviceProcessCompleted,
  20618. failure: me.serviceProcessFailed
  20619. });
  20620. }
  20621. /**
  20622. * @function SuperMap.FindLocationService.prototype.getCentersJson
  20623. * @description 将数组对象转化为JSON字符串。
  20624. * @param {Array} params - 需要转换的参数
  20625. * @returns {string} 转化后的JSON字符串。
  20626. */
  20627. }, {
  20628. key: "getCentersJson",
  20629. value: function getCentersJson(params) {
  20630. var json = "[",
  20631. len = params ? params.length : 0;
  20632. for (var i = 0; i < len; i++) {
  20633. if (i > 0) {
  20634. json += ",";
  20635. }
  20636. json += Util.toJSON(params[i]);
  20637. }
  20638. json += "]";
  20639. return json;
  20640. }
  20641. /**
  20642. * @function SuperMap.FindLocationService.prototype.toGeoJSONResult
  20643. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  20644. * @param {Object} result - 服务器返回的结果对象。
  20645. */
  20646. }, {
  20647. key: "toGeoJSONResult",
  20648. value: function toGeoJSONResult(result) {
  20649. if (!result) {
  20650. return null;
  20651. }
  20652. var geoJSONFormat = new GeoJSON();
  20653. if (result.demandResults) {
  20654. result.demandResults = geoJSONFormat.toGeoJSON(result.demandResults);
  20655. }
  20656. if (result.supplyResults) {
  20657. result.supplyResults = geoJSONFormat.toGeoJSON(result.supplyResults);
  20658. }
  20659. return result;
  20660. }
  20661. }]);
  20662. return FindLocationService;
  20663. }(NetworkAnalystServiceBase);
  20664. SuperMap.FindLocationService = FindLocationService;
  20665. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsParameters.js
  20666. function FindMTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20667. 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); } }
  20668. function FindMTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20669. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20670. * This program are made available under the terms of the Apache License, Version 2.0
  20671. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20672. /**
  20673. * @class SuperMap.FindMTSPPathsParameters
  20674. * @category iServer NetworkAnalyst MTSPPath
  20675. * @classdesc 多旅行商分析参数类
  20676. * @param {Object} options - 参数。
  20677. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 配送中心集合。
  20678. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 配送目标集合。
  20679. * @param {boolean} [options.hasLeastTotalCost=false] - 配送模式是否为总花费最小方案。
  20680. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  20681. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  20682. */
  20683. var FindMTSPPathsParameters = /*#__PURE__*/function () {
  20684. function FindMTSPPathsParameters(options) {
  20685. FindMTSPPathsParameters_classCallCheck(this, FindMTSPPathsParameters);
  20686. /**
  20687. * @member SuperMap.FindMTSPPathsParameters.prototype.centers - {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>}
  20688. * @description 配送中心集合。
  20689. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,centers 应为点的坐标数组;
  20690. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,centers 应为点的 ID 数组。
  20691. */
  20692. this.centers = null;
  20693. /**
  20694. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.hasLeastTotalCost=false]
  20695. * @description 配送模式是否为总花费最小方案。
  20696. * 若为 true,则按照总花费最小的模式进行配送,此时可能会出现某几个配送中心点配送的花费较多而其他配送中心点的花费很少的情况。
  20697. * 若为 false,则为局部最优,此方案会控制每个配送中心点的花费,使各个中心点花费相对平均,此时总花费不一定最小。
  20698. */
  20699. this.hasLeastTotalCost = false;
  20700. /**
  20701. * @member {boolean} [SuperMap.FindMTSPPathsParameters.prototype.isAnalyzeById=false]
  20702. * @description 是否通过节点 ID 号来指定配送中心点和配送目的点,即通过坐标点指定。
  20703. */
  20704. this.isAnalyzeById = false;
  20705. /**
  20706. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindMTSPPathsParameters.prototype.nodes
  20707. * @description 配送目标集合。
  20708. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  20709. * 当 SuperMap.FindMTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  20710. */
  20711. this.nodes = null;
  20712. /**
  20713. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindMTSPPathsParameters.prototype.parameter]
  20714. * @description 交通网络分析通用参数。
  20715. * 通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  20716. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting 字段,则返回结果空间信息等都为空。
  20717. */
  20718. this.parameter = new TransportationAnalystParameter();
  20719. Util.extend(this, options);
  20720. this.CLASS_NAME = "SuperMap.FindMTSPPathsParameters";
  20721. }
  20722. /**
  20723. * @function SuperMap.FindMTSPPathsParameters.prototype.destroy
  20724. * @description 释放资源,将引用资源的属性置空。
  20725. */
  20726. FindMTSPPathsParameters_createClass(FindMTSPPathsParameters, [{
  20727. key: "destroy",
  20728. value: function destroy() {
  20729. var me = this;
  20730. me.centers = null;
  20731. me.hasLeastTotalCost = null;
  20732. me.isAnalyzeById = null;
  20733. me.nodes = null;
  20734. me.maxWeight = null;
  20735. if (me.parameter) {
  20736. me.parameter.destroy();
  20737. me.parameter = null;
  20738. }
  20739. }
  20740. }]);
  20741. return FindMTSPPathsParameters;
  20742. }();
  20743. SuperMap.FindMTSPPathsParameters = FindMTSPPathsParameters;
  20744. ;// CONCATENATED MODULE: ./src/common/iServer/FindMTSPPathsService.js
  20745. function FindMTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindMTSPPathsService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindMTSPPathsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindMTSPPathsService_typeof(obj); }
  20746. function FindMTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20747. 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); } }
  20748. function FindMTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindMTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindMTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  20749. function FindMTSPPathsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindMTSPPathsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindMTSPPathsService_get(target, property, receiver || target); }
  20750. function FindMTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindMTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  20751. 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 } }); if (superClass) FindMTSPPathsService_setPrototypeOf(subClass, superClass); }
  20752. function FindMTSPPathsService_setPrototypeOf(o, p) { FindMTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindMTSPPathsService_setPrototypeOf(o, p); }
  20753. 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); }; }
  20754. function FindMTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindMTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindMTSPPathsService_assertThisInitialized(self); }
  20755. function FindMTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20756. function FindMTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20757. function FindMTSPPathsService_getPrototypeOf(o) { FindMTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindMTSPPathsService_getPrototypeOf(o); }
  20758. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20759. * This program are made available under the terms of the Apache License, Version 2.0
  20760. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20761. /**
  20762. * @class SuperMap.FindMTSPPathsService
  20763. * @category iServer NetworkAnalyst MTSPPath
  20764. * @classdesc 多旅行商分析服务类
  20765. * 多旅行商分析也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。
  20766. * 查找经济有效的配送路径,并给出相应的行走路线。
  20767. * 物流配送功能就是解决如何合理分配配送次序和送货路线,使配送总花费达到最小或每个配送中心的花费达到最小。
  20768. * 该类负责将客户端指定的多旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  20769. * 多旅行商分析结果通过该类支持的事件的监听函数参数获取
  20770. * @extends {SuperMap.NetworkAnalystServiceBase}
  20771. * @example
  20772. * var myFindMTSPPathsService = new SuperMap.FindMTSPPathsService(url, {
  20773. * eventListeners: {
  20774. * "processCompleted": findMTSPPathsCompleted,
  20775. * "processFailed": findMTSPPathsError
  20776. * }
  20777. * });
  20778. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  20779. * http://{服务器地址}:{服务端口号}/iserver/services/网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  20780. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  20781. * @param {Object} options - 互服务时所需可选参数。如:
  20782. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  20783. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  20784. * @param {Object} [options.headers] - 请求头。
  20785. */
  20786. var FindMTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  20787. FindMTSPPathsService_inherits(FindMTSPPathsService, _NetworkAnalystServic);
  20788. var _super = FindMTSPPathsService_createSuper(FindMTSPPathsService);
  20789. function FindMTSPPathsService(url, options) {
  20790. var _this;
  20791. FindMTSPPathsService_classCallCheck(this, FindMTSPPathsService);
  20792. _this = _super.call(this, url, options);
  20793. _this.CLASS_NAME = "SuperMap.FindMTSPPathsService";
  20794. return _this;
  20795. }
  20796. /**
  20797. * @function SuperMap.FindMTSPPathsService.prototype.destroy
  20798. * @override
  20799. */
  20800. FindMTSPPathsService_createClass(FindMTSPPathsService, [{
  20801. key: "destroy",
  20802. value: function destroy() {
  20803. FindMTSPPathsService_get(FindMTSPPathsService_getPrototypeOf(FindMTSPPathsService.prototype), "destroy", this).call(this);
  20804. }
  20805. /**
  20806. * @function SuperMap.FindMTSPPathsService..prototype.processAsync
  20807. * @description 负责将客户端的查询参数传递到服务端。
  20808. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类
  20809. */
  20810. }, {
  20811. key: "processAsync",
  20812. value: function processAsync(params) {
  20813. if (!(params instanceof FindMTSPPathsParameters)) {
  20814. return;
  20815. }
  20816. var me = this,
  20817. jsonObject,
  20818. //end = me.url.substr(me.url.length - 1, 1),
  20819. centers = me.getJson(params.isAnalyzeById, params.centers),
  20820. nodes = me.getJson(params.isAnalyzeById, params.nodes);
  20821. me.url = Util.urlPathAppend(me.url, 'mtsppath');
  20822. jsonObject = {
  20823. centers: centers,
  20824. nodes: nodes,
  20825. parameter: Util.toJSON(params.parameter),
  20826. hasLeastTotalCost: params.hasLeastTotalCost
  20827. };
  20828. me.request({
  20829. method: "GET",
  20830. params: jsonObject,
  20831. scope: me,
  20832. success: me.serviceProcessCompleted,
  20833. failure: me.serviceProcessFailed
  20834. });
  20835. }
  20836. /**
  20837. * @function SuperMap.FindMTSPPathsService.prototype.getJson
  20838. * @description 将对象转化为JSON字符串。
  20839. * @param {boolean} isAnalyzeById - 是否通过id分析
  20840. * @param {Array} params - 需要转换的数字
  20841. * @returns {Object} 转化后的JSON字符串。
  20842. */
  20843. }, {
  20844. key: "getJson",
  20845. value: function getJson(isAnalyzeById, params) {
  20846. var jsonString = "[",
  20847. len = params ? params.length : 0;
  20848. if (isAnalyzeById === false) {
  20849. for (var i = 0; i < len; i++) {
  20850. if (i > 0) {
  20851. jsonString += ",";
  20852. }
  20853. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  20854. }
  20855. } else if (isAnalyzeById === true) {
  20856. for (var _i = 0; _i < len; _i++) {
  20857. if (_i > 0) {
  20858. jsonString += ",";
  20859. }
  20860. jsonString += params[_i];
  20861. }
  20862. }
  20863. jsonString += ']';
  20864. return jsonString;
  20865. }
  20866. /**
  20867. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  20868. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  20869. * @param {Object} result - 服务器返回的结果对象。
  20870. */
  20871. }, {
  20872. key: "toGeoJSONResult",
  20873. value: function toGeoJSONResult(result) {
  20874. if (!result || !result.pathList) {
  20875. return null;
  20876. }
  20877. var geoJSONFormat = new GeoJSON();
  20878. result.pathList.map(function (path) {
  20879. if (path.route) {
  20880. path.route = geoJSONFormat.toGeoJSON(path.route);
  20881. }
  20882. if (path.pathGuideItems) {
  20883. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  20884. }
  20885. if (path.edgeFeatures) {
  20886. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  20887. }
  20888. if (path.nodeFeatures) {
  20889. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  20890. }
  20891. return path;
  20892. });
  20893. return result;
  20894. }
  20895. }]);
  20896. return FindMTSPPathsService;
  20897. }(NetworkAnalystServiceBase);
  20898. SuperMap.FindMTSPPathsService = FindMTSPPathsService;
  20899. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathParameters.js
  20900. function FindPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20901. 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); } }
  20902. function FindPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  20903. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20904. * This program are made available under the terms of the Apache License, Version 2.0
  20905. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20906. /**
  20907. * @class SuperMap.FindPathParameters
  20908. * @category iServer NetworkAnalyst Path
  20909. * @classdesc 最佳路径分析参数类。最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。
  20910. * 例如如果要顺序访问 1、2、3、4 四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4 结点间的最佳路径 R3—4,
  20911. * 顺序访问 1、2、3、4 四个结点的最佳路径就是 R = R1—2 + R2—3 + R3—4。
  20912. * 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。
  20913. * 阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。
  20914. * 阻抗值通过 SuperMap.TransportationAnalystParameter.weightFieldName 设置。
  20915. * 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 {@link SuperMap.TransportationAnalystParameter.turnWeightField} 设置。
  20916. *
  20917. * @param {Object} options - 参数。
  20918. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.nodes - 最佳路径分析经过的结点或设施点数组。该字段至少包含两个点。
  20919. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  20920. * @param {boolean} [options.hasLeastEdgeCount=false] - 是否按照弧段数最少的进行最佳路径分析。
  20921. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  20922. */
  20923. var FindPathParameters = /*#__PURE__*/function () {
  20924. function FindPathParameters(options) {
  20925. FindPathParameters_classCallCheck(this, FindPathParameters);
  20926. /**
  20927. * @member {boolean} [SuperMap.FindPathParameters.prototype.isAnalyzeById=false]
  20928. * @description 是否通过节点 ID 指定路径分析的结点。
  20929. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  20930. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindPathParameters.nodes = [ID1,ID2,...];
  20931. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindPathParameters.nodes = [{x1,y1},{x2,y2},...] 。
  20932. */
  20933. this.isAnalyzeById = false;
  20934. /**
  20935. * @member {boolean} [SuperMap.FindPathParameters.prototype.hasLeastEdgeCount=false]
  20936. * @description 是否按照弧段数最少的进行最佳路径分析。
  20937. * true 表示按照弧段数最少进行分析,返回弧段数最少的路径中一个阻抗最小的最佳路径;
  20938. * false 表示直接返回阻抗最小的路径,而不考虑弧段的多少。
  20939. */
  20940. this.hasLeastEdgeCount = null;
  20941. /**
  20942. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindPathParameters.prototype.nodes
  20943. * @description 最佳路径分析经过的结点或设施点数组,必设字段。该字段至少包含两个点。
  20944. * 当 SuperMap.FindPathParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  20945. * 当 SuperMap.FindPathParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  20946. */
  20947. this.nodes = null;
  20948. /**
  20949. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindPathParameters.prototype.parameter
  20950. * @description 交通网络分析通用参数。
  20951. */
  20952. this.parameter = new TransportationAnalystParameter();
  20953. Util.extend(this, options);
  20954. this.CLASS_NAME = "SuperMap.FindPathParameters";
  20955. }
  20956. /**
  20957. * @function SuperMap.FindPathParameters.prototype.destroy
  20958. * @description 释放资源,将引用资源的属性置空。
  20959. */
  20960. FindPathParameters_createClass(FindPathParameters, [{
  20961. key: "destroy",
  20962. value: function destroy() {
  20963. var me = this;
  20964. me.isAnalyzeById = null;
  20965. me.hasLeastEdgeCount = null;
  20966. me.nodes = null;
  20967. if (me.parameter) {
  20968. me.parameter.destroy();
  20969. me.parameter = null;
  20970. }
  20971. }
  20972. }]);
  20973. return FindPathParameters;
  20974. }();
  20975. SuperMap.FindPathParameters = FindPathParameters;
  20976. ;// CONCATENATED MODULE: ./src/common/iServer/FindPathService.js
  20977. function FindPathService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindPathService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindPathService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindPathService_typeof(obj); }
  20978. function FindPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20979. 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); } }
  20980. function FindPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindPathService_defineProperties(Constructor, staticProps); return Constructor; }
  20981. function FindPathService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindPathService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindPathService_get(target, property, receiver || target); }
  20982. function FindPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  20983. 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 } }); if (superClass) FindPathService_setPrototypeOf(subClass, superClass); }
  20984. function FindPathService_setPrototypeOf(o, p) { FindPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindPathService_setPrototypeOf(o, p); }
  20985. 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); }; }
  20986. function FindPathService_possibleConstructorReturn(self, call) { if (call && (FindPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindPathService_assertThisInitialized(self); }
  20987. function FindPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  20988. function FindPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  20989. function FindPathService_getPrototypeOf(o) { FindPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindPathService_getPrototypeOf(o); }
  20990. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  20991. * This program are made available under the terms of the Apache License, Version 2.0
  20992. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  20993. /**
  20994. * @class SuperMap.FindPathService
  20995. * @category iServer NetworkAnalyst Path
  20996. * @classdesc 最佳路径分析服务类。
  20997. * 最佳路径是在网络数据集中指定一些节点,按照节点的选择顺序,
  20998. * 顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  20999. * 该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据。
  21000. * 最佳路径分析结果通过该类支持的事件的监听函数参数获取
  21001. * @extends {SuperMap.NetworkAnalystServiceBase}
  21002. * @example
  21003. * var myFindPathService = new SuperMap.FindPathService(url, {
  21004. * eventListeners: {
  21005. * "processCompleted": findPathCompleted,
  21006. * "processFailed": findPathError
  21007. * }
  21008. * });
  21009. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21010. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21011. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21012. * @param {Object} options - 参数。
  21013. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21014. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21015. * @param {Object} [options.headers] - 请求头。
  21016. */
  21017. var FindPathService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21018. FindPathService_inherits(FindPathService, _NetworkAnalystServic);
  21019. var _super = FindPathService_createSuper(FindPathService);
  21020. function FindPathService(url, options) {
  21021. var _this;
  21022. FindPathService_classCallCheck(this, FindPathService);
  21023. _this = _super.call(this, url, options);
  21024. _this.CLASS_NAME = "SuperMap.FindPathService";
  21025. return _this;
  21026. }
  21027. /**
  21028. * @function SuperMap.FindPathService.prototype.destroy
  21029. * @override
  21030. */
  21031. FindPathService_createClass(FindPathService, [{
  21032. key: "destroy",
  21033. value: function destroy() {
  21034. FindPathService_get(FindPathService_getPrototypeOf(FindPathService.prototype), "destroy", this).call(this);
  21035. }
  21036. /**
  21037. * @function SuperMap.FindPathService.prototype.processAsync
  21038. * @description 负责将客户端的查询参数传递到服务端。
  21039. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类
  21040. */
  21041. }, {
  21042. key: "processAsync",
  21043. value: function processAsync(params) {
  21044. if (!(params instanceof FindPathParameters)) {
  21045. return;
  21046. }
  21047. var me = this,
  21048. jsonObject;
  21049. me.url = Util.urlPathAppend(me.url, 'path');
  21050. jsonObject = {
  21051. hasLeastEdgeCount: params.hasLeastEdgeCount,
  21052. parameter: Util.toJSON(params.parameter),
  21053. nodes: me.getJson(params.isAnalyzeById, params.nodes)
  21054. };
  21055. me.request({
  21056. method: "GET",
  21057. params: jsonObject,
  21058. scope: me,
  21059. success: me.serviceProcessCompleted,
  21060. failure: me.serviceProcessFailed
  21061. });
  21062. }
  21063. /**
  21064. * @function SuperMap.FindPathService.prototype.getJson
  21065. * @description 将对象转化为JSON字符串。
  21066. * @param {boolean} isAnalyzeById - 是否通过id分析
  21067. * @param {Array} params - 需要转换的数字
  21068. * @returns {Object} 转化后的JSON字符串。
  21069. */
  21070. }, {
  21071. key: "getJson",
  21072. value: function getJson(isAnalyzeById, params) {
  21073. var jsonString = "[",
  21074. len = params ? params.length : 0;
  21075. if (isAnalyzeById === false) {
  21076. for (var i = 0; i < len; i++) {
  21077. if (i > 0) {
  21078. jsonString += ",";
  21079. }
  21080. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  21081. }
  21082. } else if (isAnalyzeById === true) {
  21083. for (var _i = 0; _i < len; _i++) {
  21084. if (_i > 0) {
  21085. jsonString += ",";
  21086. }
  21087. jsonString += params[_i];
  21088. }
  21089. }
  21090. jsonString += ']';
  21091. return jsonString;
  21092. }
  21093. /**
  21094. * @function SuperMap.FindMTSPPathsService.prototype.toGeoJSONResult
  21095. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21096. * @param {Object} result - 服务器返回的结果对象。
  21097. */
  21098. }, {
  21099. key: "toGeoJSONResult",
  21100. value: function toGeoJSONResult(result) {
  21101. if (!result || !result.pathList || result.pathList.length < 1) {
  21102. return null;
  21103. }
  21104. var geoJSONFormat = new GeoJSON();
  21105. result.pathList.forEach(function (path) {
  21106. if (path.route) {
  21107. path.route = geoJSONFormat.toGeoJSON(path.route);
  21108. }
  21109. if (path.pathGuideItems) {
  21110. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  21111. }
  21112. if (path.edgeFeatures) {
  21113. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  21114. }
  21115. if (path.nodeFeatures) {
  21116. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  21117. }
  21118. });
  21119. return result;
  21120. }
  21121. }]);
  21122. return FindPathService;
  21123. }(NetworkAnalystServiceBase);
  21124. SuperMap.FindPathService = FindPathService;
  21125. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasParameters.js
  21126. function FindServiceAreasParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21127. 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); } }
  21128. function FindServiceAreasParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21129. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21130. * This program are made available under the terms of the Apache License, Version 2.0
  21131. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21132. /**
  21133. * @class SuperMap.FindServiceAreasParameters
  21134. * @category iServer NetworkAnalyst ServiceArea
  21135. * @classdesc 服务区分析参数类。
  21136. * 服务区分析是以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  21137. * 例如:计算某快餐店能够在30分钟内送达快餐的区域。
  21138. * @param {Object} options - 参数。
  21139. * @param {Array.<number>} options.weights - 每个服务站点提供服务的阻力半径,超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  21140. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} options.centers - 服务站点数组。
  21141. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 指定路径分析的结点。
  21142. * @param {boolean} [options.isCenterMutuallyExclusive=false] - 是否中心点互斥。
  21143. * @param {boolean} [options.isFromCenter=false] - 是否从中心点开始分析。
  21144. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21145. */
  21146. var FindServiceAreasParameters = /*#__PURE__*/function () {
  21147. function FindServiceAreasParameters(options) {
  21148. FindServiceAreasParameters_classCallCheck(this, FindServiceAreasParameters);
  21149. /**
  21150. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isAnalyzeById=false]
  21151. * @description 是否通过节点 ID 指定路径分析的结点。
  21152. * 指定路径分析经过的结点或设施点有两种方式:输入结点 ID 号或直接输入点坐标。
  21153. * 当该字段为 true 时,表示通过结点 ID 指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [ID1,ID2,...];
  21154. * 反之表示通过结点坐标指定途经点,即 SuperMap.FindServiceAreasParameters.centers = [{x1,y1},{x2,y2},...]。
  21155. */
  21156. this.isAnalyzeById = false;
  21157. /**
  21158. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isCenterMutuallyExclusive=false]
  21159. * @description 是否中心点互斥,即按照中心点的距离进行判断是否要进行互斥处理。
  21160. * 若分析出的服务区有重叠的部分,则通过设置该参数进行互斥处理。
  21161. */
  21162. this.isCenterMutuallyExclusive = false;
  21163. /**
  21164. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindServiceAreasParameters.prototype.centers
  21165. * @description 服务站点数组。
  21166. * 当该类的 iSAnalyzeById = true 时,通过结点 ID 号指定服务站点;当 iSAnalyzeById = false 时,通过点坐标指定服务站点。
  21167. */
  21168. this.centers = null;
  21169. /**
  21170. * @member {boolean} [SuperMap.FindServiceAreasParameters.prototype.isFromCenter=false]
  21171. * @description 是否从中心点开始分析。
  21172. * 从中心点开始分析和不从中心点开始分析,体现了服务中心和需要该服务的需求地的关系模式。
  21173. * 从中心点开始分析,是一个服务中心向服务需求地提供服务;
  21174. * 而不从中心点开始分析,是一个服务需求地主动到服务中心获得服务。
  21175. */
  21176. this.isFromCenter = false;
  21177. /**
  21178. * APIProperty: weights
  21179. * @member {Array.<number>} SuperMap.FindServiceAreasParameters.prototype.weights
  21180. * @description 每个服务站点提供服务的阻力半径,即超过这个阻力半径的区域不予考虑,其单位与阻力字段一致。
  21181. * 该字段为一个数组,数组长度跟服务中心个数一致,按照索引顺序与站点一一对应,每个元素表示了在对每个服务中心进行服务区分析时,所用的服务半径。
  21182. */
  21183. this.weights = null;
  21184. /**
  21185. * @member {SuperMap.TransportationAnalystParameter} SuperMap.FindServiceAreasParameters.prototype.parameter
  21186. * @description 交通网络分析通用参数。
  21187. */
  21188. this.parameter = new TransportationAnalystParameter();
  21189. Util.extend(this, options);
  21190. this.CLASS_NAME = "SuperMap.FindServiceAreasParameters";
  21191. }
  21192. /**
  21193. * @function SuperMap.FindServiceAreasParameters.prototype.destroy
  21194. * @description 释放资源,将引用资源的属性置空。
  21195. */
  21196. FindServiceAreasParameters_createClass(FindServiceAreasParameters, [{
  21197. key: "destroy",
  21198. value: function destroy() {
  21199. var me = this;
  21200. me.isAnalyzeById = null;
  21201. me.isCenterMutuallyExclusive = null;
  21202. me.centers = null;
  21203. me.isFromCenter = null;
  21204. me.weights = null;
  21205. if (me.parameter) {
  21206. me.parameter.destroy();
  21207. me.parameter = null;
  21208. }
  21209. }
  21210. }]);
  21211. return FindServiceAreasParameters;
  21212. }();
  21213. SuperMap.FindServiceAreasParameters = FindServiceAreasParameters;
  21214. ;// CONCATENATED MODULE: ./src/common/iServer/FindServiceAreasService.js
  21215. function FindServiceAreasService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindServiceAreasService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindServiceAreasService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindServiceAreasService_typeof(obj); }
  21216. function FindServiceAreasService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21217. 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); } }
  21218. function FindServiceAreasService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindServiceAreasService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindServiceAreasService_defineProperties(Constructor, staticProps); return Constructor; }
  21219. function FindServiceAreasService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindServiceAreasService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindServiceAreasService_get(target, property, receiver || target); }
  21220. function FindServiceAreasService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindServiceAreasService_getPrototypeOf(object); if (object === null) break; } return object; }
  21221. 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 } }); if (superClass) FindServiceAreasService_setPrototypeOf(subClass, superClass); }
  21222. function FindServiceAreasService_setPrototypeOf(o, p) { FindServiceAreasService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindServiceAreasService_setPrototypeOf(o, p); }
  21223. 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); }; }
  21224. function FindServiceAreasService_possibleConstructorReturn(self, call) { if (call && (FindServiceAreasService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindServiceAreasService_assertThisInitialized(self); }
  21225. function FindServiceAreasService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21226. function FindServiceAreasService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21227. function FindServiceAreasService_getPrototypeOf(o) { FindServiceAreasService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindServiceAreasService_getPrototypeOf(o); }
  21228. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21229. * This program are made available under the terms of the Apache License, Version 2.0
  21230. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21231. /**
  21232. * @class SuperMap.FindServiceAreasService
  21233. * @category iServer NetworkAnalyst ServiceArea
  21234. * @classdesc 服务区分析服务类。
  21235. * 服务区分析是以指定服务站点为中心,
  21236. * 在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  21237. * 该类负责将客户端指定的服务区分析参数传递给服务端,并接收服务端返回的结果数据。
  21238. * 服务区分析结果通过该类支持的事件的监听函数参数获取
  21239. * @extends {SuperMap.NetworkAnalystServiceBase}
  21240. * @example
  21241. * var myFindServiceAreasService = new SuperMap.FindServiceAreasService(url, {
  21242. * eventListeners: {
  21243. * "processCompleted": findServiceAreasCompleted,
  21244. * "processFailed": findServiceAreasError
  21245. * }
  21246. * });
  21247. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21248. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21249. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21250. * @param {Object} options - 互服务时所需可选参数。如:
  21251. * @param {Object} options.eventListeners - 需要被注册的监听器对象
  21252. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21253. * @param {Object} [options.headers] - 请求头。
  21254. */
  21255. var FindServiceAreasService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21256. FindServiceAreasService_inherits(FindServiceAreasService, _NetworkAnalystServic);
  21257. var _super = FindServiceAreasService_createSuper(FindServiceAreasService);
  21258. function FindServiceAreasService(url, options) {
  21259. var _this;
  21260. FindServiceAreasService_classCallCheck(this, FindServiceAreasService);
  21261. _this = _super.call(this, url, options);
  21262. _this.CLASS_NAME = "SuperMap.FindServiceAreasService";
  21263. return _this;
  21264. }
  21265. /**
  21266. * @function SuperMap.FindServiceAreasService.prototype.destroy
  21267. * @override
  21268. */
  21269. FindServiceAreasService_createClass(FindServiceAreasService, [{
  21270. key: "destroy",
  21271. value: function destroy() {
  21272. FindServiceAreasService_get(FindServiceAreasService_getPrototypeOf(FindServiceAreasService.prototype), "destroy", this).call(this);
  21273. }
  21274. /**
  21275. * @function SuperMap.FindServiceAreasService.prototype.processAsync
  21276. * @description 负责将客户端的查询参数传递到服务端。
  21277. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类
  21278. */
  21279. }, {
  21280. key: "processAsync",
  21281. value: function processAsync(params) {
  21282. if (!(params instanceof FindServiceAreasParameters)) {
  21283. return;
  21284. }
  21285. var me = this,
  21286. jsonObject;
  21287. me.url = Util.urlPathAppend(me.url, 'servicearea');
  21288. jsonObject = {
  21289. isFromCenter: params.isFromCenter,
  21290. isCenterMutuallyExclusive: params.isCenterMutuallyExclusive,
  21291. parameter: Util.toJSON(params.parameter),
  21292. centers: me.getJson(params.isAnalyzeById, params.centers),
  21293. weights: me.getJson(true, params.weights)
  21294. };
  21295. me.request({
  21296. method: "GET",
  21297. params: jsonObject,
  21298. scope: me,
  21299. success: me.serviceProcessCompleted,
  21300. failure: me.serviceProcessFailed
  21301. });
  21302. }
  21303. /**
  21304. * @function SuperMap.FindServiceAreasService.prototype.getJson
  21305. * @description 将对象转化为JSON字符串。
  21306. * @param {boolean} isAnalyzeById - 是否通过id分析
  21307. * @param {Array} params - 需要转换的数字
  21308. * @returns {Object} 转化后的JSON字符串。
  21309. */
  21310. }, {
  21311. key: "getJson",
  21312. value: function getJson(isAnalyzeById, params) {
  21313. var jsonString = "[",
  21314. len = params ? params.length : 0;
  21315. if (isAnalyzeById === false) {
  21316. for (var i = 0; i < len; i++) {
  21317. if (i > 0) {
  21318. jsonString += ",";
  21319. }
  21320. jsonString += '{"x":' + params[i].x + ',"y":' + params[i].y + '}';
  21321. }
  21322. } else if (isAnalyzeById === true) {
  21323. for (var _i = 0; _i < len; _i++) {
  21324. if (_i > 0) {
  21325. jsonString += ",";
  21326. }
  21327. jsonString += params[_i];
  21328. }
  21329. }
  21330. jsonString += ']';
  21331. return jsonString;
  21332. }
  21333. /**
  21334. * @function SuperMap.FindServiceAreasService.prototype.toGeoJSONResult
  21335. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21336. * @param {Object} result - 服务器返回的结果对象。。
  21337. */
  21338. }, {
  21339. key: "toGeoJSONResult",
  21340. value: function toGeoJSONResult(result) {
  21341. if (!result || !result.serviceAreaList) {
  21342. return result;
  21343. }
  21344. var geoJSONFormat = new GeoJSON();
  21345. result.serviceAreaList.map(function (serviceArea) {
  21346. if (serviceArea.serviceRegion) {
  21347. serviceArea.serviceRegion = geoJSONFormat.toGeoJSON(serviceArea.serviceRegion);
  21348. }
  21349. if (serviceArea.edgeFeatures) {
  21350. serviceArea.edgeFeatures = geoJSONFormat.toGeoJSON(serviceArea.edgeFeatures);
  21351. }
  21352. if (serviceArea.nodeFeatures) {
  21353. serviceArea.nodeFeatures = geoJSONFormat.toGeoJSON(serviceArea.nodeFeatures);
  21354. }
  21355. if (serviceArea.routes) {
  21356. serviceArea.routes = geoJSONFormat.toGeoJSON(serviceArea.routes);
  21357. }
  21358. return serviceArea;
  21359. });
  21360. return result;
  21361. }
  21362. }]);
  21363. return FindServiceAreasService;
  21364. }(NetworkAnalystServiceBase);
  21365. SuperMap.FindServiceAreasService = FindServiceAreasService;
  21366. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsParameters.js
  21367. function FindTSPPathsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21368. 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); } }
  21369. function FindTSPPathsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21370. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21371. * This program are made available under the terms of the Apache License, Version 2.0
  21372. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21373. /**
  21374. * @class SuperMap.FindTSPPathsParameters
  21375. * @category iServer NetworkAnalyst TSPPath
  21376. * @classdesc 旅行商分析参数类。
  21377. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  21378. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  21379. * 旅行商分析和最佳路径分析都是在网络中寻找遍历所有站点的最经济的路径,区别是在遍历网络所有站点的过程中对结点访问顺序不同
  21380. * 最佳路径分析必须按照指定顺序对站点进行访问,而旅行商分析是无序的路径分析。
  21381. * @param {Object} options - 参数。
  21382. * @param {boolean} [options.endNodeAssigned=false] - 是否指定终止点,将指定的途经点的最后一个点作为终止点。true 表示指定终止点,则旅行商必须最后一个访问终止点。
  21383. * @param {boolean} [options.isAnalyzeById=false] - 是否通过节点 ID 号来指定配送中心点和配送目的点。
  21384. * @param {Array.<(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number)>} options.nodes - 配送目标集合。
  21385. * @param {SuperMap.TransportationAnalystParameter} [options.parameter] - 交通网络分析通用参数。
  21386. */
  21387. var FindTSPPathsParameters = /*#__PURE__*/function () {
  21388. function FindTSPPathsParameters(options) {
  21389. FindTSPPathsParameters_classCallCheck(this, FindTSPPathsParameters);
  21390. /**
  21391. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.endNodeAssigned=false]
  21392. * @description 是否指定终止点,将指定的途经点的最后一个点作为终止点。
  21393. * true 表示指定终止点,则旅行商必须最后一个访问终止点。
  21394. */
  21395. this.endNodeAssigned = false;
  21396. /**
  21397. * @member {boolean} [SuperMap.FindTSPPathsParameters.prototype.isAnalyzeById=false]
  21398. * @description 是否通过节点 ID 号来指定途经点。
  21399. */
  21400. this.isAnalyzeById = false;
  21401. /**
  21402. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point|number>} SuperMap.FindTSPPathsParameters.prototype.nodes
  21403. * @description 旅行商分析途经点数组。
  21404. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = false 时,nodes 应为点的坐标数组;
  21405. * 当 SuperMap.FindTSPPathsParameters.isAnalyzeById = true 时,nodes 应为点的 ID 数组。
  21406. */
  21407. this.nodes = null;
  21408. /**
  21409. * @member {SuperMap.TransportationAnalystParameter} [SuperMap.FindTSPPathsParameters.prototype.parameter]
  21410. * @description 交通网络分析通用参数。通过本类可以设置障碍边、障碍点、权值字段信息的名称标识、转向权值字段等信息。
  21411. * SuperMap.TransportationAnalystParameter 类型,它虽然为可选参数,但是如果不设置其中的 resultSetting
  21412. * 字段,则返回结果空间信息等都为空。
  21413. */
  21414. this.parameter = new TransportationAnalystParameter();
  21415. Util.extend(this, options);
  21416. this.CLASS_NAME = "SuperMap.FindTSPPathsParameters";
  21417. }
  21418. /**
  21419. * @function SuperMap.FindTSPPathsParameters.prototype.destroy
  21420. * @description 释放资源,将引用资源的属性置空。
  21421. */
  21422. FindTSPPathsParameters_createClass(FindTSPPathsParameters, [{
  21423. key: "destroy",
  21424. value: function destroy() {
  21425. var me = this;
  21426. me.endNodeAssigned = null;
  21427. me.isAnalyzeById = null;
  21428. me.nodes = null;
  21429. if (me.parameter) {
  21430. me.parameter.destroy();
  21431. me.parameter = null;
  21432. }
  21433. }
  21434. }]);
  21435. return FindTSPPathsParameters;
  21436. }();
  21437. SuperMap.FindTSPPathsParameters = FindTSPPathsParameters;
  21438. ;// CONCATENATED MODULE: ./src/common/iServer/FindTSPPathsService.js
  21439. function FindTSPPathsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FindTSPPathsService_typeof = function _typeof(obj) { return typeof obj; }; } else { FindTSPPathsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FindTSPPathsService_typeof(obj); }
  21440. function FindTSPPathsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21441. 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); } }
  21442. function FindTSPPathsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FindTSPPathsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FindTSPPathsService_defineProperties(Constructor, staticProps); return Constructor; }
  21443. function FindTSPPathsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { FindTSPPathsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return FindTSPPathsService_get(target, property, receiver || target); }
  21444. function FindTSPPathsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = FindTSPPathsService_getPrototypeOf(object); if (object === null) break; } return object; }
  21445. 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 } }); if (superClass) FindTSPPathsService_setPrototypeOf(subClass, superClass); }
  21446. function FindTSPPathsService_setPrototypeOf(o, p) { FindTSPPathsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FindTSPPathsService_setPrototypeOf(o, p); }
  21447. 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); }; }
  21448. function FindTSPPathsService_possibleConstructorReturn(self, call) { if (call && (FindTSPPathsService_typeof(call) === "object" || typeof call === "function")) { return call; } return FindTSPPathsService_assertThisInitialized(self); }
  21449. function FindTSPPathsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21450. function FindTSPPathsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21451. function FindTSPPathsService_getPrototypeOf(o) { FindTSPPathsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FindTSPPathsService_getPrototypeOf(o); }
  21452. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21453. * This program are made available under the terms of the Apache License, Version 2.0
  21454. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21455. /**
  21456. * @class SuperMap.FindTSPPathsService
  21457. * @category iServer NetworkAnalyst TSPPath
  21458. * @classdesc 旅行商分析服务类
  21459. * 旅行商分析是路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  21460. * 旅行商分析也可以指定到达的终点,这时查找从起点能够遍历所有途经点最后到达终点,且花费最小的路径。
  21461. * 该类负责将客户端指定的旅行商分析参数传递给服务端,并接收服务端返回的结果数据。
  21462. * 旅行商分析结果通过该类支持的事件的监听函数参数获取
  21463. * @extends {SuperMap.NetworkAnalystServiceBase}
  21464. * @example
  21465. * (start code)
  21466. * var myFindTSPPathsService = new SuperMap.FindTSPPathsService(url, {
  21467. * eventListeners: {
  21468. * "processCompleted": findTSPPathsCompleted,
  21469. * "processFailed": findTSPPathsError
  21470. * }
  21471. * });
  21472. * (end)
  21473. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:
  21474. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源};
  21475. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  21476. * @param {Object} options - 参数。
  21477. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21478. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21479. * @param {Object} [options.headers] - 请求头。
  21480. */
  21481. var FindTSPPathsService = /*#__PURE__*/function (_NetworkAnalystServic) {
  21482. FindTSPPathsService_inherits(FindTSPPathsService, _NetworkAnalystServic);
  21483. var _super = FindTSPPathsService_createSuper(FindTSPPathsService);
  21484. function FindTSPPathsService(url, options) {
  21485. var _this;
  21486. FindTSPPathsService_classCallCheck(this, FindTSPPathsService);
  21487. _this = _super.call(this, url, options);
  21488. _this.CLASS_NAME = "SuperMap.FindTSPPathsService";
  21489. return _this;
  21490. }
  21491. /**
  21492. * @function SuperMap.FindTSPPathsService.prototype.destroy
  21493. * @override
  21494. */
  21495. FindTSPPathsService_createClass(FindTSPPathsService, [{
  21496. key: "destroy",
  21497. value: function destroy() {
  21498. FindTSPPathsService_get(FindTSPPathsService_getPrototypeOf(FindTSPPathsService.prototype), "destroy", this).call(this);
  21499. }
  21500. /**
  21501. * @function SuperMap.FindTSPPathsService.prototype.processAsync
  21502. * @description 负责将客户端的查询参数传递到服务端。
  21503. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  21504. */
  21505. }, {
  21506. key: "processAsync",
  21507. value: function processAsync(params) {
  21508. if (!(params instanceof FindTSPPathsParameters)) {
  21509. return;
  21510. }
  21511. var me = this,
  21512. jsonObject;
  21513. me.url = Util.urlPathAppend(me.url, 'tsppath');
  21514. jsonObject = {
  21515. parameter: SuperMap.Util.toJSON(params.parameter),
  21516. endNodeAssigned: params.endNodeAssigned,
  21517. nodes: me.getNodesJson(params)
  21518. };
  21519. me.request({
  21520. method: "GET",
  21521. params: jsonObject,
  21522. scope: me,
  21523. success: me.serviceProcessCompleted,
  21524. failure: me.serviceProcessFailed
  21525. });
  21526. }
  21527. /**
  21528. * @function SuperMap.FindTSPPathsService.prototype.getNodesJson
  21529. * @description 将节点对象转化为JSON字符串。
  21530. * @param {SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  21531. * @returns {string} 转化后的JSON字符串。
  21532. */
  21533. }, {
  21534. key: "getNodesJson",
  21535. value: function getNodesJson(params) {
  21536. var jsonParameters = "",
  21537. nodesString,
  21538. i,
  21539. len,
  21540. nodes;
  21541. if (params.isAnalyzeById === false) {
  21542. for (nodesString = "[", i = 0, nodes = params.nodes, len = nodes.length; i < len; i++) {
  21543. if (i > 0) {
  21544. nodesString += ",";
  21545. }
  21546. nodesString += '{"x":' + nodes[i].x + ',"y":' + nodes[i].y + '}';
  21547. }
  21548. nodesString += ']';
  21549. jsonParameters += nodesString;
  21550. } else if (params.isAnalyzeById === true) {
  21551. var nodeIDsString = "[",
  21552. _nodes = params.nodes,
  21553. _len = _nodes.length;
  21554. for (var _i = 0; _i < _len; _i++) {
  21555. if (_i > 0) {
  21556. nodeIDsString += ",";
  21557. }
  21558. nodeIDsString += _nodes[_i];
  21559. }
  21560. nodeIDsString += ']';
  21561. jsonParameters += nodeIDsString;
  21562. }
  21563. return jsonParameters;
  21564. }
  21565. /**
  21566. * @function SuperMap.FindTSPPathsService.prototype.toGeoJSONResult
  21567. * @description 将含有 geometry 的数据转换为 GeoJSON 格式。
  21568. * @param {Object} result - 服务器返回的结果对象。
  21569. */
  21570. }, {
  21571. key: "toGeoJSONResult",
  21572. value: function toGeoJSONResult(result) {
  21573. if (!result || !result.tspPathList) {
  21574. return null;
  21575. }
  21576. var geoJSONFormat = new GeoJSON();
  21577. result.tspPathList.forEach(function (path) {
  21578. if (path.route) {
  21579. path.route = geoJSONFormat.toGeoJSON(path.route);
  21580. }
  21581. if (path.pathGuideItems) {
  21582. path.pathGuideItems = geoJSONFormat.toGeoJSON(path.pathGuideItems);
  21583. }
  21584. if (path.edgeFeatures) {
  21585. path.edgeFeatures = geoJSONFormat.toGeoJSON(path.edgeFeatures);
  21586. }
  21587. if (path.nodeFeatures) {
  21588. path.nodeFeatures = geoJSONFormat.toGeoJSON(path.nodeFeatures);
  21589. }
  21590. });
  21591. return result;
  21592. }
  21593. }]);
  21594. return FindTSPPathsService;
  21595. }(NetworkAnalystServiceBase);
  21596. SuperMap.FindTSPPathsService = FindTSPPathsService;
  21597. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataParameters.js
  21598. function GenerateSpatialDataParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21599. 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); } }
  21600. function GenerateSpatialDataParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21601. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21602. * This program are made available under the terms of the Apache License, Version 2.0
  21603. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21604. /**
  21605. * @class SuperMap.GenerateSpatialDataParameters
  21606. * @category iServer SpatialAnalyst GenerateSpatialData
  21607. * @classdesc 动态分段操作参数类。通过该类可以为动态分段提供参数信息。
  21608. * @param {Object} options - 参数。
  21609. * @param {string} options.routeTable - 路由数据集。
  21610. * @param {string} options.routeIDField - 路由数据集的标识字段。
  21611. * @param {string} options.eventTable - 用于生成空间数据的事件表名。
  21612. * @param {SuperMap.DataReturnOption} options.dataReturnOption - 设置数据返回选项。
  21613. * @param {string} [options.attributeFilter] - 属性过滤条件。
  21614. * @param {string} options.eventRouteIDField - 用于生成空间数据的事件表的路由标识字段。
  21615. * @param {string} [options.measureField] - 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义。
  21616. * @param {string} [options.measureStartField] - 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  21617. * @param {string} [options.measureEndField] - 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  21618. * @param {string} [options.measureOffsetField] - 刻度偏移量字段。
  21619. * @param {string} [options.errorInfoField] - 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  21620. * @param {Array.<string>} [options.retainedFields] - 欲保留到结果空间数据中的字段集合(系统字段除外)。
  21621. */
  21622. var GenerateSpatialDataParameters = /*#__PURE__*/function () {
  21623. function GenerateSpatialDataParameters(options) {
  21624. GenerateSpatialDataParameters_classCallCheck(this, GenerateSpatialDataParameters);
  21625. /**
  21626. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeTable
  21627. * @description 路由数据集。
  21628. */
  21629. this.routeTable = null;
  21630. /**
  21631. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.routeIDField
  21632. * @description 路由数据集的标识字段。
  21633. */
  21634. this.routeIDField = null;
  21635. /**
  21636. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.attributeFilter]
  21637. * @description 属性过滤条件。
  21638. * 当 {@link SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption.dataReturnMode} 为 {@link DataReturnMode.DATASET_AND_RECORDSET} 或 {@link DataReturnMode.RECORDSET_ONLY} 时有效。
  21639. */
  21640. this.attributeFilter = null;
  21641. /**
  21642. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventTable
  21643. * @description 用于生成空间数据的事件表名。
  21644. */
  21645. this.eventTable = null;
  21646. /**
  21647. * @member {string} SuperMap.GenerateSpatialDataParameters.prototype.eventRouteIDField
  21648. * @description 用于生成空间数据的事件表的路由标识字段。
  21649. */
  21650. this.eventRouteIDField = null;
  21651. /**
  21652. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureField]
  21653. * @description 用于生成空间数据的事件表的刻度字段,只有当事件为点事件的时候该属性才有意义
  21654. */
  21655. this.measureField = null;
  21656. /**
  21657. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureStartField]
  21658. * @description 用于生成空间数据的事件表的起始刻度字段,只有当事件为线事件的时候该属性才有意义。
  21659. */
  21660. this.measureStartField = null;
  21661. /**
  21662. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureEndField]
  21663. * @description 用于生成空间数据的事件表的终止刻度字段,只有当事件为线事件的时候该属性才有意义。
  21664. */
  21665. this.measureEndField = null;
  21666. /**
  21667. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.measureOffsetField]
  21668. * @description 刻度偏移量字段。
  21669. */
  21670. this.measureOffsetField = null;
  21671. /**
  21672. * @member {string} [SuperMap.GenerateSpatialDataParameters.prototype.errorInfoField]
  21673. * @description 错误信息字段,直接写入原事件表,用于描述事件未能生成对应的点或线时的错误信息。
  21674. */
  21675. this.errorInfoField = null;
  21676. /**
  21677. * @member {Array.<string>} [SuperMap.GenerateSpatialDataParameters.prototype.retainedFields]
  21678. * @description 欲保留到结果空间数据中的字段集合(系统字段除外)。
  21679. * 生成空间数据时,无论是否指定保留字段,路由 ID 字段、刻度偏移量字段、刻度值字段(点事件为刻度字段,线事件是起始和终止刻度字段)都会保留到结果空间数据中;
  21680. * 如果没有指定 retainedFields 参数或者 retainedFields 参数数组长度为 0,则返回所有用户字段。
  21681. */
  21682. this.retainedFields = null;
  21683. /**
  21684. * @member {SuperMap.DataReturnOption} SuperMap.GenerateSpatialDataParameters.prototype.dataReturnOption
  21685. * @description 设置数据返回的选项。
  21686. */
  21687. this.dataReturnOption = null;
  21688. if (options) {
  21689. Util.extend(this, options);
  21690. }
  21691. this.CLASS_NAME = "SuperMap.GenerateSpatialDataParameters";
  21692. }
  21693. /**
  21694. * @function SuperMap.GenerateSpatialDataParameters.prototype.destroy
  21695. * @description 释放资源,将引用资源的属性置空。
  21696. */
  21697. GenerateSpatialDataParameters_createClass(GenerateSpatialDataParameters, [{
  21698. key: "destroy",
  21699. value: function destroy() {
  21700. var me = this;
  21701. if (me.routeTable) {
  21702. me.routeTable = null;
  21703. }
  21704. me.routeIDField = null;
  21705. me.attributeFilter = null;
  21706. me.eventTable = null;
  21707. me.eventRouteIDField = null;
  21708. me.measureField = null;
  21709. me.measureStartField = null;
  21710. me.measureEndField = null;
  21711. me.measureOffsetField = null;
  21712. me.errorInfoField = null;
  21713. if (me.dataReturnOption) {
  21714. me.dataReturnOption.destroy();
  21715. me.dataReturnOption = null;
  21716. }
  21717. }
  21718. }]);
  21719. return GenerateSpatialDataParameters;
  21720. }();
  21721. SuperMap.GenerateSpatialDataParameters = GenerateSpatialDataParameters;
  21722. ;// CONCATENATED MODULE: ./src/common/iServer/GenerateSpatialDataService.js
  21723. function GenerateSpatialDataService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GenerateSpatialDataService_typeof = function _typeof(obj) { return typeof obj; }; } else { GenerateSpatialDataService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GenerateSpatialDataService_typeof(obj); }
  21724. function GenerateSpatialDataService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21725. 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); } }
  21726. function GenerateSpatialDataService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GenerateSpatialDataService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GenerateSpatialDataService_defineProperties(Constructor, staticProps); return Constructor; }
  21727. function GenerateSpatialDataService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GenerateSpatialDataService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GenerateSpatialDataService_get(target, property, receiver || target); }
  21728. function GenerateSpatialDataService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GenerateSpatialDataService_getPrototypeOf(object); if (object === null) break; } return object; }
  21729. 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 } }); if (superClass) GenerateSpatialDataService_setPrototypeOf(subClass, superClass); }
  21730. function GenerateSpatialDataService_setPrototypeOf(o, p) { GenerateSpatialDataService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GenerateSpatialDataService_setPrototypeOf(o, p); }
  21731. 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); }; }
  21732. function GenerateSpatialDataService_possibleConstructorReturn(self, call) { if (call && (GenerateSpatialDataService_typeof(call) === "object" || typeof call === "function")) { return call; } return GenerateSpatialDataService_assertThisInitialized(self); }
  21733. function GenerateSpatialDataService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21734. function GenerateSpatialDataService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21735. function GenerateSpatialDataService_getPrototypeOf(o) { GenerateSpatialDataService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GenerateSpatialDataService_getPrototypeOf(o); }
  21736. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21737. * This program are made available under the terms of the Apache License, Version 2.0
  21738. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21739. /**
  21740. * @class SuperMap.GenerateSpatialDataService
  21741. * @category iServer SpatialAnalyst GenerateSpatialData
  21742. * @classdesc 动态分段分析服务类。该类负责将客户设置的动态分段分析服务参数传递给服务端,并接收服务端返回的动态分段分析结果数据。
  21743. * 获取的结果数据包括 originResult 、result 两种,其中,originResult 为服务端返回的用 JSON 对象表示的动态分段分析结果数据,result 为服务端返回的动态分段分析结果数据。
  21744. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  21745. * @param {Object} options - 参数。</br>
  21746. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  21747. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  21748. * @param {Object} [options.headers] - 请求头。
  21749. * @extends {SuperMap.SpatialAnalystBase}
  21750. * @example 实例化该类如下例所示:
  21751. * (start code)
  21752. * function GenerateSpatialData(){
  21753. *
  21754. * //配置数据返回选项(option)
  21755. * var option = new SuperMap.DataReturnOption({
  21756. * expectCount: 1000,
  21757. * dataset: "generateSpatialData",
  21758. * deleteExistResultDataset: true,
  21759. * dataReturnMode: SuperMap.DataReturnMode.DATASET_ONLY
  21760. * }),
  21761. * //配置动态分段参数(Parameters)
  21762. * parameters = new SuperMap.GenerateSpatialDataParameters({
  21763. * routeTable: "RouteDT_road@Changchun",
  21764. * routeIDField: "RouteID",
  21765. * eventTable: "LinearEventTabDT@Changchun",
  21766. * eventRouteIDField: "RouteID",
  21767. * measureField: "",
  21768. * measureStartField: "LineMeasureFrom",
  21769. * measureEndField: "LineMeasureTo",
  21770. * measureOffsetField: "",
  21771. * errorInfoField: "",
  21772. * retainedFields:[],
  21773. * dataReturnOption: option
  21774. * }),
  21775. * //配置动态分段iService
  21776. * iService = new SuperMap.GenerateSpatialDataService(Changchun_spatialanalyst, {
  21777. * eventListeners: {
  21778. * processCompleted: generateCompleted,
  21779. * processFailed: generateFailded
  21780. * }
  21781. * });
  21782. * //执行
  21783. * iService.processAsync(parameters);
  21784. * function Completed(generateSpatialDataEventArgs){//todo};
  21785. * function Error(generateSpatialDataEventArgs){//todo};
  21786. * (end)
  21787. */
  21788. var GenerateSpatialDataService = /*#__PURE__*/function (_SpatialAnalystBase) {
  21789. GenerateSpatialDataService_inherits(GenerateSpatialDataService, _SpatialAnalystBase);
  21790. var _super = GenerateSpatialDataService_createSuper(GenerateSpatialDataService);
  21791. function GenerateSpatialDataService(url, options) {
  21792. var _this;
  21793. GenerateSpatialDataService_classCallCheck(this, GenerateSpatialDataService);
  21794. _this = _super.call(this, url, options);
  21795. _this.CLASS_NAME = "SuperMap.GenerateSpatialDataService";
  21796. return _this;
  21797. }
  21798. /**
  21799. * @function SuperMap.GenerateSpatialDataService.prototype.destroy
  21800. * @override
  21801. */
  21802. GenerateSpatialDataService_createClass(GenerateSpatialDataService, [{
  21803. key: "destroy",
  21804. value: function destroy() {
  21805. GenerateSpatialDataService_get(GenerateSpatialDataService_getPrototypeOf(GenerateSpatialDataService.prototype), "destroy", this).call(this);
  21806. }
  21807. /**
  21808. * @function SuperMap.GenerateSpatialDataService.prototype.processAsync
  21809. * @description 负责将客户端的动态分段服务参数传递到服务端。
  21810. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  21811. */
  21812. }, {
  21813. key: "processAsync",
  21814. value: function processAsync(params) {
  21815. if (!(params instanceof GenerateSpatialDataParameters)) {
  21816. return;
  21817. }
  21818. var me = this,
  21819. jsonParameters;
  21820. jsonParameters = me.getJsonParameters(params);
  21821. me.request({
  21822. method: "POST",
  21823. data: jsonParameters,
  21824. scope: me,
  21825. success: me.serviceProcessCompleted,
  21826. failure: me.serviceProcessFailed
  21827. });
  21828. }
  21829. /**
  21830. * @function SuperMap.GenerateSpatialDataService.prototype.getJsonParameters
  21831. * @description 将参数转化为 JSON 字符串。
  21832. * @param {SuperMap.GenerateSpatialDataParameters} params - 动态分段操作参数类。
  21833. * @returns {string}转化后的JSON字符串。
  21834. */
  21835. }, {
  21836. key: "getJsonParameters",
  21837. value: function getJsonParameters(params) {
  21838. var jsonParameters = "",
  21839. jsonStr = "datasets/" + params.routeTable + "/linearreferencing/generatespatialdata",
  21840. me = this;
  21841. me.url = Util.urlPathAppend(me.url, jsonStr);
  21842. me.url = Util.urlAppend(me.url, 'returnContent=true');
  21843. jsonParameters = Util.toJSON(params);
  21844. return jsonParameters;
  21845. }
  21846. }]);
  21847. return GenerateSpatialDataService;
  21848. }(SpatialAnalystBase);
  21849. SuperMap.GenerateSpatialDataService = GenerateSpatialDataService;
  21850. ;// CONCATENATED MODULE: ./src/common/iServer/GeoBoundingBoxQueryBuilderParameter.js
  21851. function GeoBoundingBoxQueryBuilderParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoBoundingBoxQueryBuilderParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoBoundingBoxQueryBuilderParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoBoundingBoxQueryBuilderParameter_typeof(obj); }
  21852. function GeoBoundingBoxQueryBuilderParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21853. function GeoBoundingBoxQueryBuilderParameter_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21854. function GeoBoundingBoxQueryBuilderParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoBoundingBoxQueryBuilderParameter_defineProperties(Constructor, staticProps); return Constructor; }
  21855. function GeoBoundingBoxQueryBuilderParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoBoundingBoxQueryBuilderParameter_get = Reflect.get; } else { GeoBoundingBoxQueryBuilderParameter_get = function _get(target, property, receiver) { var base = GeoBoundingBoxQueryBuilderParameter_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GeoBoundingBoxQueryBuilderParameter_get(target, property, receiver || target); }
  21856. function GeoBoundingBoxQueryBuilderParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  21857. function GeoBoundingBoxQueryBuilderParameter_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 } }); if (superClass) GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(subClass, superClass); }
  21858. function GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p) { GeoBoundingBoxQueryBuilderParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoBoundingBoxQueryBuilderParameter_setPrototypeOf(o, p); }
  21859. function GeoBoundingBoxQueryBuilderParameter_createSuper(Derived) { var hasNativeReflectConstruct = GeoBoundingBoxQueryBuilderParameter_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(this, result); }; }
  21860. function GeoBoundingBoxQueryBuilderParameter_possibleConstructorReturn(self, call) { if (call && (GeoBoundingBoxQueryBuilderParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self); }
  21861. function GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21862. function GeoBoundingBoxQueryBuilderParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21863. function GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o) { GeoBoundingBoxQueryBuilderParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(o); }
  21864. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21865. * This program are made available under the terms of the Apache License, Version 2.0
  21866. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21867. /**
  21868. * @class SuperMap.GeoBoundingBoxQueryBuilderParameter
  21869. * @classdesc bounds 查询参数设置类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  21870. * @category iServer Data FeatureResults
  21871. * @param {Object} options - 参数。
  21872. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 查询范围。
  21873. * @param {SuperMap.AggregationQueryBuilderType} [options.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX] - 查询类型。
  21874. */
  21875. var GeoBoundingBoxQueryBuilderParameter = /*#__PURE__*/function (_AggQueryBuilderParam) {
  21876. GeoBoundingBoxQueryBuilderParameter_inherits(GeoBoundingBoxQueryBuilderParameter, _AggQueryBuilderParam);
  21877. var _super = GeoBoundingBoxQueryBuilderParameter_createSuper(GeoBoundingBoxQueryBuilderParameter);
  21878. function GeoBoundingBoxQueryBuilderParameter(options) {
  21879. var _this;
  21880. GeoBoundingBoxQueryBuilderParameter_classCallCheck(this, GeoBoundingBoxQueryBuilderParameter);
  21881. _this = _super.call(this, options);
  21882. /**
  21883. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.bounds
  21884. * @description 查询范围。
  21885. */
  21886. _this.bounds = null;
  21887. /**
  21888. * @member {SuperMap.AggregationQueryBuilderType} [SuperMap.GeoBoundingBoxQueryBuilderParameter.prototype.queryType=SuperMap.AggregationQueryBuilderType.GEO_BOUNDING_BOX]
  21889. * @description 查询类型。
  21890. */
  21891. _this.queryType = AggregationQueryBuilderType.GEO_BOUNDING_BOX;
  21892. _this.CLASS_NAME = "SuperMap.GeoBoundingBoxQueryBuilderParameter";
  21893. Util.extend(GeoBoundingBoxQueryBuilderParameter_assertThisInitialized(_this), options);
  21894. return _this;
  21895. }
  21896. GeoBoundingBoxQueryBuilderParameter_createClass(GeoBoundingBoxQueryBuilderParameter, [{
  21897. key: "destroy",
  21898. value: function destroy() {
  21899. GeoBoundingBoxQueryBuilderParameter_get(GeoBoundingBoxQueryBuilderParameter_getPrototypeOf(GeoBoundingBoxQueryBuilderParameter.prototype), "destroy", this).call(this);
  21900. this.bounds = null;
  21901. this.queryType = null;
  21902. }
  21903. }]);
  21904. return GeoBoundingBoxQueryBuilderParameter;
  21905. }(AggQueryBuilderParameter);
  21906. SuperMap.GeoBoundingBoxQueryBuilderParameter = GeoBoundingBoxQueryBuilderParameter;
  21907. ;// CONCATENATED MODULE: ./src/common/iServer/GeoHashGridAggParameter.js
  21908. function GeoHashGridAggParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoHashGridAggParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoHashGridAggParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoHashGridAggParameter_typeof(obj); }
  21909. function GeoHashGridAggParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21910. 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); } }
  21911. function GeoHashGridAggParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoHashGridAggParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoHashGridAggParameter_defineProperties(Constructor, staticProps); return Constructor; }
  21912. function GeoHashGridAggParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoHashGridAggParameter_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeoHashGridAggParameter_get(target, property, receiver || target); }
  21913. function GeoHashGridAggParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoHashGridAggParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  21914. 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 } }); if (superClass) GeoHashGridAggParameter_setPrototypeOf(subClass, superClass); }
  21915. function GeoHashGridAggParameter_setPrototypeOf(o, p) { GeoHashGridAggParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoHashGridAggParameter_setPrototypeOf(o, p); }
  21916. 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); }; }
  21917. function GeoHashGridAggParameter_possibleConstructorReturn(self, call) { if (call && (GeoHashGridAggParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoHashGridAggParameter_assertThisInitialized(self); }
  21918. function GeoHashGridAggParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21919. function GeoHashGridAggParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21920. function GeoHashGridAggParameter_getPrototypeOf(o) { GeoHashGridAggParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoHashGridAggParameter_getPrototypeOf(o); }
  21921. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21922. * This program are made available under the terms of the Apache License, Version 2.0
  21923. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  21924. /**
  21925. * @class SuperMap.GeoHashGridAggParameter
  21926. * @classdesc 格网聚合查询参数类,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  21927. * @category iServer Data FeatureResults
  21928. * @param {Object} option - 初始化参数。
  21929. * @param {number} [option.precision=5] - 网格中数字的精度。
  21930. * @param {SuperMap.AggregationType} [option.aggType=SuperMap.AggregationType.GEOHASH_GRID] - 格网聚合类型。
  21931. */
  21932. var GeoHashGridAggParameter = /*#__PURE__*/function (_AggregationParameter) {
  21933. GeoHashGridAggParameter_inherits(GeoHashGridAggParameter, _AggregationParameter);
  21934. var _super = GeoHashGridAggParameter_createSuper(GeoHashGridAggParameter);
  21935. function GeoHashGridAggParameter(option) {
  21936. var _this;
  21937. GeoHashGridAggParameter_classCallCheck(this, GeoHashGridAggParameter);
  21938. _this = _super.call(this, option);
  21939. /**
  21940. * @member {number} [SuperMap.GeoHashGridAggParameter.prototype.precision=5]
  21941. * @description 网格中数字的精度。
  21942. */
  21943. _this.precision = 5;
  21944. /**
  21945. * @member {SuperMap.AggregationType} [SuperMap.GeoHashGridAggParameter.prototype.aggType=SuperMap.AggregationType.GEOHASH_GRID]
  21946. * @description 格网聚合类型。
  21947. */
  21948. _this.aggType = AggregationType.GEOHASH_GRID;
  21949. Util.extend(GeoHashGridAggParameter_assertThisInitialized(_this), option);
  21950. _this.CLASS_NAME = "SuperMap.GeoHashGridAggParameter";
  21951. return _this;
  21952. }
  21953. GeoHashGridAggParameter_createClass(GeoHashGridAggParameter, [{
  21954. key: "destroy",
  21955. value: function destroy() {
  21956. GeoHashGridAggParameter_get(GeoHashGridAggParameter_getPrototypeOf(GeoHashGridAggParameter.prototype), "destroy", this).call(this);
  21957. this.aggType = null;
  21958. }
  21959. /**
  21960. * @function SuperMap.GeoHashGridAggParameter.toJsonParameters
  21961. * @description 将对象转为 JSON 格式。
  21962. * @param param 转换对象。
  21963. * @returns {string|object}
  21964. */
  21965. }], [{
  21966. key: "toJsonParameters",
  21967. value: function toJsonParameters(param) {
  21968. var parameters = {
  21969. aggName: param.aggName,
  21970. aggFieldName: param.aggFieldName,
  21971. aggType: param.aggType,
  21972. precision: param.precision
  21973. };
  21974. if (param.subAgg) {
  21975. parameters.subAgg = param.subAgg;
  21976. }
  21977. return Util.toJson(parameters);
  21978. }
  21979. }]);
  21980. return GeoHashGridAggParameter;
  21981. }(AggregationParameter);
  21982. SuperMap.GeoHashGridAggParameter = GeoHashGridAggParameter;
  21983. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryOverlayAnalystParameters.js
  21984. function GeometryOverlayAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryOverlayAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryOverlayAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryOverlayAnalystParameters_typeof(obj); }
  21985. function GeometryOverlayAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  21986. 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); } }
  21987. function GeometryOverlayAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryOverlayAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryOverlayAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  21988. function GeometryOverlayAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryOverlayAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeometryOverlayAnalystParameters_get(target, property, receiver || target); }
  21989. function GeometryOverlayAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryOverlayAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  21990. 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 } }); if (superClass) GeometryOverlayAnalystParameters_setPrototypeOf(subClass, superClass); }
  21991. function GeometryOverlayAnalystParameters_setPrototypeOf(o, p) { GeometryOverlayAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryOverlayAnalystParameters_setPrototypeOf(o, p); }
  21992. 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); }; }
  21993. function GeometryOverlayAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryOverlayAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryOverlayAnalystParameters_assertThisInitialized(self); }
  21994. function GeometryOverlayAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  21995. function GeometryOverlayAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  21996. function GeometryOverlayAnalystParameters_getPrototypeOf(o) { GeometryOverlayAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryOverlayAnalystParameters_getPrototypeOf(o); }
  21997. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  21998. * This program are made available under the terms of the Apache License, Version 2.0
  21999. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22000. /**
  22001. * @class SuperMap.GeometryOverlayAnalystParameters
  22002. * @category iServer SpatialAnalyst OverlayAnalyst
  22003. * @classdesc
  22004. * 几何对象叠加分析参数类。对指定的某两个几何对象做叠加分析。通过该类可以指定要做叠加分析的几何对象、叠加操作类型。
  22005. * @param {Object} options - 参数。
  22006. * @param {Object} options.operateGeometry - 叠加分析的操作几何对象。 </br>
  22007. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  22008. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link GeoJSONObject}。</br>
  22009. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link GeoJSONObject}。
  22010. * @param {Object} options.sourceGeometry - 叠加分析的源几何对象。
  22011. * @param {Array.<Object>} [options.operateGeometries] - 批量叠加分析的操作几何对象数组。
  22012. * @param {Array.<Object>} [options.sourceGeometries] -批量叠加分析的源几何对象数组。
  22013. * @param {SuperMap.OverlayOperationType} [options.operation] - 叠加操作枚举值。
  22014. * @extends {SuperMap.OverlayAnalystParameters}
  22015. */
  22016. var GeometryOverlayAnalystParameters = /*#__PURE__*/function (_OverlayAnalystParame) {
  22017. GeometryOverlayAnalystParameters_inherits(GeometryOverlayAnalystParameters, _OverlayAnalystParame);
  22018. var _super = GeometryOverlayAnalystParameters_createSuper(GeometryOverlayAnalystParameters);
  22019. function GeometryOverlayAnalystParameters(options) {
  22020. var _this;
  22021. GeometryOverlayAnalystParameters_classCallCheck(this, GeometryOverlayAnalystParameters);
  22022. _this = _super.call(this, options);
  22023. if (options && options.operateGeometry) {
  22024. _this.operateGeometry = options.operateGeometry;
  22025. }
  22026. if (options && options.sourceGeometry) {
  22027. _this.sourceGeometry = options.sourceGeometry;
  22028. }
  22029. if (options && options.operateGeometries) {
  22030. _this.operateGeometries = options.operateGeometries;
  22031. }
  22032. if (options && options.sourceGeometries) {
  22033. _this.sourceGeometries = options.sourceGeometries;
  22034. }
  22035. if (options) {
  22036. Util.extend(GeometryOverlayAnalystParameters_assertThisInitialized(_this), options);
  22037. }
  22038. _this.CLASS_NAME = "SuperMap.GeometryOverlayAnalystParameters";
  22039. return _this;
  22040. }
  22041. /**
  22042. * @function SuperMap.GeometryOverlayAnalystParameters.prototype.destroy
  22043. * @override
  22044. */
  22045. GeometryOverlayAnalystParameters_createClass(GeometryOverlayAnalystParameters, [{
  22046. key: "destroy",
  22047. value: function destroy() {
  22048. GeometryOverlayAnalystParameters_get(GeometryOverlayAnalystParameters_getPrototypeOf(GeometryOverlayAnalystParameters.prototype), "destroy", this).call(this);
  22049. var me = this;
  22050. if (me.sourceGeometry) {
  22051. me.sourceGeometry.destroy();
  22052. me.sourceGeometry = null;
  22053. }
  22054. if (me.sourceGeometries) {
  22055. me.sourceGeometries.destroy();
  22056. me.sourceGeometries = null;
  22057. }
  22058. if (me.sourceGeometry) {
  22059. me.sourceGeometry.destroy();
  22060. me.sourceGeometry = null;
  22061. }
  22062. if (me.operateGeometries) {
  22063. me.operateGeometries.destroy();
  22064. me.operateGeometries = null;
  22065. }
  22066. }
  22067. /**
  22068. * @function SuperMap.GeometryOverlayAnalystParameters.toObject
  22069. * @param {SuperMap.GeometryOverlayAnalystParameters} geometryOverlayAnalystParameters - 几何对象叠加分析参数类。
  22070. * @param {SuperMap.GeometryOverlayAnalystParameters} tempObj - 几何对象叠加分析参数对象。
  22071. * @description 将几何对象叠加分析参数对象转换为 JSON 对象。
  22072. * @returns {Object} JSON 对象。
  22073. */
  22074. }], [{
  22075. key: "toObject",
  22076. value: function toObject(geometryOverlayAnalystParameters, tempObj) {
  22077. for (var name in geometryOverlayAnalystParameters) {
  22078. if (name === "sourceGeometry") {
  22079. tempObj.sourceGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometry);
  22080. } else if (name === "sourceGeometries") {
  22081. var sourceGeometries = [];
  22082. for (var i = 0; i < geometryOverlayAnalystParameters.sourceGeometries.length; i++) {
  22083. sourceGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.sourceGeometries[i]));
  22084. }
  22085. tempObj.sourceGeometries = sourceGeometries;
  22086. } else if (name === "operateGeometry") {
  22087. tempObj.operateGeometry = ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometry);
  22088. } else if (name === "operateGeometries") {
  22089. var operateGeometries = [];
  22090. for (var j = 0; j < geometryOverlayAnalystParameters.operateGeometries.length; j++) {
  22091. operateGeometries.push(ServerGeometry.fromGeometry(geometryOverlayAnalystParameters.operateGeometries[j]));
  22092. }
  22093. tempObj.operateGeometries = operateGeometries;
  22094. } else {
  22095. tempObj[name] = geometryOverlayAnalystParameters[name];
  22096. }
  22097. }
  22098. }
  22099. }]);
  22100. return GeometryOverlayAnalystParameters;
  22101. }(OverlayAnalystParameters);
  22102. SuperMap.GeometryOverlayAnalystParameters = GeometryOverlayAnalystParameters;
  22103. ;// CONCATENATED MODULE: ./src/common/iServer/GeometrySurfaceAnalystParameters.js
  22104. function GeometrySurfaceAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometrySurfaceAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometrySurfaceAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometrySurfaceAnalystParameters_typeof(obj); }
  22105. function GeometrySurfaceAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22106. 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); } }
  22107. function GeometrySurfaceAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometrySurfaceAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22108. function GeometrySurfaceAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometrySurfaceAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeometrySurfaceAnalystParameters_get(target, property, receiver || target); }
  22109. function GeometrySurfaceAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometrySurfaceAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22110. 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 } }); if (superClass) GeometrySurfaceAnalystParameters_setPrototypeOf(subClass, superClass); }
  22111. function GeometrySurfaceAnalystParameters_setPrototypeOf(o, p) { GeometrySurfaceAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometrySurfaceAnalystParameters_setPrototypeOf(o, p); }
  22112. 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); }; }
  22113. function GeometrySurfaceAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometrySurfaceAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometrySurfaceAnalystParameters_assertThisInitialized(self); }
  22114. function GeometrySurfaceAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22115. function GeometrySurfaceAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22116. function GeometrySurfaceAnalystParameters_getPrototypeOf(o) { GeometrySurfaceAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometrySurfaceAnalystParameters_getPrototypeOf(o); }
  22117. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22118. * This program are made available under the terms of the Apache License, Version 2.0
  22119. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22120. /**
  22121. * @class SuperMap.GeometrySurfaceAnalystParameters
  22122. * @category iServer SpatialAnalyst SurfaceAnalyst
  22123. * @classdesc 几何对象表面分析参数类。该类对几何对象表面分析所用到的参数进行设置。
  22124. * @param {Object} options - 参数。
  22125. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 表面分析的坐标点数组。
  22126. * @param {Array.<number>} options.zValues - 表面分析的坐标点的 Z 值数组。
  22127. * @param {number} [options.resolution] - 获取或设置指定中间结果(栅格数据集)的分辨率。
  22128. * @param {SuperMap.DataReturnOption} [options.resultSetting] - 结果返回设置类。
  22129. * @param {SuperMap.SurfaceAnalystParametersSetting} options.extractParameter - 获取或设置表面分析参数。
  22130. * @param {SuperMap.SurfaceAnalystMethod} [options.surfaceAnalystMethod = SuperMap.SurfaceAnalystMethod.ISOLINE] - 获取或设置表面分析的提取方法,提取等值线和提取等值面。
  22131. * @extends {SuperMap.SurfaceAnalystParameters}
  22132. */
  22133. var GeometrySurfaceAnalystParameters = /*#__PURE__*/function (_SurfaceAnalystParame) {
  22134. GeometrySurfaceAnalystParameters_inherits(GeometrySurfaceAnalystParameters, _SurfaceAnalystParame);
  22135. var _super = GeometrySurfaceAnalystParameters_createSuper(GeometrySurfaceAnalystParameters);
  22136. function GeometrySurfaceAnalystParameters(options) {
  22137. var _this;
  22138. GeometrySurfaceAnalystParameters_classCallCheck(this, GeometrySurfaceAnalystParameters);
  22139. _this = _super.call(this, options);
  22140. /**
  22141. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometrySurfaceAnalystParameters.prototype.points
  22142. * @description 获取或设置用于表面分析的坐标点数组。
  22143. */
  22144. _this.points = null;
  22145. /**
  22146. * @member {Array.<number>} SuperMap.GeometrySurfaceAnalystParameters.prototype.zValues
  22147. * @description 获取或设置用于提取操作的值。提取等值线时,将使用该数组中的值,
  22148. * 对几何对象中的坐标点数组进行插值分析,得到栅格数据集(中间结果),接着从栅格数据集提取等值线。
  22149. */
  22150. _this.zValues = null;
  22151. if (options) {
  22152. Util.extend(GeometrySurfaceAnalystParameters_assertThisInitialized(_this), options);
  22153. }
  22154. _this.CLASS_NAME = "SuperMap.GeometrySurfaceAnalystParameters";
  22155. return _this;
  22156. }
  22157. /**
  22158. * @function SuperMap.GeometrySurfaceAnalystParameters.prototype.destroy
  22159. * @override
  22160. */
  22161. GeometrySurfaceAnalystParameters_createClass(GeometrySurfaceAnalystParameters, [{
  22162. key: "destroy",
  22163. value: function destroy() {
  22164. GeometrySurfaceAnalystParameters_get(GeometrySurfaceAnalystParameters_getPrototypeOf(GeometrySurfaceAnalystParameters.prototype), "destroy", this).call(this);
  22165. var me = this;
  22166. if (me.points) {
  22167. for (var i = 0, points = me.points, len = points.length; i < len; i++) {
  22168. points[i].destroy();
  22169. }
  22170. me.points = null;
  22171. }
  22172. me.zValues = null;
  22173. }
  22174. }]);
  22175. return GeometrySurfaceAnalystParameters;
  22176. }(SurfaceAnalystParameters);
  22177. SuperMap.GeometrySurfaceAnalystParameters = GeometrySurfaceAnalystParameters;
  22178. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryThiessenAnalystParameters.js
  22179. function GeometryThiessenAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryThiessenAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryThiessenAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryThiessenAnalystParameters_typeof(obj); }
  22180. function GeometryThiessenAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22181. 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); } }
  22182. function GeometryThiessenAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryThiessenAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryThiessenAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22183. function GeometryThiessenAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryThiessenAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeometryThiessenAnalystParameters_get(target, property, receiver || target); }
  22184. function GeometryThiessenAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryThiessenAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22185. 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 } }); if (superClass) GeometryThiessenAnalystParameters_setPrototypeOf(subClass, superClass); }
  22186. function GeometryThiessenAnalystParameters_setPrototypeOf(o, p) { GeometryThiessenAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryThiessenAnalystParameters_setPrototypeOf(o, p); }
  22187. 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); }; }
  22188. function GeometryThiessenAnalystParameters_possibleConstructorReturn(self, call) { if (call && (GeometryThiessenAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryThiessenAnalystParameters_assertThisInitialized(self); }
  22189. function GeometryThiessenAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22190. function GeometryThiessenAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22191. function GeometryThiessenAnalystParameters_getPrototypeOf(o) { GeometryThiessenAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryThiessenAnalystParameters_getPrototypeOf(o); }
  22192. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22193. * This program are made available under the terms of the Apache License, Version 2.0
  22194. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22195. /**
  22196. * @class SuperMap.GeometryThiessenAnalystParameters
  22197. * @constructs SuperMap.GeometryThiessenAnalystParameters
  22198. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  22199. * @classdesc 几何对象泰森多边形分析参数类。对指定的某个几何对象做泰森多边形分析。通过该类可以指定要做泰森多边形分析的几何对象、返回数据集名称等。
  22200. * @param {Object} options - 参数。
  22201. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} options.points - 使用点数组进行分析时使用的几何对象。
  22202. * @extends {SuperMap.ThiessenAnalystParameters}
  22203. */
  22204. var GeometryThiessenAnalystParameters = /*#__PURE__*/function (_ThiessenAnalystParam) {
  22205. GeometryThiessenAnalystParameters_inherits(GeometryThiessenAnalystParameters, _ThiessenAnalystParam);
  22206. var _super = GeometryThiessenAnalystParameters_createSuper(GeometryThiessenAnalystParameters);
  22207. function GeometryThiessenAnalystParameters(options) {
  22208. var _this;
  22209. GeometryThiessenAnalystParameters_classCallCheck(this, GeometryThiessenAnalystParameters);
  22210. _this = _super.call(this, options);
  22211. /**
  22212. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} SuperMap.GeometryThiessenAnalystParameters.prototype.points
  22213. * @description 使用点数组进行分析时使用的几何对象。
  22214. */
  22215. _this.points = null;
  22216. if (options) {
  22217. Util.extend(GeometryThiessenAnalystParameters_assertThisInitialized(_this), options);
  22218. }
  22219. _this.CLASS_NAME = "SuperMap.GeometryThiessenAnalystParameters";
  22220. return _this;
  22221. }
  22222. /**
  22223. * @function SuperMap.GeometryThiessenAnalystParameters.prototype.destroy
  22224. * @override
  22225. */
  22226. GeometryThiessenAnalystParameters_createClass(GeometryThiessenAnalystParameters, [{
  22227. key: "destroy",
  22228. value: function destroy() {
  22229. GeometryThiessenAnalystParameters_get(GeometryThiessenAnalystParameters_getPrototypeOf(GeometryThiessenAnalystParameters.prototype), "destroy", this).call(this);
  22230. var me = this;
  22231. if (me.points) {
  22232. for (var i = me.points.length - 1; i >= 0; i--) {
  22233. me.points[i].destroy();
  22234. }
  22235. me.points = null;
  22236. }
  22237. }
  22238. /**
  22239. * @function SuperMap.GeometryThiessenAnalystParameters.toObject
  22240. * @param {SuperMap.GeometryThiessenAnalystParameters} geometryThiessenAnalystParameters - 几何对象泰森多边形分析参数类。
  22241. * @param {SuperMap.GeometryThiessenAnalystParameters} tempObj - 几何对象泰森多边形分析参数对象。
  22242. * @description 将几何对象泰森多边形分析参数对象转换为 JSON 对象。
  22243. * @returns {Object} JSON 对象。
  22244. */
  22245. }], [{
  22246. key: "toObject",
  22247. value: function toObject(geometryThiessenAnalystParameters, tempObj) {
  22248. for (var name in geometryThiessenAnalystParameters) {
  22249. if (name === "clipRegion") {
  22250. tempObj.clipRegion = ServerGeometry.fromGeometry(geometryThiessenAnalystParameters.clipRegion);
  22251. } else {
  22252. tempObj[name] = geometryThiessenAnalystParameters[name];
  22253. }
  22254. }
  22255. }
  22256. }]);
  22257. return GeometryThiessenAnalystParameters;
  22258. }(ThiessenAnalystParameters);
  22259. SuperMap.GeometryThiessenAnalystParameters = GeometryThiessenAnalystParameters;
  22260. ;// CONCATENATED MODULE: ./src/common/iServer/GeoprocessingService.js
  22261. function GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoprocessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoprocessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoprocessingService_typeof(obj); }
  22262. function GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22263. 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); } }
  22264. function GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  22265. 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 } }); if (superClass) GeoprocessingService_setPrototypeOf(subClass, superClass); }
  22266. function GeoprocessingService_setPrototypeOf(o, p) { GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoprocessingService_setPrototypeOf(o, p); }
  22267. 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); }; }
  22268. function GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoprocessingService_assertThisInitialized(self); }
  22269. function GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22270. function GeoprocessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22271. function GeoprocessingService_getPrototypeOf(o) { GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoprocessingService_getPrototypeOf(o); }
  22272. /**
  22273. * @class SuperMap.GeoprocessingService
  22274. * @category iServer GeoprocessingService
  22275. * @classdesc 地理处理服务接口的基类。
  22276. * @version 10.1.0
  22277. * @extends {SuperMap.CommonServiceBase}
  22278. * @param {string} url - 服务地址。
  22279. * @param {Object} options - 参数。
  22280. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  22281. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,iServer|iPortal|Online。
  22282. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  22283. */
  22284. var GeoprocessingService_GeoprocessingService = /*#__PURE__*/function (_CommonServiceBase) {
  22285. GeoprocessingService_inherits(GeoprocessingService, _CommonServiceBase);
  22286. var _super = GeoprocessingService_createSuper(GeoprocessingService);
  22287. function GeoprocessingService(url, options) {
  22288. var _this;
  22289. GeoprocessingService_classCallCheck(this, GeoprocessingService);
  22290. options = options || {};
  22291. options.EVENT_TYPES = ['processCompleted', 'processFailed', 'processRunning'];
  22292. _this = _super.call(this, url, options);
  22293. _this.CLASS_NAME = 'SuperMap.GeoprocessingService';
  22294. _this.headers = {};
  22295. _this.crossOrigin = true;
  22296. return _this;
  22297. }
  22298. /**
  22299. * @function SuperMap.GeoprocessingService.prototype.getTools
  22300. * @description 获取地理处理工具列表。
  22301. */
  22302. GeoprocessingService_createClass(GeoprocessingService, [{
  22303. key: "getTools",
  22304. value: function getTools() {
  22305. this._get("".concat(this.url, "/list"));
  22306. }
  22307. /**
  22308. * @function SuperMap.GeoprocessingService.prototype.getTool
  22309. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  22310. * @param {string} identifier - 地理处理工具ID。
  22311. */
  22312. }, {
  22313. key: "getTool",
  22314. value: function getTool(identifier) {
  22315. this._get("".concat(this.url, "/").concat(identifier));
  22316. }
  22317. /**
  22318. * @function SuperMap.GeoprocessingService.prototype.execute
  22319. * @description 同步执行地理处理工具。
  22320. * @param {string} identifier - 地理处理工具ID。
  22321. * @param {Object} parameter - 地理处理工具的输入参数。
  22322. * @param {Object} environment - 地理处理工具的环境参数。
  22323. */
  22324. }, {
  22325. key: "execute",
  22326. value: function execute(identifier, parameter, environment) {
  22327. parameter = parameter ? parameter : null;
  22328. environment = environment ? environment : null;
  22329. var executeParamter = {
  22330. parameter: parameter,
  22331. environment: environment
  22332. };
  22333. this._get("".concat(this.url, "/").concat(identifier, "/execute"), executeParamter);
  22334. }
  22335. /**
  22336. * @function SuperMap.GeoprocessingService.prototype.submitJob
  22337. * @description 异步执行地理处理工具。
  22338. * @param {string} identifier - 地理处理工具ID。
  22339. * @param {Object} parameter - 地理处理工具的输入参数。
  22340. * @param {Object} environments - 地理处理工具的环境参数。
  22341. */
  22342. }, {
  22343. key: "submitJob",
  22344. value: function submitJob(identifier, parameter, environments) {
  22345. parameter = parameter ? parameter : null;
  22346. environments = environments ? environments : null;
  22347. var asyncParamter = {
  22348. parameter: parameter,
  22349. environments: environments
  22350. };
  22351. this.request({
  22352. url: "".concat(this.url, "/").concat(identifier, "/jobs"),
  22353. headers: {
  22354. 'Content-type': 'application/json'
  22355. },
  22356. method: 'POST',
  22357. data: JSON.stringify(asyncParamter),
  22358. scope: this,
  22359. success: this.serviceProcessCompleted,
  22360. failure: this.serviceProcessFailed
  22361. });
  22362. }
  22363. /**
  22364. * @function SuperMap.GeoprocessingService.prototype.waitForJobCompletion
  22365. * @description 获取地理处理异步执行状态信息。
  22366. * @param {string} jobId - 地理处理任务ID。
  22367. * @param {string} identifier - 地理处理工具ID。
  22368. * @param {Object} options - 状态信息参数。
  22369. * @param {number} options.interval - 定时器时间间隔。
  22370. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  22371. */
  22372. }, {
  22373. key: "waitForJobCompletion",
  22374. value: function waitForJobCompletion(jobId, identifier, options) {
  22375. var me = this;
  22376. var timer = setInterval(function () {
  22377. var serviceProcessCompleted = function serviceProcessCompleted(serverResult) {
  22378. var state = serverResult.state.runState;
  22379. if (options.statusCallback) {
  22380. options.statusCallback(state);
  22381. }
  22382. switch (state) {
  22383. case 'FINISHED':
  22384. clearInterval(timer);
  22385. me.events.triggerEvent('processCompleted', {
  22386. result: serverResult
  22387. });
  22388. break;
  22389. case 'FAILED':
  22390. clearInterval(timer);
  22391. me.events.triggerEvent('processFailed', {
  22392. result: serverResult
  22393. });
  22394. break;
  22395. case 'CANCELED':
  22396. clearInterval(timer);
  22397. me.events.triggerEvent('processFailed', {
  22398. result: serverResult
  22399. });
  22400. break;
  22401. }
  22402. };
  22403. me._get("".concat(me.url, "/").concat(identifier, "/jobs/").concat(jobId), null, serviceProcessCompleted);
  22404. }, options.interval);
  22405. }
  22406. /**
  22407. * @function SuperMap.GeoprocessingService.prototype.getJobInfo
  22408. * @description 获取地理处理任务的执行信息。
  22409. * @param {string} identifier - 地理处理工具ID。
  22410. * @param {string} jobId - 地理处理任务ID。
  22411. */
  22412. }, {
  22413. key: "getJobInfo",
  22414. value: function getJobInfo(identifier, jobId) {
  22415. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId));
  22416. }
  22417. /**
  22418. * @function SuperMap.GeoprocessingService.prototype.cancelJob
  22419. * @description 取消地理处理任务的异步执行。
  22420. * @param {string} identifier - 地理处理工具ID。
  22421. * @param {string} jobId - 地理处理任务ID。
  22422. */
  22423. }, {
  22424. key: "cancelJob",
  22425. value: function cancelJob(identifier, jobId) {
  22426. this._get("".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/cancel"));
  22427. }
  22428. /**
  22429. * @function SuperMap.GeoprocessingService.prototype.getJobs
  22430. * @description 获取地理处理服务任务列表。
  22431. * @param {string} identifier - 地理处理工具ID。(传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  22432. */
  22433. }, {
  22434. key: "getJobs",
  22435. value: function getJobs(identifier) {
  22436. var url = "".concat(this.url, "/jobs");
  22437. if (identifier) {
  22438. url = "".concat(this.url, "/").concat(identifier, "/jobs");
  22439. }
  22440. this._get(url);
  22441. }
  22442. /**
  22443. * @function SuperMap.GeoprocessingService.prototype.getResults
  22444. * @description 地理处理工具执行的结果等,支持结果过滤。
  22445. * @param {string} identifier - 地理处理工具ID。
  22446. * @param {string} jobId - 地理处理任务ID。
  22447. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  22448. */
  22449. }, {
  22450. key: "getResults",
  22451. value: function getResults(identifier, jobId, filter) {
  22452. var url = "".concat(this.url, "/").concat(identifier, "/jobs/").concat(jobId, "/results");
  22453. if (filter) {
  22454. url = "".concat(url, "/").concat(filter);
  22455. }
  22456. this._get(url);
  22457. }
  22458. }, {
  22459. key: "_get",
  22460. value: function _get(url, paramter, serviceProcessCompleted, serviceProcessFailed) {
  22461. this.request({
  22462. url: url,
  22463. method: 'GET',
  22464. params: paramter,
  22465. headers: {
  22466. 'Content-type': 'application/json'
  22467. },
  22468. scope: this,
  22469. success: serviceProcessCompleted ? serviceProcessCompleted : this.serviceProcessCompleted,
  22470. failure: serviceProcessFailed ? serviceProcessFailed : this.serviceProcessFailed
  22471. });
  22472. }
  22473. }]);
  22474. return GeoprocessingService;
  22475. }(CommonServiceBase);
  22476. SuperMap.GeoprocessingService = GeoprocessingService_GeoprocessingService;
  22477. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystParameters.js
  22478. function GeoRelationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22479. 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); } }
  22480. function GeoRelationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22481. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22482. * This program are made available under the terms of the Apache License, Version 2.0
  22483. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22484. /**
  22485. * @class SuperMap.GeoRelationAnalystParameters
  22486. * @category iServer SpatialAnalyst GeoRelationAnalyst
  22487. * @classdesc 空间关系分析服务参数类。使用该类可以为空间关系分析服务提供所需的参数信息。
  22488. * @param {Object} options - 参数。
  22489. * @param {SuperMap.FilterParameter} options.sourceFilter - 空间关系分析中的源数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  22490. * @param {SuperMap.FilterParameter} options.referenceFilter - 空间关系分析中的参考数据集查询参数。仅 name, ids, attributeFilter 和 fields 字段有效。
  22491. * @param {SuperMap.SpatialRelationType} options.spatialRelationType - 指定的空间关系类型。
  22492. * @param {boolean} [options.isBorderInside] - 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  22493. * @param {boolean} [options.returnFeature] - 是否返回 Feature 信息。
  22494. * @param {boolean} [options.returnGeoRelatedOnly=true] - 仅返回满足指定空间关系的空间对象。
  22495. * @param {number} [options.startRecord=0] - 分析结果起始记录位置。
  22496. * @param {number} [options.expectCount=500] - 空间关系分析期望返回结果记录数,如果实际不足500条结果则返回所有分析结果。
  22497. */
  22498. var GeoRelationAnalystParameters = /*#__PURE__*/function () {
  22499. function GeoRelationAnalystParameters(options) {
  22500. GeoRelationAnalystParameters_classCallCheck(this, GeoRelationAnalystParameters);
  22501. /**
  22502. * @member {string} SuperMap.GeoRelationAnalystParameters.prototype.dataset
  22503. * @description 源数据集名称。
  22504. */
  22505. this.dataset = null;
  22506. /**
  22507. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.sourceFilter
  22508. * @description 空间关系分析中的源数据集查询参数。仅 ids、attributeFilter 和 fields 字段有效。
  22509. */
  22510. this.sourceFilter = null;
  22511. /**
  22512. * @member {SuperMap.FilterParameter} SuperMap.GeoRelationAnalystParameters.prototype.referenceFilter
  22513. * @description 空间关系分析中的参考数据集查询参数。仅 name,ids,attributeFilter 和 fields 字段有效。
  22514. */
  22515. this.referenceFilter = null;
  22516. /**
  22517. * @member {SuperMap.SpatialRelationType} SuperMap.GeoRelationAnalystParameters.prototype.spatialRelationType
  22518. * @description 指定的空间关系类型。
  22519. */
  22520. this.spatialRelationType = null;
  22521. /**
  22522. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.isBorderInside]
  22523. * @description 边界处理方式,即位于面边线上的点是否被面包含。此参数仅用于空间关系为包含或被包含的情况。
  22524. */
  22525. this.isBorderInside = null;
  22526. /**
  22527. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnFeature]
  22528. * @description 是否返回 Feature 信息。
  22529. */
  22530. this.returnFeature = null;
  22531. /**
  22532. * @member {boolean} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=true]
  22533. * @description 是否仅返回满足指定空间关系的空间对象。
  22534. */
  22535. this.returnGeoRelatedOnly = null;
  22536. /**
  22537. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.returnGeoRelatedOnly=0]
  22538. * @description 分析结果起始记录位置。
  22539. */
  22540. this.startRecord = 0;
  22541. /**
  22542. * @member {number} [SuperMap.GeoRelationAnalystParameters.prototype.expectCount=500]
  22543. * @description 空间关系分析期望返回结果记录数,如果实际不足 500 条结果则返回所有分析结果。
  22544. */
  22545. this.expectCount = 500;
  22546. if (options) {
  22547. Util.extend(this, options);
  22548. }
  22549. this.CLASS_NAME = "SuperMap.GeoRelationAnalystParameters";
  22550. }
  22551. /**
  22552. * @function SuperMap.GeoRelationAnalystParameters.prototype.destroy
  22553. * @description 释放资源,将引用资源的属性置空。
  22554. */
  22555. GeoRelationAnalystParameters_createClass(GeoRelationAnalystParameters, [{
  22556. key: "destroy",
  22557. value: function destroy() {
  22558. var me = this;
  22559. if (me.sourceFilter) {
  22560. me.sourceFilter.destroy();
  22561. }
  22562. me.sourceFilter = null;
  22563. if (me.referenceFilter) {
  22564. me.referenceFilter.destroy();
  22565. }
  22566. me.referenceFilter = null;
  22567. me.dataset = null;
  22568. me.spatialRelationType = null;
  22569. me.isBorderInside = null;
  22570. me.returnFeature = null;
  22571. me.returnGeoRelatedOnly = null;
  22572. me.startRecord = null;
  22573. me.expectCount = null;
  22574. }
  22575. }]);
  22576. return GeoRelationAnalystParameters;
  22577. }();
  22578. SuperMap.GeoRelationAnalystParameters = GeoRelationAnalystParameters;
  22579. ;// CONCATENATED MODULE: ./src/common/iServer/GeoRelationAnalystService.js
  22580. function GeoRelationAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoRelationAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoRelationAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoRelationAnalystService_typeof(obj); }
  22581. function GeoRelationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22582. 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); } }
  22583. function GeoRelationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoRelationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoRelationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  22584. function GeoRelationAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeoRelationAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeoRelationAnalystService_get(target, property, receiver || target); }
  22585. function GeoRelationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeoRelationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  22586. 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 } }); if (superClass) GeoRelationAnalystService_setPrototypeOf(subClass, superClass); }
  22587. function GeoRelationAnalystService_setPrototypeOf(o, p) { GeoRelationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoRelationAnalystService_setPrototypeOf(o, p); }
  22588. 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); }; }
  22589. function GeoRelationAnalystService_possibleConstructorReturn(self, call) { if (call && (GeoRelationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoRelationAnalystService_assertThisInitialized(self); }
  22590. function GeoRelationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22591. function GeoRelationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22592. function GeoRelationAnalystService_getPrototypeOf(o) { GeoRelationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoRelationAnalystService_getPrototypeOf(o); }
  22593. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22594. * This program are made available under the terms of the Apache License, Version 2.0
  22595. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22596. /**
  22597. * @class SuperMap.GeoRelationAnalystService
  22598. * @category iServer SpatialAnalyst GeoRelationAnalyst
  22599. * @classdesc 空间关系分析服务类。该类负责将客户设置的空间关系分析服务参数传递给服务端,并接收服务端返回的空间关系分析结果数据。
  22600. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  22601. * @param {Object} options - 参数。</br>
  22602. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  22603. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22604. * @param {Object} [options.headers] - 请求头。
  22605. * @extends {SuperMap.SpatialAnalystBase}
  22606. * @example 实例化该类如下例所示:
  22607. * (start code)
  22608. * function datasetGeoRelationAnalystProcess() {
  22609. * var referenceFilter = new SuperMap.FilterParameter({
  22610. * name:"Frame_R@Changchun",
  22611. * attributeFilter:"SmID>0"});
  22612. * var sourceFilter = new SuperMap.FilterParameter({
  22613. * attributeFilter:"SmID>0"});
  22614. * //初始化服务类
  22615. * var datasetGeoRelationService = new SuperMap.GeoRelationAnalystService(
  22616. * "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/"),
  22617. * //构建参数类
  22618. * datasetGeoRelationParameters = new SuperMap.GeoRelationAnalystParameters({
  22619. * dataset: "Park@Changchun",
  22620. * startRecord: 0,
  22621. * expectCount: 20,
  22622. * sourceFilter: sourceFilter,
  22623. * referenceFilter: referenceFilter,
  22624. * spatialRelationType: SuperMap.SpatialRelationType.INTERSECT,
  22625. * isBorderInside: true,
  22626. * returnFeature: true,
  22627. * returnGeoRelatedOnly: true
  22628. * });
  22629. * datasetGeoRelationService.events.on({
  22630. * "processCompleted": datasetGeoRelationAnalystCompleted,
  22631. * "processFailed": datasetGeoRelationAnalystFailed});
  22632. * //执行
  22633. * datasetGeoRelationService.processAsync(datasetGeoRelationParameters);
  22634. * }
  22635. * function Completed(datasetGeoRelationAnalystCompleted){//todo};
  22636. * function Error(datasetGeoRelationAnalystFailed){//todo};
  22637. * (end)
  22638. *
  22639. */
  22640. var GeoRelationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  22641. GeoRelationAnalystService_inherits(GeoRelationAnalystService, _SpatialAnalystBase);
  22642. var _super = GeoRelationAnalystService_createSuper(GeoRelationAnalystService);
  22643. function GeoRelationAnalystService(url, options) {
  22644. var _this;
  22645. GeoRelationAnalystService_classCallCheck(this, GeoRelationAnalystService);
  22646. _this = _super.call(this, url, options);
  22647. _this.CLASS_NAME = "SuperMap.GeoRelationAnalystService";
  22648. return _this;
  22649. }
  22650. /**
  22651. * @function SuperMap.GeoRelationAnalystService.prototype.destroy
  22652. * @override
  22653. */
  22654. GeoRelationAnalystService_createClass(GeoRelationAnalystService, [{
  22655. key: "destroy",
  22656. value: function destroy() {
  22657. GeoRelationAnalystService_get(GeoRelationAnalystService_getPrototypeOf(GeoRelationAnalystService.prototype), "destroy", this).call(this);
  22658. }
  22659. /**
  22660. * @function SuperMap.GeoRelationAnalystService.prototype.processAsync
  22661. * @description 负责将客户端的空间关系分析参数传递到服务端
  22662. * @param {SuperMap.GeoRelationAnalystParameters} parameter - 空间关系分析所需的参数信息。
  22663. */
  22664. }, {
  22665. key: "processAsync",
  22666. value: function processAsync(parameter) {
  22667. if (!(parameter instanceof GeoRelationAnalystParameters)) {
  22668. return;
  22669. }
  22670. var me = this;
  22671. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/georelation');
  22672. var jsonParameters = SuperMap.Util.toJSON(parameter);
  22673. me.url = Util.urlAppend(me.url, 'returnContent=true');
  22674. me.request({
  22675. method: "POST",
  22676. data: jsonParameters,
  22677. scope: me,
  22678. success: me.serviceProcessCompleted,
  22679. failure: me.serviceProcessFailed
  22680. });
  22681. }
  22682. }]);
  22683. return GeoRelationAnalystService;
  22684. }(SpatialAnalystBase);
  22685. SuperMap.GeoRelationAnalystService = GeoRelationAnalystService;
  22686. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesParametersBase.js
  22687. function GetFeaturesParametersBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22688. 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); } }
  22689. function GetFeaturesParametersBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesParametersBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesParametersBase_defineProperties(Constructor, staticProps); return Constructor; }
  22690. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22691. * This program are made available under the terms of the Apache License, Version 2.0
  22692. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22693. /**
  22694. * @class SuperMap.GetFeaturesParametersBase
  22695. * @category iServer Data FeatureResults
  22696. * @classdesc 要素查询参数基类。
  22697. * @param {Object} options - 参数。
  22698. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  22699. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  22700. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  22701. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  22702. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  22703. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22704. */
  22705. var GetFeaturesParametersBase = /*#__PURE__*/function () {
  22706. function GetFeaturesParametersBase(options) {
  22707. GetFeaturesParametersBase_classCallCheck(this, GetFeaturesParametersBase);
  22708. /**
  22709. * @member {Array.<string>} SuperMap.GetFeaturesParametersBase.prototype.datasetName
  22710. * @description 数据集集合中的数据集名称列表。
  22711. */
  22712. this.datasetNames = null;
  22713. /**
  22714. * @member {string} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  22715. * @description 动态投影的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。
  22716. */
  22717. this.targetEpsgCode = null;
  22718. /**
  22719. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.targetEpsgCode
  22720. * @description 动态投影的目标坐标系。使用时需设置 returnContent 参数为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22721. */
  22722. this.targetPrj = null;
  22723. /**
  22724. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnContent=true]
  22725. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  22726. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  22727. * 如果为 false,则返回的是查询结果资源的 URI。
  22728. */
  22729. this.returnContent = true;
  22730. /**
  22731. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.fromIndex=0]
  22732. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  22733. */
  22734. this.fromIndex = 0;
  22735. /**
  22736. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.toIndex=19]
  22737. * @description 查询结果的最大索引号。如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  22738. */
  22739. this.toIndex = 19;
  22740. /**
  22741. * @member {boolean} [SuperMap.GetFeaturesParametersBase.prototype.returnCountOnly=false]
  22742. * @description 只返回查询结果的总数。
  22743. */
  22744. this.returnCountOnly = false;
  22745. /**
  22746. * @member {number} [SuperMap.GetFeaturesParametersBase.prototype.maxFeatures=1000]
  22747. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  22748. */
  22749. this.maxFeatures = null;
  22750. /**
  22751. * @member {Object} SuperMap.GetFeaturesParametersBase.prototype.aggregations
  22752. * @description 聚合查询参数,该参数仅支持数据来源 Elasticsearch 服务的数据服务。
  22753. */
  22754. this.aggregations = null;
  22755. Util.extend(this, options);
  22756. this.CLASS_NAME = "SuperMap.GetFeaturesParametersBase";
  22757. }
  22758. /**
  22759. *
  22760. * @function SuperMap.GetFeaturesParametersBase.prototype.destroy
  22761. * @description 释放资源,将引用资源的属性置空。
  22762. */
  22763. GetFeaturesParametersBase_createClass(GetFeaturesParametersBase, [{
  22764. key: "destroy",
  22765. value: function destroy() {
  22766. var me = this;
  22767. me.datasetNames = null;
  22768. me.returnContent = null;
  22769. me.fromIndex = null;
  22770. me.toIndex = null;
  22771. me.maxFeatures = null;
  22772. me.targetEpsgCode = null;
  22773. me.targetPrj = null;
  22774. if (me.aggregation) {
  22775. me.aggregation = null;
  22776. }
  22777. }
  22778. }]);
  22779. return GetFeaturesParametersBase;
  22780. }();
  22781. SuperMap.GetFeaturesParametersBase = GetFeaturesParametersBase;
  22782. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsParameters.js
  22783. function GetFeaturesByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBoundsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBoundsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBoundsParameters_typeof(obj); }
  22784. function GetFeaturesByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22785. 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); } }
  22786. function GetFeaturesByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  22787. function GetFeaturesByBoundsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByBoundsParameters_get(target, property, receiver || target); }
  22788. function GetFeaturesByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  22789. 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 } }); if (superClass) GetFeaturesByBoundsParameters_setPrototypeOf(subClass, superClass); }
  22790. function GetFeaturesByBoundsParameters_setPrototypeOf(o, p) { GetFeaturesByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsParameters_setPrototypeOf(o, p); }
  22791. 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); }; }
  22792. function GetFeaturesByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsParameters_assertThisInitialized(self); }
  22793. function GetFeaturesByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22794. function GetFeaturesByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22795. function GetFeaturesByBoundsParameters_getPrototypeOf(o) { GetFeaturesByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsParameters_getPrototypeOf(o); }
  22796. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22797. * This program are made available under the terms of the Apache License, Version 2.0
  22798. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22799. /**
  22800. * @class SuperMap.GetFeaturesByBoundsParameters
  22801. * @category iServer Data FeatureResults
  22802. * @classdesc 数据集范围查询参数类,该类用于设置数据集范围查询的相关参数。
  22803. * @param {Object} options - 参数。
  22804. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 用于查询的范围对象。
  22805. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  22806. * @param {string} [options.attributeFilter] - 范围查询属性过滤条件。
  22807. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  22808. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  22809. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  22810. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  22811. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  22812. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  22813. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  22814. * @extends {SuperMap.GetFeaturesParametersBase}
  22815. */
  22816. var GetFeaturesByBoundsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  22817. GetFeaturesByBoundsParameters_inherits(GetFeaturesByBoundsParameters, _GetFeaturesParameter);
  22818. var _super = GetFeaturesByBoundsParameters_createSuper(GetFeaturesByBoundsParameters);
  22819. function GetFeaturesByBoundsParameters(options) {
  22820. var _this;
  22821. GetFeaturesByBoundsParameters_classCallCheck(this, GetFeaturesByBoundsParameters);
  22822. _this = _super.call(this, options);
  22823. /**
  22824. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.getFeatureMode
  22825. * @description 数据集查询模式。范围查询有 "BOUNDS","BOUNDS_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 BOUNDS_ATTRIBUTEFILTER 访问服务。
  22826. */
  22827. _this.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS;
  22828. /**
  22829. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.GetFeaturesByBoundsParameters.prototype.bounds
  22830. * @description 用于查询的范围对象。
  22831. *
  22832. */
  22833. _this.bounds = null;
  22834. /**
  22835. * @member {Array.<string>} SuperMap.GetFeaturesByBoundsParameters.prototype.fields
  22836. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  22837. */
  22838. _this.fields = null;
  22839. /**
  22840. * @member {string} SuperMap.GetFeaturesByBoundsParameters.prototype.attributeFilter
  22841. * @description 范围查询属性过滤条件。
  22842. */
  22843. _this.attributeFilter = null;
  22844. /**
  22845. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByBoundsParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  22846. * @description 空间查询模式常量。
  22847. */
  22848. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  22849. Util.extend(GetFeaturesByBoundsParameters_assertThisInitialized(_this), options);
  22850. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsParameters";
  22851. return _this;
  22852. }
  22853. /**
  22854. * @function SuperMap.GetFeaturesByBoundsParameters.prototype.destroy
  22855. * @override
  22856. */
  22857. GetFeaturesByBoundsParameters_createClass(GetFeaturesByBoundsParameters, [{
  22858. key: "destroy",
  22859. value: function destroy() {
  22860. GetFeaturesByBoundsParameters_get(GetFeaturesByBoundsParameters_getPrototypeOf(GetFeaturesByBoundsParameters.prototype), "destroy", this).call(this);
  22861. var me = this;
  22862. if (me.bounds) {
  22863. me.bounds.destroy();
  22864. me.bounds = null;
  22865. }
  22866. if (me.fields) {
  22867. while (me.fields.length > 0) {
  22868. me.fields.pop();
  22869. }
  22870. me.fields = null;
  22871. }
  22872. me.attributeFilter = null;
  22873. me.spatialQueryMode = null;
  22874. me.getFeatureMode = null;
  22875. }
  22876. /**
  22877. * @function SuperMap.GetFeaturesByBoundsParameters.toJsonParameters
  22878. * @description 将 {@link SuperMap.GetFeaturesByBoundsParameters} 对象参数转换为 JSON 字符串。
  22879. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 范围查询参数。
  22880. * @returns {string} 转化后的 JSON 字符串。
  22881. *
  22882. */
  22883. }], [{
  22884. key: "toJsonParameters",
  22885. value: function toJsonParameters(params) {
  22886. var filterParameter, bounds, parasByBounds;
  22887. bounds = {
  22888. "leftBottom": {
  22889. "x": params.bounds.left,
  22890. "y": params.bounds.bottom
  22891. },
  22892. "rightTop": {
  22893. "x": params.bounds.right,
  22894. "y": params.bounds.top
  22895. }
  22896. };
  22897. parasByBounds = {
  22898. datasetNames: params.datasetNames,
  22899. getFeatureMode: GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS,
  22900. bounds: bounds,
  22901. spatialQueryMode: params.spatialQueryMode
  22902. };
  22903. if (params.fields) {
  22904. filterParameter = new FilterParameter();
  22905. filterParameter.name = params.datasetNames;
  22906. filterParameter.fields = params.fields;
  22907. parasByBounds.queryParameter = filterParameter;
  22908. }
  22909. if (params.attributeFilter) {
  22910. parasByBounds.attributeFilter = params.attributeFilter;
  22911. parasByBounds.getFeatureMode = GetFeaturesByBoundsParameters.getFeatureMode.BOUNDS_ATTRIBUTEFILTER;
  22912. }
  22913. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  22914. parasByBounds.maxFeatures = params.maxFeatures;
  22915. }
  22916. if (params.targetEpsgCode) {
  22917. parasByBounds.targetEpsgCode = params.targetEpsgCode;
  22918. }
  22919. if (!params.targetEpsgCode && params.targetPrj) {
  22920. parasByBounds.targetPrj = params.targetPrj;
  22921. }
  22922. return Util.toJSON(parasByBounds);
  22923. }
  22924. }]);
  22925. return GetFeaturesByBoundsParameters;
  22926. }(GetFeaturesParametersBase);
  22927. GetFeaturesByBoundsParameters.getFeatureMode = {
  22928. "BOUNDS": "BOUNDS",
  22929. "BOUNDS_ATTRIBUTEFILTER": "BOUNDS_ATTRIBUTEFILTER"
  22930. };
  22931. SuperMap.GetFeaturesByBoundsParameters = GetFeaturesByBoundsParameters;
  22932. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesServiceBase.js
  22933. function GetFeaturesServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesServiceBase_typeof(obj); }
  22934. function GetFeaturesServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  22935. 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); } }
  22936. function GetFeaturesServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  22937. function GetFeaturesServiceBase_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesServiceBase_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesServiceBase_get(target, property, receiver || target); }
  22938. function GetFeaturesServiceBase_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesServiceBase_getPrototypeOf(object); if (object === null) break; } return object; }
  22939. 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 } }); if (superClass) GetFeaturesServiceBase_setPrototypeOf(subClass, superClass); }
  22940. function GetFeaturesServiceBase_setPrototypeOf(o, p) { GetFeaturesServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesServiceBase_setPrototypeOf(o, p); }
  22941. 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); }; }
  22942. function GetFeaturesServiceBase_possibleConstructorReturn(self, call) { if (call && (GetFeaturesServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesServiceBase_assertThisInitialized(self); }
  22943. function GetFeaturesServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  22944. function GetFeaturesServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  22945. function GetFeaturesServiceBase_getPrototypeOf(o) { GetFeaturesServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesServiceBase_getPrototypeOf(o); }
  22946. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  22947. * This program are made available under the terms of the Apache License, Version 2.0
  22948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  22949. /**
  22950. * @class SuperMap.GetFeaturesServiceBase
  22951. * @category iServer Data FeatureResults
  22952. * @classdesc 数据服务中数据集查询服务基类。获取结果数据类型为 Object。包含 result 属性,result 的数据格式根据 format 参数决定为 GeoJSON 或者 iServerJSON。
  22953. * @extends SuperMap.CommonServiceBase
  22954. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  22955. * URL应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/
  22956. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  22957. * @param {Object} options - 参数。
  22958. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  22959. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  22960. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  22961. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  22962. * @param {Object} [options.headers] - 请求头。
  22963. * @example
  22964. * var myService = new SuperMap.GetFeaturesServiceBase(url, {
  22965. * eventListeners: {
  22966. * "processCompleted": getFeatureCompleted,
  22967. * "processFailed": getFeatureError
  22968. * }
  22969. * });
  22970. */
  22971. var GetFeaturesServiceBase = /*#__PURE__*/function (_CommonServiceBase) {
  22972. GetFeaturesServiceBase_inherits(GetFeaturesServiceBase, _CommonServiceBase);
  22973. var _super = GetFeaturesServiceBase_createSuper(GetFeaturesServiceBase);
  22974. function GetFeaturesServiceBase(url, options) {
  22975. var _this;
  22976. GetFeaturesServiceBase_classCallCheck(this, GetFeaturesServiceBase);
  22977. _this = _super.call(this, url, options);
  22978. options = options || {};
  22979. /**
  22980. * @member {boolean} [SuperMap.GetFeaturesServiceBase.prototype.returnContent=true]
  22981. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  22982. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  22983. * 如果为 false,则返回的是查询结果资源的 URI。
  22984. */
  22985. _this.returnContent = true;
  22986. /**
  22987. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.fromIndex=0]
  22988. * @description 查询结果的最小索引号。如果该值大于查询结果的最大索引号,则查询结果为空。
  22989. */
  22990. _this.fromIndex = 0;
  22991. /**
  22992. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.toIndex=19]
  22993. * @description 查询结果的最大索引号。
  22994. * 如果该值大于查询结果的最大索引号,则以查询结果的最大索引号为终止索引号。
  22995. */
  22996. _this.toIndex = 19;
  22997. /**
  22998. * @member {number} [SuperMap.GetFeaturesServiceBase.prototype.maxFeatures=1000]
  22999. * @description 进行 SQL 查询时,用于设置服务端返回查询结果条目数量。
  23000. */
  23001. _this.maxFeatures = null;
  23002. /**
  23003. * @member {string} [SuperMap.GetFeaturesServiceBase.prototype.format=SuperMap.DataFormat.GEOJSON]
  23004. * @description 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。
  23005. * 参数格式为 "ISERVER","GEOJSON"。
  23006. */
  23007. _this.format = DataFormat.GEOJSON;
  23008. Util.extend(GetFeaturesServiceBase_assertThisInitialized(_this), options);
  23009. _this.url = Util.urlPathAppend(_this.url, 'featureResults');
  23010. _this.CLASS_NAME = "SuperMap.GetFeaturesServiceBase";
  23011. return _this;
  23012. }
  23013. /**
  23014. * @function SuperMap.GetFeaturesServiceBase.prototype.destroy
  23015. * @description 释放资源,将引用资源的属性置空。
  23016. */
  23017. GetFeaturesServiceBase_createClass(GetFeaturesServiceBase, [{
  23018. key: "destroy",
  23019. value: function destroy() {
  23020. GetFeaturesServiceBase_get(GetFeaturesServiceBase_getPrototypeOf(GetFeaturesServiceBase.prototype), "destroy", this).call(this);
  23021. var me = this;
  23022. me.returnContent = null;
  23023. me.fromIndex = null;
  23024. me.toIndex = null;
  23025. me.maxFeatures = null;
  23026. me.format = null;
  23027. }
  23028. /**
  23029. * @function SuperMap.GetFeaturesServiceBase.prototype.processAsync
  23030. * @description 将客户端的查询参数传递到服务端。
  23031. * @param {Object} params - 查询参数。
  23032. */
  23033. }, {
  23034. key: "processAsync",
  23035. value: function processAsync(params) {
  23036. if (!params) {
  23037. return;
  23038. }
  23039. var me = this,
  23040. jsonParameters = null,
  23041. firstPara = true;
  23042. me.returnContent = params.returnContent;
  23043. me.fromIndex = params.fromIndex;
  23044. me.toIndex = params.toIndex;
  23045. me.maxFeatures = params.maxFeatures;
  23046. if (me.returnContent) {
  23047. me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  23048. firstPara = false;
  23049. }
  23050. var isValidNumber = me.fromIndex != null && me.toIndex != null && !isNaN(me.fromIndex) && !isNaN(me.toIndex);
  23051. if (isValidNumber && me.fromIndex >= 0 && me.toIndex >= 0 && !firstPara) {
  23052. me.url = Util.urlAppend(me.url, "fromIndex=".concat(me.fromIndex, "&toIndex=").concat(me.toIndex));
  23053. }
  23054. if (params.returnCountOnly) {
  23055. me.url = Util.urlAppend(me.url, "&returnCountOnly=" + params.returnContent);
  23056. }
  23057. jsonParameters = me.getJsonParameters(params);
  23058. me.request({
  23059. method: "POST",
  23060. data: jsonParameters,
  23061. scope: me,
  23062. success: me.serviceProcessCompleted,
  23063. failure: me.serviceProcessFailed
  23064. });
  23065. }
  23066. /**
  23067. * @function SuperMap.GetFeaturesServiceBase.prototype.getFeatureComplete
  23068. * @description 查询完成,执行此方法。
  23069. * @param {Object} result - 服务器返回的结果对象。
  23070. */
  23071. }, {
  23072. key: "serviceProcessCompleted",
  23073. value: function serviceProcessCompleted(result) {
  23074. var me = this;
  23075. result = Util.transformResult(result);
  23076. if (me.format === DataFormat.GEOJSON && result.features) {
  23077. var geoJSONFormat = new GeoJSON();
  23078. result.features = geoJSONFormat.toGeoJSON(result.features);
  23079. }
  23080. me.events.triggerEvent("processCompleted", {
  23081. result: result
  23082. });
  23083. }
  23084. }]);
  23085. return GetFeaturesServiceBase;
  23086. }(CommonServiceBase);
  23087. SuperMap.GetFeaturesServiceBase = GetFeaturesServiceBase;
  23088. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBoundsService.js
  23089. function GetFeaturesByBoundsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBoundsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBoundsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBoundsService_typeof(obj); }
  23090. function GetFeaturesByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23091. 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); } }
  23092. function GetFeaturesByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  23093. function GetFeaturesByBoundsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBoundsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByBoundsService_get(target, property, receiver || target); }
  23094. function GetFeaturesByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23095. 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 } }); if (superClass) GetFeaturesByBoundsService_setPrototypeOf(subClass, superClass); }
  23096. function GetFeaturesByBoundsService_setPrototypeOf(o, p) { GetFeaturesByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBoundsService_setPrototypeOf(o, p); }
  23097. 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); }; }
  23098. function GetFeaturesByBoundsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBoundsService_assertThisInitialized(self); }
  23099. function GetFeaturesByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23100. function GetFeaturesByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23101. function GetFeaturesByBoundsService_getPrototypeOf(o) { GetFeaturesByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBoundsService_getPrototypeOf(o); }
  23102. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23103. * This program are made available under the terms of the Apache License, Version 2.0
  23104. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23105. /**
  23106. * @class SuperMap.GetFeaturesByBoundsService
  23107. * @category iServer Data FeatureResults
  23108. * @classdesc 数据集范围查询服务类,查询与指定范围对象符合一定空间关系的矢量要素。
  23109. * @description 数据集范围查询服务类构造函数。
  23110. * @extends {SuperMap.GetFeaturesServiceBase}
  23111. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  23112. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23113. * @param {Object} options - 参数。
  23114. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  23115. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23116. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23117. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23118. * @param {Object} [options.headers] - 请求头。
  23119. * @example
  23120. * var myGetFeaturesByBoundsService = new SuperMa.GetFeaturesByBoundsService(url, {
  23121. * eventListeners: {
  23122. * "processCompleted": getFeatureCompleted,
  23123. * "processFailed": getFeatureError
  23124. * }
  23125. * });
  23126. * function getFeatureCompleted(object){//todo};
  23127. * function getFeatureError(object){//todo}
  23128. */
  23129. var GetFeaturesByBoundsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23130. GetFeaturesByBoundsService_inherits(GetFeaturesByBoundsService, _GetFeaturesServiceBa);
  23131. var _super = GetFeaturesByBoundsService_createSuper(GetFeaturesByBoundsService);
  23132. function GetFeaturesByBoundsService(url, options) {
  23133. var _this;
  23134. GetFeaturesByBoundsService_classCallCheck(this, GetFeaturesByBoundsService);
  23135. _this = _super.call(this, url, options);
  23136. _this.CLASS_NAME = "SuperMap.GetFeaturesByBoundsService";
  23137. return _this;
  23138. }
  23139. /**
  23140. * @function SuperMap.GetFeaturesByBoundsService.prototype.destroy
  23141. * @override
  23142. */
  23143. GetFeaturesByBoundsService_createClass(GetFeaturesByBoundsService, [{
  23144. key: "destroy",
  23145. value: function destroy() {
  23146. GetFeaturesByBoundsService_get(GetFeaturesByBoundsService_getPrototypeOf(GetFeaturesByBoundsService.prototype), "destroy", this).call(this);
  23147. }
  23148. /**
  23149. * @function SuperMap.GetFeaturesByBoundsService.prototype.getJsonParameters
  23150. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry,Bounds等)。
  23151. * @param params {SuperMap.GetFeaturesByBoundsParameters}
  23152. * @returns {string} 转化后的 JSON 字符串。
  23153. *
  23154. */
  23155. }, {
  23156. key: "getJsonParameters",
  23157. value: function getJsonParameters(params) {
  23158. return GetFeaturesByBoundsParameters.toJsonParameters(params);
  23159. }
  23160. }]);
  23161. return GetFeaturesByBoundsService;
  23162. }(GetFeaturesServiceBase);
  23163. SuperMap.GetFeaturesByBoundsService = GetFeaturesByBoundsService;
  23164. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferParameters.js
  23165. function GetFeaturesByBufferParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBufferParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBufferParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBufferParameters_typeof(obj); }
  23166. function GetFeaturesByBufferParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23167. 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); } }
  23168. function GetFeaturesByBufferParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23169. function GetFeaturesByBufferParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByBufferParameters_get(target, property, receiver || target); }
  23170. function GetFeaturesByBufferParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23171. 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 } }); if (superClass) GetFeaturesByBufferParameters_setPrototypeOf(subClass, superClass); }
  23172. function GetFeaturesByBufferParameters_setPrototypeOf(o, p) { GetFeaturesByBufferParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferParameters_setPrototypeOf(o, p); }
  23173. 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); }; }
  23174. function GetFeaturesByBufferParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferParameters_assertThisInitialized(self); }
  23175. function GetFeaturesByBufferParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23176. function GetFeaturesByBufferParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23177. function GetFeaturesByBufferParameters_getPrototypeOf(o) { GetFeaturesByBufferParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferParameters_getPrototypeOf(o); }
  23178. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23179. * This program are made available under the terms of the Apache License, Version 2.0
  23180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23181. /**
  23182. * @class SuperMap.GetFeaturesByBufferParameters
  23183. * @category iServer Data FeatureResults
  23184. * @classdesc 数据服务中数据集缓冲区查询参数类。
  23185. * @param {Object} options - 参数。
  23186. * @param {number} options.bufferDistance - buffer 距离,单位与所查询图层对应的数据集单位相同。
  23187. * @param {Object} options.geometry - 空间查询条件。</br>
  23188. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  23189. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23190. * @param {string} [options.attributeFilter] - 属性查询条件。
  23191. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23192. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23193. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23194. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23195. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23196. * @extends {SuperMap.GetFeaturesParametersBase}
  23197. */
  23198. var GetFeaturesByBufferParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23199. GetFeaturesByBufferParameters_inherits(GetFeaturesByBufferParameters, _GetFeaturesParameter);
  23200. var _super = GetFeaturesByBufferParameters_createSuper(GetFeaturesByBufferParameters);
  23201. function GetFeaturesByBufferParameters(options) {
  23202. var _this;
  23203. GetFeaturesByBufferParameters_classCallCheck(this, GetFeaturesByBufferParameters);
  23204. _this = _super.call(this, options);
  23205. /**
  23206. * @member {number} SuperMap.GetFeaturesByBufferParameters.prototype.bufferDistance
  23207. * @description buffer 距离,单位与所查询图层对应的数据集单位相同。
  23208. */
  23209. _this.bufferDistance = null;
  23210. /**
  23211. * @member {string} SuperMap.GetFeaturesByBufferParameters.prototype.attributeFilter
  23212. * @description 属性查询条件。
  23213. */
  23214. _this.attributeFilter = null;
  23215. /**
  23216. * @member {Object} SuperMap.GetFeaturesByBufferParameters.prototype.geometry
  23217. * @description 空间查询条件。 <br>
  23218. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  23219. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  23220. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  23221. */
  23222. _this.geometry = null;
  23223. /**
  23224. * @member {Array.<string>} SuperMap.GetFeaturesByBufferParameters.prototype.fields
  23225. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23226. */
  23227. _this.fields = null;
  23228. Util.extend(GetFeaturesByBufferParameters_assertThisInitialized(_this), options);
  23229. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferParameters";
  23230. return _this;
  23231. }
  23232. /**
  23233. * @function SuperMap.GetFeaturesByBufferParameters.prototype.destroy
  23234. * @override
  23235. */
  23236. GetFeaturesByBufferParameters_createClass(GetFeaturesByBufferParameters, [{
  23237. key: "destroy",
  23238. value: function destroy() {
  23239. GetFeaturesByBufferParameters_get(GetFeaturesByBufferParameters_getPrototypeOf(GetFeaturesByBufferParameters.prototype), "destroy", this).call(this);
  23240. var me = this;
  23241. me.bufferDistance = null;
  23242. me.attributeFilter = null;
  23243. if (me.fields) {
  23244. while (me.fields.length > 0) {
  23245. me.fields.pop();
  23246. }
  23247. me.fields = null;
  23248. }
  23249. if (me.geometry) {
  23250. me.geometry.destroy();
  23251. me.geometry = null;
  23252. }
  23253. }
  23254. /**
  23255. * @function SuperMap.GetFeaturesByBufferParameters.toJsonParameters
  23256. * @description 将 SuperMap.GetFeaturesByBufferParameters 对象转换为 JSON 字符串。
  23257. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数对象。
  23258. * @returns {string} 转化后的 JSON 字符串。
  23259. */
  23260. }], [{
  23261. key: "toJsonParameters",
  23262. value: function toJsonParameters(params) {
  23263. var filterParameter, paramsBySql, geometry;
  23264. geometry = ServerGeometry.fromGeometry(params.geometry);
  23265. paramsBySql = {
  23266. datasetNames: params.datasetNames,
  23267. getFeatureMode: "BUFFER",
  23268. bufferDistance: params.bufferDistance,
  23269. geometry: geometry
  23270. };
  23271. if (params.fields) {
  23272. filterParameter = new FilterParameter();
  23273. filterParameter.name = params.datasetNames;
  23274. filterParameter.fields = params.fields;
  23275. paramsBySql.queryParameter = filterParameter;
  23276. }
  23277. if (params.attributeFilter) {
  23278. paramsBySql.attributeFilter = params.attributeFilter;
  23279. paramsBySql.getFeatureMode = "BUFFER_ATTRIBUTEFILTER";
  23280. }
  23281. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23282. paramsBySql.maxFeatures = params.maxFeatures;
  23283. }
  23284. if (params.targetEpsgCode) {
  23285. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  23286. }
  23287. if (!params.targetEpsgCode && params.targetPrj) {
  23288. paramsBySql.targetPrj = params.targetPrj;
  23289. }
  23290. return Util.toJSON(paramsBySql);
  23291. }
  23292. }]);
  23293. return GetFeaturesByBufferParameters;
  23294. }(GetFeaturesParametersBase);
  23295. SuperMap.GetFeaturesByBufferParameters = GetFeaturesByBufferParameters;
  23296. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByBufferService.js
  23297. function GetFeaturesByBufferService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByBufferService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByBufferService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByBufferService_typeof(obj); }
  23298. function GetFeaturesByBufferService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23299. 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); } }
  23300. function GetFeaturesByBufferService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByBufferService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByBufferService_defineProperties(Constructor, staticProps); return Constructor; }
  23301. function GetFeaturesByBufferService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByBufferService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByBufferService_get(target, property, receiver || target); }
  23302. function GetFeaturesByBufferService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByBufferService_getPrototypeOf(object); if (object === null) break; } return object; }
  23303. 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 } }); if (superClass) GetFeaturesByBufferService_setPrototypeOf(subClass, superClass); }
  23304. function GetFeaturesByBufferService_setPrototypeOf(o, p) { GetFeaturesByBufferService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByBufferService_setPrototypeOf(o, p); }
  23305. 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); }; }
  23306. function GetFeaturesByBufferService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByBufferService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByBufferService_assertThisInitialized(self); }
  23307. function GetFeaturesByBufferService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23308. function GetFeaturesByBufferService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23309. function GetFeaturesByBufferService_getPrototypeOf(o) { GetFeaturesByBufferService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByBufferService_getPrototypeOf(o); }
  23310. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23311. * This program are made available under the terms of the Apache License, Version 2.0
  23312. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23313. /**
  23314. * @class SuperMap.GetFeaturesByBufferService
  23315. * @category iServer Data FeatureResults
  23316. * @classdesc 数据服务中数据集缓冲区查询服务类。
  23317. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  23318. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;
  23319. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23320. * @param {Object} options - 参数。
  23321. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23322. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23323. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23324. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23325. * @param {Object} [options.headers] - 请求头。
  23326. * @extends {SuperMap.GetFeaturesServiceBase}
  23327. * @example
  23328. * var myGetFeaturesByBufferService = new SuperMap.GetFeaturesByBufferService(url, {
  23329. * eventListeners: {
  23330. * "processCompleted": GetFeaturesCompleted,
  23331. * "processFailed": GetFeaturesError
  23332. * }
  23333. * });
  23334. * function GetFeaturesCompleted(object){//todo};
  23335. * function GetFeaturesError(object){//todo};
  23336. */
  23337. var GetFeaturesByBufferService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23338. GetFeaturesByBufferService_inherits(GetFeaturesByBufferService, _GetFeaturesServiceBa);
  23339. var _super = GetFeaturesByBufferService_createSuper(GetFeaturesByBufferService);
  23340. function GetFeaturesByBufferService(url, options) {
  23341. var _this;
  23342. GetFeaturesByBufferService_classCallCheck(this, GetFeaturesByBufferService);
  23343. _this = _super.call(this, url, options);
  23344. _this.CLASS_NAME = "SuperMap.GetFeaturesByBufferService";
  23345. return _this;
  23346. }
  23347. /**
  23348. * @function SuperMap.GetFeaturesByBufferService.prototype.destroy
  23349. * @override
  23350. */
  23351. GetFeaturesByBufferService_createClass(GetFeaturesByBufferService, [{
  23352. key: "destroy",
  23353. value: function destroy() {
  23354. GetFeaturesByBufferService_get(GetFeaturesByBufferService_getPrototypeOf(GetFeaturesByBufferService.prototype), "destroy", this).call(this);
  23355. }
  23356. /**
  23357. * @function SuperMap.GetFeaturesByBufferService.prototype.getJsonParameters
  23358. * @description 将查询参数转化为 JSON 字符串。在本类中重写此方法,可以实现不同种类的查询(IDs, SQL, Buffer, Geometry等)。
  23359. * @param {SuperMap.GetFeaturesByBufferParameters} params - 数据集缓冲区查询参数类。
  23360. * @returns {Object} 转化后的 JSON 字符串。
  23361. */
  23362. }, {
  23363. key: "getJsonParameters",
  23364. value: function getJsonParameters(params) {
  23365. if (!(params instanceof GetFeaturesByBufferParameters)) {
  23366. return;
  23367. }
  23368. return SuperMap.GetFeaturesByBufferParameters.toJsonParameters(params);
  23369. }
  23370. }]);
  23371. return GetFeaturesByBufferService;
  23372. }(GetFeaturesServiceBase);
  23373. SuperMap.GetFeaturesByBufferService = GetFeaturesByBufferService;
  23374. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryParameters.js
  23375. function GetFeaturesByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByGeometryParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByGeometryParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByGeometryParameters_typeof(obj); }
  23376. function GetFeaturesByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23377. 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); } }
  23378. function GetFeaturesByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23379. function GetFeaturesByGeometryParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByGeometryParameters_get(target, property, receiver || target); }
  23380. function GetFeaturesByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23381. 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 } }); if (superClass) GetFeaturesByGeometryParameters_setPrototypeOf(subClass, superClass); }
  23382. function GetFeaturesByGeometryParameters_setPrototypeOf(o, p) { GetFeaturesByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryParameters_setPrototypeOf(o, p); }
  23383. 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); }; }
  23384. function GetFeaturesByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryParameters_assertThisInitialized(self); }
  23385. function GetFeaturesByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23386. function GetFeaturesByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23387. function GetFeaturesByGeometryParameters_getPrototypeOf(o) { GetFeaturesByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryParameters_getPrototypeOf(o); }
  23388. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23389. * This program are made available under the terms of the Apache License, Version 2.0
  23390. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23391. /**
  23392. * @class SuperMap.GetFeaturesByGeometryParameters
  23393. * @category iServer Data FeatureResults
  23394. * @classdesc 数据集几何查询参数类。该类用于设置数据集几何查询的相关参数。
  23395. * @param {Object} options - 参数。
  23396. * @param {Object} options.geometry - 用于查询的几何对象。
  23397. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  23398. * @param {string} [options.attributeFilter] - 几何查询属性过滤条件。
  23399. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23400. * @param {SuperMap.SpatialQueryMode} [options.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式常量。
  23401. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23402. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23403. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23404. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23405. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23406. * @extends {SuperMap.GetFeaturesParametersBase}
  23407. */
  23408. var GetFeaturesByGeometryParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23409. GetFeaturesByGeometryParameters_inherits(GetFeaturesByGeometryParameters, _GetFeaturesParameter);
  23410. var _super = GetFeaturesByGeometryParameters_createSuper(GetFeaturesByGeometryParameters);
  23411. function GetFeaturesByGeometryParameters(options) {
  23412. var _this;
  23413. GetFeaturesByGeometryParameters_classCallCheck(this, GetFeaturesByGeometryParameters);
  23414. _this = _super.call(this, options);
  23415. /**
  23416. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.getFeatureMode
  23417. * @description 数据集查询模式。几何查询有 "SPATIAL","SPATIAL_ATTRIBUTEFILTER" 两种,当用户设置 attributeFilter 时会自动切换到 SPATIAL_ATTRIBUTEFILTER 访问服务。
  23418. */
  23419. _this.getFeatureMode = "SPATIAL";
  23420. /**
  23421. * @member {Object} SuperMap.GetFeaturesByGeometryParameters.prototype.geometry
  23422. * @description 用于查询的几何对象。 </br>
  23423. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。</br>
  23424. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。</br>
  23425. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  23426. */
  23427. _this.geometry = null;
  23428. /**
  23429. * @member {Array.<string>} SuperMap.GetFeaturesByGeometryParameters.prototype.fields
  23430. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23431. */
  23432. _this.fields = null;
  23433. /**
  23434. * @member {string} SuperMap.GetFeaturesByGeometryParameters.prototype.attributeFilter
  23435. * @description 几何查询属性过滤条件。
  23436. */
  23437. _this.attributeFilter = null;
  23438. /**
  23439. * @member {SuperMap.SpatialQueryMode} [SuperMap.GetFeaturesByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.CONTAIN]
  23440. * @description 空间查询模式常量。
  23441. */
  23442. _this.spatialQueryMode = SpatialQueryMode.CONTAIN;
  23443. Util.extend(GetFeaturesByGeometryParameters_assertThisInitialized(_this), options);
  23444. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryParameters";
  23445. return _this;
  23446. }
  23447. /**
  23448. * @function SuperMap.GetFeaturesByGeometryParameters.prototype.destroy
  23449. * @description 释放资源,将引用资源的属性置空。
  23450. */
  23451. GetFeaturesByGeometryParameters_createClass(GetFeaturesByGeometryParameters, [{
  23452. key: "destroy",
  23453. value: function destroy() {
  23454. GetFeaturesByGeometryParameters_get(GetFeaturesByGeometryParameters_getPrototypeOf(GetFeaturesByGeometryParameters.prototype), "destroy", this).call(this);
  23455. var me = this;
  23456. if (me.geometry) {
  23457. me.geometry.destroy();
  23458. me.geometry = null;
  23459. }
  23460. if (me.fields) {
  23461. while (me.fields.length > 0) {
  23462. me.fields.pop();
  23463. }
  23464. me.fields = null;
  23465. }
  23466. me.attributeFilter = null;
  23467. me.spatialQueryMode = null;
  23468. me.getFeatureMode = null;
  23469. }
  23470. /**
  23471. * @function SuperMap.GetFeaturesByGeometryParameters.toJsonParameters
  23472. * @description 将 SuperMap.GetFeaturesByGeometryParameters 对象参数转换为 JSON 字符串。
  23473. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询参数对象。
  23474. * @returns {string} 转化后的 JSON 字符串。
  23475. */
  23476. }], [{
  23477. key: "toJsonParameters",
  23478. value: function toJsonParameters(params) {
  23479. var filterParameter, geometry, parasByGeometry;
  23480. geometry = ServerGeometry.fromGeometry(params.geometry);
  23481. parasByGeometry = {
  23482. datasetNames: params.datasetNames,
  23483. getFeatureMode: "SPATIAL",
  23484. geometry: geometry,
  23485. spatialQueryMode: params.spatialQueryMode
  23486. };
  23487. if (params.fields) {
  23488. filterParameter = new FilterParameter();
  23489. filterParameter.name = params.datasetNames;
  23490. filterParameter.fields = params.fields;
  23491. parasByGeometry.queryParameter = filterParameter;
  23492. }
  23493. if (params.attributeFilter) {
  23494. parasByGeometry.attributeFilter = params.attributeFilter;
  23495. parasByGeometry.getFeatureMode = "SPATIAL_ATTRIBUTEFILTER";
  23496. }
  23497. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23498. parasByGeometry.maxFeatures = params.maxFeatures;
  23499. }
  23500. if (params.targetEpsgCode) {
  23501. parasByGeometry.targetEpsgCode = params.targetEpsgCode;
  23502. }
  23503. if (!params.targetEpsgCode && params.targetPrj) {
  23504. parasByGeometry.targetPrj = params.targetPrj;
  23505. }
  23506. return Util.toJSON(parasByGeometry);
  23507. }
  23508. }]);
  23509. return GetFeaturesByGeometryParameters;
  23510. }(GetFeaturesParametersBase);
  23511. SuperMap.GetFeaturesByGeometryParameters = GetFeaturesByGeometryParameters;
  23512. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByGeometryService.js
  23513. function GetFeaturesByGeometryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByGeometryService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByGeometryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByGeometryService_typeof(obj); }
  23514. function GetFeaturesByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23515. 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); } }
  23516. function GetFeaturesByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  23517. function GetFeaturesByGeometryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByGeometryService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByGeometryService_get(target, property, receiver || target); }
  23518. function GetFeaturesByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  23519. 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 } }); if (superClass) GetFeaturesByGeometryService_setPrototypeOf(subClass, superClass); }
  23520. function GetFeaturesByGeometryService_setPrototypeOf(o, p) { GetFeaturesByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByGeometryService_setPrototypeOf(o, p); }
  23521. 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); }; }
  23522. function GetFeaturesByGeometryService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByGeometryService_assertThisInitialized(self); }
  23523. function GetFeaturesByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23524. function GetFeaturesByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23525. function GetFeaturesByGeometryService_getPrototypeOf(o) { GetFeaturesByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByGeometryService_getPrototypeOf(o); }
  23526. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23527. * This program are made available under the terms of the Apache License, Version 2.0
  23528. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23529. /**
  23530. * @class SuperMap.GetFeaturesByGeometryService
  23531. * @category iServer Data FeatureResults
  23532. * @classdesc 数据集几何查询服务类,查询与指定几何对象符合一定空间关系的矢量要素。
  23533. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  23534. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data;
  23535. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data"
  23536. * @param {Object} options - 参数。</br>
  23537. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23538. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23539. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23540. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23541. * @param {Object} [options.headers] - 请求头。
  23542. * @extends {SuperMap.GetFeaturesServiceBase}
  23543. * @example
  23544. * var myService = new SuperMap.GetFeaturesByGeometryService(url, {
  23545. * eventListeners: {
  23546. * "processCompleted": getFeatureCompleted,
  23547. * "processFailed": getFeatureError
  23548. * }
  23549. * });
  23550. * function getFeatureCompleted(object){//todo};
  23551. * function getFeatureError(object){//todo}
  23552. */
  23553. var GetFeaturesByGeometryService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23554. GetFeaturesByGeometryService_inherits(GetFeaturesByGeometryService, _GetFeaturesServiceBa);
  23555. var _super = GetFeaturesByGeometryService_createSuper(GetFeaturesByGeometryService);
  23556. function GetFeaturesByGeometryService(url, options) {
  23557. var _this;
  23558. GetFeaturesByGeometryService_classCallCheck(this, GetFeaturesByGeometryService);
  23559. _this = _super.call(this, url, options);
  23560. _this.CLASS_NAME = "SuperMap.GetFeaturesByGeometryService";
  23561. return _this;
  23562. }
  23563. /**
  23564. * @function SuperMap.GetFeaturesByGeometryService.prototype.destroy
  23565. * @override
  23566. */
  23567. GetFeaturesByGeometryService_createClass(GetFeaturesByGeometryService, [{
  23568. key: "destroy",
  23569. value: function destroy() {
  23570. GetFeaturesByGeometryService_get(GetFeaturesByGeometryService_getPrototypeOf(GetFeaturesByGeometryService.prototype), "destroy", this).call(this);
  23571. }
  23572. /**
  23573. * @function SuperMap.GetFeaturesByGeometryService.prototype.getJsonParameters
  23574. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 数据集几何查询参数类。
  23575. * @description 将查询参数转化为 JSON 字符串。
  23576. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  23577. * @returns {Object} 转化后的 JSON 字符串。
  23578. */
  23579. }, {
  23580. key: "getJsonParameters",
  23581. value: function getJsonParameters(params) {
  23582. return GetFeaturesByGeometryParameters.toJsonParameters(params);
  23583. }
  23584. }]);
  23585. return GetFeaturesByGeometryService;
  23586. }(GetFeaturesServiceBase);
  23587. SuperMap.GetFeaturesByGeometryService = GetFeaturesByGeometryService;
  23588. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsParameters.js
  23589. function GetFeaturesByIDsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByIDsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByIDsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByIDsParameters_typeof(obj); }
  23590. function GetFeaturesByIDsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23591. 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); } }
  23592. function GetFeaturesByIDsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23593. function GetFeaturesByIDsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByIDsParameters_get(target, property, receiver || target); }
  23594. function GetFeaturesByIDsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23595. 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 } }); if (superClass) GetFeaturesByIDsParameters_setPrototypeOf(subClass, superClass); }
  23596. function GetFeaturesByIDsParameters_setPrototypeOf(o, p) { GetFeaturesByIDsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsParameters_setPrototypeOf(o, p); }
  23597. 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); }; }
  23598. function GetFeaturesByIDsParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsParameters_assertThisInitialized(self); }
  23599. function GetFeaturesByIDsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23600. function GetFeaturesByIDsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23601. function GetFeaturesByIDsParameters_getPrototypeOf(o) { GetFeaturesByIDsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsParameters_getPrototypeOf(o); }
  23602. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23603. * This program are made available under the terms of the Apache License, Version 2.0
  23604. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23605. /**
  23606. * @class SuperMap.GetFeaturesByIDsParameters
  23607. * @category iServer Data FeatureResults
  23608. * @classdesc ID查询参数类。
  23609. * @param {Object} options - 参数。
  23610. * @param {Array.<number>} options.IDs - 所要查询指定的元素 ID 信息。
  23611. * @param {Array.<string>} [options.fields] - 设置查询结果返回字段。默认返回所有字段。
  23612. * @param {Array.<string>} options.dataSetNames - 数据集集合中的数据集名称列表。
  23613. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23614. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23615. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23616. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23617. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23618. * @extends {SuperMap.GetFeaturesParametersBase}
  23619. */
  23620. var GetFeaturesByIDsParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23621. GetFeaturesByIDsParameters_inherits(GetFeaturesByIDsParameters, _GetFeaturesParameter);
  23622. var _super = GetFeaturesByIDsParameters_createSuper(GetFeaturesByIDsParameters);
  23623. function GetFeaturesByIDsParameters(options) {
  23624. var _this;
  23625. GetFeaturesByIDsParameters_classCallCheck(this, GetFeaturesByIDsParameters);
  23626. _this = _super.call(this, options);
  23627. /**
  23628. * @member {string} SuperMap.GetFeaturesByIDsParameters.prototype.getFeatureMode
  23629. * @description 数据集查询模式。
  23630. */
  23631. _this.getFeatureMode = "ID";
  23632. /**
  23633. * @member {Array.<number>} SuperMap.GetFeaturesByIDsParameters.prototype.IDs
  23634. * @description 所要查询指定的元素 ID 信息。
  23635. */
  23636. _this.IDs = null;
  23637. /**
  23638. * @member {Array.<string>} SuperMap.GetFeaturesByIDsParameters.prototype.fields
  23639. * @description 设置查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。
  23640. */
  23641. _this.fields = null;
  23642. Util.extend(GetFeaturesByIDsParameters_assertThisInitialized(_this), options);
  23643. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsParameters";
  23644. return _this;
  23645. }
  23646. /**
  23647. * @function SuperMap.GetFeaturesByIDsParameters.prototype.destroy
  23648. * @override
  23649. */
  23650. GetFeaturesByIDsParameters_createClass(GetFeaturesByIDsParameters, [{
  23651. key: "destroy",
  23652. value: function destroy() {
  23653. GetFeaturesByIDsParameters_get(GetFeaturesByIDsParameters_getPrototypeOf(GetFeaturesByIDsParameters.prototype), "destroy", this).call(this);
  23654. var me = this;
  23655. me.IDs = null;
  23656. me.getFeatureMode = null;
  23657. if (me.fields) {
  23658. while (me.fields.length > 0) {
  23659. me.fields.pop();
  23660. }
  23661. me.fields = null;
  23662. }
  23663. }
  23664. /**
  23665. * @function SuperMap.GetFeaturesByIDsParameters.toJsonParameters
  23666. * @description 将 SuperMap.GetFeaturesByIDsParameters 对象转换为 JSON 字符串。
  23667. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID 查询参数对象。
  23668. * @returns {string} 转化后的 JSON 字符串。
  23669. */
  23670. }], [{
  23671. key: "toJsonParameters",
  23672. value: function toJsonParameters(params) {
  23673. var parasByIDs, filterParameter;
  23674. parasByIDs = {
  23675. datasetNames: params.datasetNames,
  23676. getFeatureMode: "ID",
  23677. ids: params.IDs
  23678. };
  23679. if (params.fields) {
  23680. filterParameter = new FilterParameter();
  23681. filterParameter.name = params.datasetNames;
  23682. filterParameter.fields = params.fields;
  23683. parasByIDs.queryParameter = filterParameter;
  23684. }
  23685. if (params.targetEpsgCode) {
  23686. parasByIDs.targetEpsgCode = params.targetEpsgCode;
  23687. }
  23688. if (!params.targetEpsgCode && params.targetPrj) {
  23689. parasByIDs.targetPrj = params.targetPrj;
  23690. }
  23691. return Util.toJSON(parasByIDs);
  23692. }
  23693. }]);
  23694. return GetFeaturesByIDsParameters;
  23695. }(GetFeaturesParametersBase);
  23696. SuperMap.GetFeaturesByIDsParameters = GetFeaturesByIDsParameters;
  23697. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesByIDsService.js
  23698. function GetFeaturesByIDsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesByIDsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesByIDsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesByIDsService_typeof(obj); }
  23699. function GetFeaturesByIDsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23700. 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); } }
  23701. function GetFeaturesByIDsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesByIDsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesByIDsService_defineProperties(Constructor, staticProps); return Constructor; }
  23702. function GetFeaturesByIDsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesByIDsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesByIDsService_get(target, property, receiver || target); }
  23703. function GetFeaturesByIDsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesByIDsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23704. 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 } }); if (superClass) GetFeaturesByIDsService_setPrototypeOf(subClass, superClass); }
  23705. function GetFeaturesByIDsService_setPrototypeOf(o, p) { GetFeaturesByIDsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesByIDsService_setPrototypeOf(o, p); }
  23706. 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); }; }
  23707. function GetFeaturesByIDsService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesByIDsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesByIDsService_assertThisInitialized(self); }
  23708. function GetFeaturesByIDsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23709. function GetFeaturesByIDsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23710. function GetFeaturesByIDsService_getPrototypeOf(o) { GetFeaturesByIDsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesByIDsService_getPrototypeOf(o); }
  23711. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23712. * This program are made available under the terms of the Apache License, Version 2.0
  23713. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23714. /**
  23715. * @class SuperMap.GetFeaturesByIDsService
  23716. * @category iServer Data FeatureResults
  23717. * @classdesc 数据集ID查询服务类。在数据集集合中查找指定 ID 号对应的空间地物要素。
  23718. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务。
  23719. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  23720. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23721. * @param {Object} options - 参数。</br>
  23722. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23723. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23724. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23725. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23726. * @param {Object} [options.headers] - 请求头。
  23727. * @extends {SuperMap.GetFeaturesServiceBase}
  23728. * @example
  23729. * var myGetFeaturesByIDsService = new SuperMap.GetFeaturesByIDsService(url, {
  23730. * eventListeners: {
  23731. * "processCompleted": getFeatureCompleted,
  23732. * "processFailed": getFeatureError
  23733. * }
  23734. * });
  23735. * function getFeatureCompleted(object){//todo};
  23736. * function getFeatureError(object){//todo}
  23737. */
  23738. var GetFeaturesByIDsService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23739. GetFeaturesByIDsService_inherits(GetFeaturesByIDsService, _GetFeaturesServiceBa);
  23740. var _super = GetFeaturesByIDsService_createSuper(GetFeaturesByIDsService);
  23741. function GetFeaturesByIDsService(url, options) {
  23742. var _this;
  23743. GetFeaturesByIDsService_classCallCheck(this, GetFeaturesByIDsService);
  23744. _this = _super.call(this, url, options);
  23745. _this.CLASS_NAME = "SuperMap.GetFeaturesByIDsService";
  23746. return _this;
  23747. }
  23748. /**
  23749. * @function SuperMap.GetFeaturesByIDsService.prototype.destroy
  23750. * @override
  23751. */
  23752. GetFeaturesByIDsService_createClass(GetFeaturesByIDsService, [{
  23753. key: "destroy",
  23754. value: function destroy() {
  23755. GetFeaturesByIDsService_get(GetFeaturesByIDsService_getPrototypeOf(GetFeaturesByIDsService.prototype), "destroy", this).call(this);
  23756. }
  23757. /**
  23758. * @function SuperMap.GetFeaturesByIDsService.prototype.getJsonParameters
  23759. * @description 将查询参数转化为 JSON 字符串。
  23760. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  23761. * @param {SuperMap.GetFeaturesByIDsParameters} params - ID查询参数类。
  23762. * @returns {string} 转化后的 JSON 字符串。
  23763. */
  23764. }, {
  23765. key: "getJsonParameters",
  23766. value: function getJsonParameters(params) {
  23767. return GetFeaturesByIDsParameters.toJsonParameters(params);
  23768. }
  23769. }]);
  23770. return GetFeaturesByIDsService;
  23771. }(GetFeaturesServiceBase);
  23772. SuperMap.GetFeaturesByIDsService = GetFeaturesByIDsService;
  23773. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLParameters.js
  23774. function GetFeaturesBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesBySQLParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesBySQLParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesBySQLParameters_typeof(obj); }
  23775. function GetFeaturesBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23776. 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); } }
  23777. function GetFeaturesBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  23778. function GetFeaturesBySQLParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesBySQLParameters_get(target, property, receiver || target); }
  23779. function GetFeaturesBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  23780. 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 } }); if (superClass) GetFeaturesBySQLParameters_setPrototypeOf(subClass, superClass); }
  23781. function GetFeaturesBySQLParameters_setPrototypeOf(o, p) { GetFeaturesBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLParameters_setPrototypeOf(o, p); }
  23782. 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); }; }
  23783. function GetFeaturesBySQLParameters_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLParameters_assertThisInitialized(self); }
  23784. function GetFeaturesBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23785. function GetFeaturesBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23786. function GetFeaturesBySQLParameters_getPrototypeOf(o) { GetFeaturesBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLParameters_getPrototypeOf(o); }
  23787. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23788. * This program are made available under the terms of the Apache License, Version 2.0
  23789. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23790. /**
  23791. * @class SuperMap.GetFeaturesBySQLParameters
  23792. * @category iServer Data FeatureResults
  23793. * @classdesc 数据服务中数据集 SQL 查询参数类。
  23794. * @param {Object} options - 参数。
  23795. * @param {SuperMap.FilterParameter} options.queryParameter - 查询过滤条件参数。
  23796. * @param {Array.<string>} options.datasetNames - 数据集集合中的数据集名称列表。
  23797. * @param {boolean} [options.returnContent=true] - 是否直接返回查询结果。
  23798. * @param {number} [options.fromIndex=0] - 查询结果的最小索引号。
  23799. * @param {number} [options.toIndex=19] - 查询结果的最大索引号。
  23800. * @param {string|number} [options.targetEpsgCode] - 动态投影的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。
  23801. * @param {Object} [options.targetPrj] - 动态投影的目标坐标系。使用此参数时,returnContent 参数需为 true。 如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。
  23802. * @extends {SuperMap.GetFeaturesParametersBase}
  23803. */
  23804. var GetFeaturesBySQLParameters = /*#__PURE__*/function (_GetFeaturesParameter) {
  23805. GetFeaturesBySQLParameters_inherits(GetFeaturesBySQLParameters, _GetFeaturesParameter);
  23806. var _super = GetFeaturesBySQLParameters_createSuper(GetFeaturesBySQLParameters);
  23807. function GetFeaturesBySQLParameters(options) {
  23808. var _this;
  23809. GetFeaturesBySQLParameters_classCallCheck(this, GetFeaturesBySQLParameters);
  23810. _this = _super.call(this, options);
  23811. /**
  23812. * @member {string} SuperMap.GetFeaturesBySQLParameters.prototype.getFeatureMode
  23813. * @description 数据集查询模式。
  23814. */
  23815. _this.getFeatureMode = "SQL";
  23816. /**
  23817. * @member {SuperMap.FilterParameter} SuperMap.GetFeaturesBySQLParameters.prototype.queryParameter
  23818. * @description 查询过滤条件参数类。
  23819. */
  23820. _this.queryParameter = null;
  23821. Util.extend(GetFeaturesBySQLParameters_assertThisInitialized(_this), options);
  23822. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLParameters";
  23823. return _this;
  23824. }
  23825. /**
  23826. * @function SuperMap.GetFeaturesBySQLParameters.prototype.destroy
  23827. * @override
  23828. */
  23829. GetFeaturesBySQLParameters_createClass(GetFeaturesBySQLParameters, [{
  23830. key: "destroy",
  23831. value: function destroy() {
  23832. GetFeaturesBySQLParameters_get(GetFeaturesBySQLParameters_getPrototypeOf(GetFeaturesBySQLParameters.prototype), "destroy", this).call(this);
  23833. var me = this;
  23834. me.getFeatureMode = null;
  23835. if (me.queryParameter) {
  23836. me.queryParameter.destroy();
  23837. me.queryParameter = null;
  23838. }
  23839. }
  23840. /**
  23841. * @function SuperMap.GetFeaturesBySQLParameters.prototype.toJsonParameters
  23842. * @description 将 SuperMap.GetFeaturesBySQLParameters 对象转换为 JSON 字符串。
  23843. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集 SQL 查询参数对象。
  23844. * @returns {string} 转化后的 JSON 字符串。
  23845. */
  23846. }], [{
  23847. key: "toJsonParameters",
  23848. value: function toJsonParameters(params) {
  23849. var paramsBySql = {
  23850. datasetNames: params.datasetNames,
  23851. getFeatureMode: "SQL",
  23852. queryParameter: params.queryParameter
  23853. };
  23854. if (params.maxFeatures && !isNaN(params.maxFeatures)) {
  23855. paramsBySql.maxFeatures = params.maxFeatures;
  23856. }
  23857. if (params.aggregations) {
  23858. paramsBySql.aggregations = params.aggregations;
  23859. }
  23860. if (params.targetEpsgCode) {
  23861. paramsBySql.targetEpsgCode = params.targetEpsgCode;
  23862. }
  23863. if (!params.targetEpsgCode && params.targetPrj) {
  23864. paramsBySql.targetPrj = params.targetPrj;
  23865. }
  23866. return Util.toJSON(paramsBySql);
  23867. }
  23868. }]);
  23869. return GetFeaturesBySQLParameters;
  23870. }(GetFeaturesParametersBase);
  23871. SuperMap.GetFeaturesBySQLParameters = GetFeaturesBySQLParameters;
  23872. ;// CONCATENATED MODULE: ./src/common/iServer/GetFeaturesBySQLService.js
  23873. function GetFeaturesBySQLService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFeaturesBySQLService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFeaturesBySQLService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFeaturesBySQLService_typeof(obj); }
  23874. function GetFeaturesBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23875. 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); } }
  23876. function GetFeaturesBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFeaturesBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFeaturesBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  23877. function GetFeaturesBySQLService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFeaturesBySQLService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFeaturesBySQLService_get(target, property, receiver || target); }
  23878. function GetFeaturesBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFeaturesBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  23879. 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 } }); if (superClass) GetFeaturesBySQLService_setPrototypeOf(subClass, superClass); }
  23880. function GetFeaturesBySQLService_setPrototypeOf(o, p) { GetFeaturesBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFeaturesBySQLService_setPrototypeOf(o, p); }
  23881. 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); }; }
  23882. function GetFeaturesBySQLService_possibleConstructorReturn(self, call) { if (call && (GetFeaturesBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFeaturesBySQLService_assertThisInitialized(self); }
  23883. function GetFeaturesBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23884. function GetFeaturesBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23885. function GetFeaturesBySQLService_getPrototypeOf(o) { GetFeaturesBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFeaturesBySQLService_getPrototypeOf(o); }
  23886. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23887. * This program are made available under the terms of the Apache License, Version 2.0
  23888. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23889. /**
  23890. * @class SuperMap.GetFeaturesBySQLService
  23891. * @constructs SuperMap.GetFeaturesBySQLService
  23892. * @category iServer Data FeatureResults
  23893. * @classdesc 数据服务中数据集 SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  23894. * @param {string} url - 数据查询结果资源地址。请求数据服务中数据集查询服务,
  23895. * URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{数据服务名}/rest/data/;</br>
  23896. * 例如:"http://localhost:8090/iserver/services/data-jingjin/rest/data/"
  23897. * @param {Object} options - 参数。</br>
  23898. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23899. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23900. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23901. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23902. * @param {Object} [options.headers] - 请求头。
  23903. * @extends {SuperMap.GetFeaturesServiceBase}
  23904. * @example
  23905. * var myGetFeaturesBySQLService = new SuperMap.GetFeaturesBySQLService(url, {
  23906. * eventListeners: {
  23907. * "processCompleted": GetFeaturesCompleted,
  23908. * "processFailed": GetFeaturesError
  23909. * }
  23910. * });
  23911. * function getFeaturesCompleted(object){//todo};
  23912. * function getFeaturesError(object){//todo};
  23913. *
  23914. */
  23915. var GetFeaturesBySQLService = /*#__PURE__*/function (_GetFeaturesServiceBa) {
  23916. GetFeaturesBySQLService_inherits(GetFeaturesBySQLService, _GetFeaturesServiceBa);
  23917. var _super = GetFeaturesBySQLService_createSuper(GetFeaturesBySQLService);
  23918. function GetFeaturesBySQLService(url, options) {
  23919. var _this;
  23920. GetFeaturesBySQLService_classCallCheck(this, GetFeaturesBySQLService);
  23921. _this = _super.call(this, url, options);
  23922. _this.CLASS_NAME = "SuperMap.GetFeaturesBySQLService";
  23923. return _this;
  23924. }
  23925. /**
  23926. * @function SuperMap.GetFeaturesBySQLService.prototype.destroy
  23927. * @override
  23928. */
  23929. GetFeaturesBySQLService_createClass(GetFeaturesBySQLService, [{
  23930. key: "destroy",
  23931. value: function destroy() {
  23932. GetFeaturesBySQLService_get(GetFeaturesBySQLService_getPrototypeOf(GetFeaturesBySQLService.prototype), "destroy", this).call(this);
  23933. }
  23934. /*
  23935. * @function SuperMap.GetFeaturesBySQLService.prototype.getJsonParameters
  23936. * @description 将查询参数转化为 JSON 字符串。
  23937. * 在本类中重写此方法,可以实现不同种类的查询(ID, SQL, Buffer, Geometry等)。
  23938. * @param {SuperMap.GetFeaturesBySQLParameters} params - 数据集SQL查询参数类。
  23939. * @returns {string} 转化后的 JSON 字符串。
  23940. */
  23941. }, {
  23942. key: "getJsonParameters",
  23943. value: function getJsonParameters(params) {
  23944. return GetFeaturesBySQLParameters.toJsonParameters(params);
  23945. }
  23946. }]);
  23947. return GetFeaturesBySQLService;
  23948. }(GetFeaturesServiceBase);
  23949. SuperMap.GetFeaturesBySQLService = GetFeaturesBySQLService;
  23950. ;// CONCATENATED MODULE: ./src/common/iServer/GetFieldsService.js
  23951. function GetFieldsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetFieldsService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetFieldsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetFieldsService_typeof(obj); }
  23952. function GetFieldsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  23953. 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); } }
  23954. function GetFieldsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetFieldsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetFieldsService_defineProperties(Constructor, staticProps); return Constructor; }
  23955. function GetFieldsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetFieldsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetFieldsService_get(target, property, receiver || target); }
  23956. function GetFieldsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetFieldsService_getPrototypeOf(object); if (object === null) break; } return object; }
  23957. 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 } }); if (superClass) GetFieldsService_setPrototypeOf(subClass, superClass); }
  23958. function GetFieldsService_setPrototypeOf(o, p) { GetFieldsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetFieldsService_setPrototypeOf(o, p); }
  23959. 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); }; }
  23960. function GetFieldsService_possibleConstructorReturn(self, call) { if (call && (GetFieldsService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetFieldsService_assertThisInitialized(self); }
  23961. function GetFieldsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  23962. function GetFieldsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  23963. function GetFieldsService_getPrototypeOf(o) { GetFieldsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetFieldsService_getPrototypeOf(o); }
  23964. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  23965. * This program are made available under the terms of the Apache License, Version 2.0
  23966. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  23967. /**
  23968. * @class SuperMap.GetFieldsService
  23969. * @category iServer Data Field
  23970. * @classdesc 字段查询服务,支持查询指定数据集的中所有属性字段(field)的集合。
  23971. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/data-world/rest/data 即可。
  23972. * @param {Object} options - 参数。</br>
  23973. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  23974. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  23975. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  23976. * @param {string}options.datasource - 要查询的数据集所在的数据源名称。</br>
  23977. * @param {string}options.dataset - 要查询的数据集名称。</br>
  23978. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  23979. * @param {Object} [options.headers] - 请求头。
  23980. * @extends {SuperMap.CommonServiceBase}
  23981. * @example
  23982. * var myService = new SuperMap.GetFieldsService(url, {eventListeners: {
  23983. * "processCompleted": getFieldsCompleted,
  23984. * "processFailed": getFieldsError
  23985. * },
  23986. * datasource: "World",
  23987. * dataset: "Countries"
  23988. * };
  23989. *
  23990. */
  23991. var GetFieldsService = /*#__PURE__*/function (_CommonServiceBase) {
  23992. GetFieldsService_inherits(GetFieldsService, _CommonServiceBase);
  23993. var _super = GetFieldsService_createSuper(GetFieldsService);
  23994. function GetFieldsService(url, options) {
  23995. var _this;
  23996. GetFieldsService_classCallCheck(this, GetFieldsService);
  23997. _this = _super.call(this, url, options);
  23998. /**
  23999. * @member {string} SuperMap.GetFieldsService.prototype.datasource
  24000. * @description 要查询的数据集所在的数据源名称。
  24001. */
  24002. _this.datasource = null;
  24003. /**
  24004. * @member {string} SuperMap.GetFieldsService.prototype.dataset
  24005. * @description 要查询的数据集名称。
  24006. */
  24007. _this.dataset = null;
  24008. if (options) {
  24009. Util.extend(GetFieldsService_assertThisInitialized(_this), options);
  24010. }
  24011. _this.CLASS_NAME = "SuperMap.GetFieldsService";
  24012. return _this;
  24013. }
  24014. /**
  24015. * @function SuperMap.GetFieldsService.prototype.destroy
  24016. * @override
  24017. */
  24018. GetFieldsService_createClass(GetFieldsService, [{
  24019. key: "destroy",
  24020. value: function destroy() {
  24021. GetFieldsService_get(GetFieldsService_getPrototypeOf(GetFieldsService.prototype), "destroy", this).call(this);
  24022. var me = this;
  24023. me.datasource = null;
  24024. me.dataset = null;
  24025. }
  24026. /**
  24027. * @function SuperMap.GetFieldsService.prototype.processAsync
  24028. * @description 执行服务,查询指定数据集的字段信息。
  24029. */
  24030. }, {
  24031. key: "processAsync",
  24032. value: function processAsync() {
  24033. var me = this;
  24034. me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.datasource, "/datasets/").concat(me.dataset, "/fields"));
  24035. me.request({
  24036. method: "GET",
  24037. data: null,
  24038. scope: me,
  24039. success: me.serviceProcessCompleted,
  24040. failure: me.serviceProcessFailed
  24041. });
  24042. }
  24043. }]);
  24044. return GetFieldsService;
  24045. }(CommonServiceBase);
  24046. SuperMap.GetFieldsService = GetFieldsService;
  24047. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosParameters.js
  24048. function GetGridCellInfosParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24049. 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); } }
  24050. function GetGridCellInfosParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosParameters_defineProperties(Constructor, staticProps); return Constructor; }
  24051. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24052. * This program are made available under the terms of the Apache License, Version 2.0
  24053. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24054. /**
  24055. * @class SuperMap.GetGridCellInfosParameters
  24056. * @category iServer Data Grid
  24057. * @classdesc 数据服务栅格查询参数类。
  24058. * @param {Object} options - 参数。
  24059. * @param {string} options.datasetName - 数据集名称。
  24060. * @param {string} options.dataSourceName - 数据源名称。
  24061. * @param {number} options.X - 要查询的地理位置 X 轴。
  24062. * @param {number} options.Y - 要查询的地理位置 Y 轴。
  24063. */
  24064. var GetGridCellInfosParameters = /*#__PURE__*/function () {
  24065. function GetGridCellInfosParameters(options) {
  24066. GetGridCellInfosParameters_classCallCheck(this, GetGridCellInfosParameters);
  24067. /**
  24068. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.datasetName
  24069. * @description 数据集名称。
  24070. */
  24071. this.datasetName = null;
  24072. /**
  24073. * @member {string} SuperMap.GetGridCellInfosParameters.prototype.dataSourceName
  24074. * @description 数据源名称。
  24075. */
  24076. this.dataSourceName = null;
  24077. /**
  24078. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.X
  24079. * @description 要查询的地理位置 X 轴。
  24080. */
  24081. this.X = null;
  24082. /**
  24083. * @member {number} SuperMap.GetGridCellInfosParameters.prototype.Y
  24084. * @description 要查询的地理位置 Y 轴。
  24085. */
  24086. this.Y = null;
  24087. Util.extend(this, options);
  24088. this.CLASS_NAME = "SuperMap.GetGridCellInfosParameters";
  24089. }
  24090. /**
  24091. * @function SuperMap.GetGridCellInfosParameters.prototype.destroy
  24092. * @description 释放资源,将引用的资源属性置空。
  24093. */
  24094. GetGridCellInfosParameters_createClass(GetGridCellInfosParameters, [{
  24095. key: "destroy",
  24096. value: function destroy() {
  24097. var me = this;
  24098. me.datasetName = null;
  24099. me.dataSourceName = null;
  24100. me.X = null;
  24101. me.Y = null;
  24102. }
  24103. }]);
  24104. return GetGridCellInfosParameters;
  24105. }();
  24106. SuperMap.GetGridCellInfosParameters = GetGridCellInfosParameters;
  24107. ;// CONCATENATED MODULE: ./src/common/iServer/GetGridCellInfosService.js
  24108. function GetGridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetGridCellInfosService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetGridCellInfosService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetGridCellInfosService_typeof(obj); }
  24109. function GetGridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24110. 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); } }
  24111. function GetGridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetGridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetGridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  24112. function GetGridCellInfosService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetGridCellInfosService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetGridCellInfosService_get(target, property, receiver || target); }
  24113. function GetGridCellInfosService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetGridCellInfosService_getPrototypeOf(object); if (object === null) break; } return object; }
  24114. 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 } }); if (superClass) GetGridCellInfosService_setPrototypeOf(subClass, superClass); }
  24115. function GetGridCellInfosService_setPrototypeOf(o, p) { GetGridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetGridCellInfosService_setPrototypeOf(o, p); }
  24116. 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); }; }
  24117. function GetGridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GetGridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetGridCellInfosService_assertThisInitialized(self); }
  24118. function GetGridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  24119. function GetGridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  24120. function GetGridCellInfosService_getPrototypeOf(o) { GetGridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetGridCellInfosService_getPrototypeOf(o); }
  24121. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24122. * This program are made available under the terms of the Apache License, Version 2.0
  24123. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24124. /**
  24125. * @class SuperMap.GetGridCellInfosService
  24126. * @category iServer Data Grid
  24127. * @classdesc 数据栅格查询服务,支持查询指定地理位置的栅格信息。
  24128. * @param {string} url - 查询服务地址。例如: http://localhost:8090/iserver/services/data-jingjin/rest/data
  24129. * @param {Object} options - 参数。</br>
  24130. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  24131. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  24132. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  24133. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  24134. * @param {Object} [options.headers] - 请求头。
  24135. * @extends {SuperMap.CommonServiceBase}
  24136. * @example
  24137. * var myService = new SuperMap.GetGridCellInfosService(url, {eventListeners: {
  24138. * "processCompleted": queryCompleted,
  24139. * "processFailed": queryError
  24140. * }
  24141. * });
  24142. *
  24143. */
  24144. var GetGridCellInfosService = /*#__PURE__*/function (_CommonServiceBase) {
  24145. GetGridCellInfosService_inherits(GetGridCellInfosService, _CommonServiceBase);
  24146. var _super = GetGridCellInfosService_createSuper(GetGridCellInfosService);
  24147. function GetGridCellInfosService(url, options) {
  24148. var _this;
  24149. GetGridCellInfosService_classCallCheck(this, GetGridCellInfosService);
  24150. _this = _super.call(this, url, options);
  24151. /**
  24152. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetName
  24153. * @description 数据集名称。
  24154. */
  24155. _this.datasetName = null;
  24156. /**
  24157. * @member {string} SuperMap.GetGridCellInfosService.prototype.dataSourceName
  24158. * @description 数据源名称。
  24159. */
  24160. _this.dataSourceName = null;
  24161. /**
  24162. * @member {string} SuperMap.GetGridCellInfosService.prototype.datasetType
  24163. * @description 数据集类型。
  24164. */
  24165. _this.datasetType = null;
  24166. /**
  24167. * @member {number} SuperMap.GetGridCellInfosService.prototype.X
  24168. * @description 要查询的地理位置X轴
  24169. */
  24170. _this.X = null;
  24171. /**
  24172. * @member {number} SuperMap.GetGridCellInfosService.prototype.Y
  24173. * @description 要查询的地理位置Y轴
  24174. */
  24175. _this.Y = null;
  24176. if (options) {
  24177. Util.extend(GetGridCellInfosService_assertThisInitialized(_this), options);
  24178. }
  24179. _this.CLASS_NAME = "SuperMap.GetGridCellInfosService";
  24180. return _this;
  24181. }
  24182. /**
  24183. * @function SuperMap.GetGridCellInfosService.prototype.destroy
  24184. * @override
  24185. */
  24186. GetGridCellInfosService_createClass(GetGridCellInfosService, [{
  24187. key: "destroy",
  24188. value: function destroy() {
  24189. GetGridCellInfosService_get(GetGridCellInfosService_getPrototypeOf(GetGridCellInfosService.prototype), "destroy", this).call(this);
  24190. var me = this;
  24191. me.X = null;
  24192. me.Y = null;
  24193. me.datasetName = null;
  24194. me.dataSourceName = null;
  24195. me.datasetType = null;
  24196. }
  24197. /**
  24198. * @function SuperMap.GetGridCellInfosService.prototype.processAsync
  24199. * @description 执行服务,查询数据集信息。
  24200. * @param {SuperMap.GetGridCellInfosParameters} params - 查询参数。
  24201. */
  24202. }, {
  24203. key: "processAsync",
  24204. value: function processAsync(params) {
  24205. if (!(params instanceof GetGridCellInfosParameters)) {
  24206. return;
  24207. }
  24208. Util.extend(this, params);
  24209. var me = this;
  24210. me.url = Util.urlPathAppend(me.url, "datasources/".concat(me.dataSourceName, "/datasets/").concat(me.datasetName));
  24211. me.queryRequest(me.getDatasetInfoCompleted, me.getDatasetInfoFailed);
  24212. }
  24213. /**
  24214. * @function SuperMap.GetGridCellInfosService.prototype.queryRequest
  24215. * @description 执行服务,查询。
  24216. * @callback {function} successFun - 成功后执行的函数。
  24217. * @callback {function} failedFunc - 失败后执行的函数。
  24218. */
  24219. }, {
  24220. key: "queryRequest",
  24221. value: function queryRequest(successFun, failedFunc) {
  24222. var me = this;
  24223. me.request({
  24224. method: "GET",
  24225. data: null,
  24226. scope: me,
  24227. success: successFun,
  24228. failure: failedFunc
  24229. });
  24230. }
  24231. /**
  24232. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoCompleted
  24233. * @description 数据集查询完成,执行此方法。
  24234. * @param {Object} result - 服务器返回的结果对象。
  24235. */
  24236. }, {
  24237. key: "getDatasetInfoCompleted",
  24238. value: function getDatasetInfoCompleted(result) {
  24239. var me = this;
  24240. result = Util.transformResult(result);
  24241. me.datasetType = result.datasetInfo.type;
  24242. me.queryGridInfos();
  24243. }
  24244. /**
  24245. * @function SuperMap.GetGridCellInfosService.prototype.queryGridInfos
  24246. * @description 执行服务,查询数据集栅格信息信息。
  24247. */
  24248. }, {
  24249. key: "queryGridInfos",
  24250. value: function queryGridInfos() {
  24251. var me = this;
  24252. me.url = Util.urlPathAppend(me.url, me.datasetType == 'GRID' ? 'gridValue' : 'imageValue');
  24253. if (me.X != null && me.Y != null) {
  24254. me.url = Util.urlAppend(me.url, "x=".concat(me.X, "&y=").concat(me.Y));
  24255. }
  24256. me.queryRequest(me.serviceProcessCompleted, me.serviceProcessFailed);
  24257. }
  24258. /**
  24259. * @function SuperMap.GetGridCellInfosService.prototype.getDatasetInfoFailed
  24260. * @description 数据集查询失败,执行此方法。
  24261. * @param {Object} result - 服务器返回的结果对象。
  24262. */
  24263. }, {
  24264. key: "getDatasetInfoFailed",
  24265. value: function getDatasetInfoFailed(result) {
  24266. var me = this;
  24267. me.serviceProcessFailed(result);
  24268. }
  24269. }]);
  24270. return GetGridCellInfosService;
  24271. }(CommonServiceBase);
  24272. SuperMap.GetGridCellInfosService = GetGridCellInfosService;
  24273. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeMemoryData.js
  24274. function ThemeMemoryData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24275. 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); } }
  24276. function ThemeMemoryData_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeMemoryData_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeMemoryData_defineProperties(Constructor, staticProps); return Constructor; }
  24277. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24278. * This program are made available under the terms of the Apache License, Version 2.0
  24279. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24280. /**
  24281. * @class SuperMap.ThemeMemoryData
  24282. * @category iServer Map Theme
  24283. * @classdesc 专题图内存数据类。
  24284. * @param {Array} srcData - 原始值数组。
  24285. * @param {Array} targetData - 外部值数组。
  24286. */
  24287. var ThemeMemoryData = /*#__PURE__*/function () {
  24288. function ThemeMemoryData(srcData, targetData) {
  24289. ThemeMemoryData_classCallCheck(this, ThemeMemoryData);
  24290. /**
  24291. * @member {Array} SuperMap.ThemeMemoryData.prototype.srcData
  24292. * @description 原始值数组,该属性值将被 targetData 属性所指定的值替换掉,然后制作专题图,但数据库中的值并不会改变。
  24293. */
  24294. this.srcData = srcData;
  24295. /**
  24296. * @member {Array} SuperMap.ThemeMemoryData.prototype.targetData
  24297. * @description 外部值数组,即用于制作专题图的内存数据,设定该属性值后,会将 srcData 属性所指定的原始值替换掉制作专题图,但数据库中的值并不会改变。
  24298. */
  24299. this.targetData = targetData;
  24300. this.CLASS_NAME = "SuperMap.ThemeMemoryData";
  24301. }
  24302. /**
  24303. * @function SuperMap.ThemeMemoryData.prototype.destroy
  24304. * @description 释放资源,将引用资源的属性置空。
  24305. */
  24306. ThemeMemoryData_createClass(ThemeMemoryData, [{
  24307. key: "destroy",
  24308. value: function destroy() {
  24309. var me = this;
  24310. me.srcData = null;
  24311. me.targetData = null;
  24312. }
  24313. /**
  24314. * @function SuperMap.ThemeMemoryData.prototype.toJSON
  24315. * @description 将 SuperMap.ThemeMemoryData 对象转化为 JSON 字符串。
  24316. * @returns {string} 返回转换后的 JSON 字符串。
  24317. */
  24318. }, {
  24319. key: "toJSON",
  24320. value: function toJSON() {
  24321. if (this.srcData && this.targetData) {
  24322. var memoryDataStr = "";
  24323. var count = Math.min(this.srcData.length, this.targetData.length);
  24324. for (var i = 0; i < count; i++) {
  24325. memoryDataStr += "\'" + this.srcData[i] + "\':\'" + this.targetData[i] + "\',";
  24326. } //去除多余的逗号
  24327. if (i > 0) {
  24328. memoryDataStr = memoryDataStr.substring(0, memoryDataStr.length - 1);
  24329. }
  24330. return "{" + memoryDataStr + "}";
  24331. } else {
  24332. return null;
  24333. }
  24334. }
  24335. }]);
  24336. return ThemeMemoryData;
  24337. }();
  24338. SuperMap.ThemeMemoryData = ThemeMemoryData;
  24339. ;// CONCATENATED MODULE: ./src/common/iServer/Theme.js
  24340. function Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24341. 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); } }
  24342. function Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme_defineProperties(Constructor, staticProps); return Constructor; }
  24343. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24344. * This program are made available under the terms of the Apache License, Version 2.0
  24345. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24346. /**
  24347. * @class SuperMap.Theme
  24348. * @category iServer Map Theme
  24349. * @classdesc 专题图基类。
  24350. * @param {string} type - 专题图类型。
  24351. * @param {Object} options - 参数。
  24352. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  24353. */
  24354. var Theme = /*#__PURE__*/function () {
  24355. function Theme(type, options) {
  24356. Theme_classCallCheck(this, Theme);
  24357. if (!type) {
  24358. return this;
  24359. }
  24360. /**
  24361. * @member {SuperMap.ThemeMemoryData} SuperMap.Theme.prototype.memoryData
  24362. * @description 专题图内存数据。<br>
  24363. * 用内存数据制作专题图的方式与表达式制作专题图的方式互斥,前者优先级较高。
  24364. * 第一个参数代表专题值,即数据集中用来做专题图的字段或表达式的值;第二个参数代表外部值。在制作专题图时,会用外部值代替专题值来制作相应的专题图。
  24365. */
  24366. this.memoryData = null;
  24367. /**
  24368. * @member {string} SuperMap.Theme.prototype.type
  24369. * @description 专题图类型。
  24370. */
  24371. this.type = type;
  24372. if (options) {
  24373. Util.extend(this, options);
  24374. }
  24375. this.CLASS_NAME = "SuperMap.Theme";
  24376. }
  24377. /**
  24378. * @function SuperMap.Theme.prototype.destroy
  24379. * @description 释放资源,将引用资源的属性置空。
  24380. */
  24381. Theme_createClass(Theme, [{
  24382. key: "destroy",
  24383. value: function destroy() {
  24384. var me = this;
  24385. if (me.memoryData) {
  24386. me.memoryData.destroy();
  24387. me.memoryData = null;
  24388. }
  24389. me.type = null;
  24390. }
  24391. /**
  24392. * @function SuperMap.Theme.prototype.toServerJSONObject
  24393. * @description 转换成对应的 JSON 格式对象。
  24394. * @returns {Object} 对应的 JSON 格式对象。
  24395. */
  24396. }, {
  24397. key: "toServerJSONObject",
  24398. value: function toServerJSONObject() {
  24399. //return 子类实现
  24400. return;
  24401. }
  24402. }]);
  24403. return Theme;
  24404. }();
  24405. SuperMap.Theme = Theme;
  24406. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTextStyle.js
  24407. function ServerTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24408. 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); } }
  24409. function ServerTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  24410. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24411. * This program are made available under the terms of the Apache License, Version 2.0
  24412. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24413. /**
  24414. * @class SuperMap.ServerTextStyle
  24415. * @category iServer Map Theme
  24416. * @classdesc 服务端文本风格类。
  24417. * @description 该类用于定义文本风格的相关属性。
  24418. * @param {Object} options - 参数。
  24419. * @param {SuperMap.TextAlignment} [options.align=SuperMap.TextAlignment.BASELINECENTER] - 文本的对齐方式。
  24420. * @param {SuperMap.ServerColor} [options.backColor] - 文本的背景色。默认 backColor = new ServerColor(255, 255, 255)。
  24421. * @param {SuperMap.ServerColor} [options.foreColor] - 文本的前景色。默认 foreColor = new ServerColor(0, 0, 0)。
  24422. * @param {boolean} [options.backOpaque=false] - 文本背景是否不透明。
  24423. * @param {boolean} [options.sizeFixed=true] - 文本大小是否固定。
  24424. * @param {number} [options.fontHeight=6] - 文本字体的高度。
  24425. * @param {number} [options.fontWidth=0] - 文本字体的宽度。
  24426. * @param {number} [options.fontWeight=400] - 文本字体的磅数。
  24427. * @param {string} [options.fontName='Times New Roman'] - 文本字体的名称。
  24428. * @param {boolean} [options.bold=false] - 文本是否为粗体字。
  24429. * @param {boolean} [options.italic=false] - 文本是否采用斜体。
  24430. * @param {number} [options.italicAngle=0] - 字体倾斜角度。
  24431. * @param {boolean} [options.shadow=false] - 文本是否有阴影。
  24432. * @param {boolean} [options.strikeout=false] - 文本字体是否加删除线。
  24433. * @param {boolean} [options.outline=false] - 是否以轮廓的方式来显示文本的背景。
  24434. * @param {number} [options.opaqueRate=0] - 注记文字的不透明度。
  24435. * @param {boolean} [options.underline=false] - 文本字体是否加下划线。
  24436. * @param {number} [options.rotation=0.0] - 文本旋转的角度。
  24437. */
  24438. var ServerTextStyle = /*#__PURE__*/function () {
  24439. function ServerTextStyle(options) {
  24440. ServerTextStyle_classCallCheck(this, ServerTextStyle);
  24441. /**
  24442. * @member {SuperMap.TextAlignment} [SuperMap.ServerTextStyle.prototype.align= SuperMap.TextAlignment.BASELINECENTER]
  24443. * @description 文本的对齐方式。
  24444. */
  24445. this.align = TextAlignment.BASELINECENTER;
  24446. /**
  24447. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.backColor=(255, 255, 255)]
  24448. * @description 文本的背景色。
  24449. */
  24450. this.backColor = new ServerColor(255, 255, 255);
  24451. /**
  24452. * @member {SuperMap.ServerColor} [SuperMap.ServerTextStyle.prototype.foreColor=(0, 0, 0)]
  24453. * @description 文本的前景色。
  24454. */
  24455. this.foreColor = new ServerColor(0, 0, 0);
  24456. /**
  24457. * @member {boolean} [SuperMap.ServerTextStyle.prototype.backOpaque=false]
  24458. * @description 文本背景是否不透明。true 表示文本背景不透明。
  24459. */
  24460. this.backOpaque = false;
  24461. /**
  24462. * @member {boolean} [SuperMap.ServerTextStyle.prototype.sizeFixed=true]
  24463. * @description 文本大小是否固定。设置为 true,表示图片为固定像素大小,具体大小请参考 fontHeight。当设为 false 时,图片会随着地图缩放而缩放。
  24464. */
  24465. this.sizeFixed = true;
  24466. /**
  24467. * @member {number} [SuperMap.ServerTextStyle.prototype.fontHeight=6]
  24468. * @description 文本字体的高度,单位与 sizeFixed 有关,当 sizeFixed 为 False 时,即非固定文本大小时使用地图坐标单位,
  24469. * 如地理坐标系下的地图中单位为度;当 sizeFixed 为 True 时,单位为毫米(mm)。
  24470. */
  24471. this.fontHeight = 6;
  24472. /**
  24473. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWidth=0]
  24474. * @description 文本字体的宽度。字体的宽度以英文字符为标准,由于一个中文字符相当于两个英文字符。
  24475. */
  24476. this.fontWidth = 0;
  24477. /**
  24478. * @member {number} [SuperMap.ServerTextStyle.prototype.fontWeight=400]
  24479. * @description 文本字体的磅数。表示粗体的具体数值。取值范围为从0-900之间的整百数。
  24480. */
  24481. this.fontWeight = 400;
  24482. /**
  24483. * @member {string} [SuperMap.ServerTextStyle.prototype.fontName="Times New Roman"]
  24484. * @description 文本字体的名称。
  24485. */
  24486. this.fontName = "Times New Roman";
  24487. /**
  24488. * @member {boolean} [SuperMap.ServerTextStyle.prototype.bold=false]
  24489. * @description 文本是否为粗体字。true 表示为粗体。false 表示文本不是粗体字。
  24490. */
  24491. this.bold = false;
  24492. /**
  24493. * @member {boolean} [SuperMap.ServerTextStyle.prototype.italic=false]
  24494. * @description 文本是否采用斜体。true 表示采用斜体。
  24495. */
  24496. this.italic = false;
  24497. /**
  24498. * @member {number} [SuperMap.ServerTextStyle.prototype.italicAngle=0]
  24499. * @description 字体倾斜角度。正负度之间,以度为单位,精确到0.1度。当倾斜角度为0度,为系统默认的字体倾斜样式。
  24500. * 正负度是指以纵轴为起始零度线,其纵轴左侧为正,右侧为负。允许的最大角度为60,最小-60。大于60按照60处理,小于-60按照-60处理。目前只对标签专题图有效。
  24501. */
  24502. this.italicAngle = 0;
  24503. /**
  24504. * @member {boolean} [SuperMap.ServerTextStyle.prototype.shadow=false]
  24505. * @description 文本是否有阴影。true 表示给文本增加阴影。false 表示文本没有阴影。
  24506. */
  24507. this.shadow = false;
  24508. /**
  24509. * @member {boolean} [SuperMap.ServerTextStyle.prototype.strikeout=false]
  24510. * @description 文本字体是否加删除线。true 表示加删除线。false 表示文本字体不加删除线。
  24511. */
  24512. this.strikeout = false;
  24513. /**
  24514. * @member {boolean} [SuperMap.ServerTextStyle.prototype.outline=false]
  24515. * @description 是否以轮廓的方式来显示文本的背景。true 表示以轮廓的方式来显示文本的背景。false 表示不以轮廓的方式来显示文本的背景。
  24516. */
  24517. this.outline = false;
  24518. /**
  24519. * @member {number} [SuperMap.ServerTextStyle.prototype.opaqueRate=0]
  24520. * @description 注记文字的不透明度。不透明度的范围为0-100。0表示透明。
  24521. */
  24522. this.opaqueRate = 0;
  24523. /**
  24524. * @member {boolean} [SuperMap.ServerTextStyle.prototype.underline=false]
  24525. * @description 文本字体是否加下划线。true 表示加下划线。
  24526. */
  24527. this.underline = false;
  24528. /**
  24529. * @member {number} [SuperMap.ServerTextStyle.prototype.rotation=0.0]
  24530. * @description 文本旋转的角度。逆时针方向为正方向,单位为度,精确到0.1度。
  24531. */
  24532. this.rotation = 0.0;
  24533. if (options) {
  24534. Util.extend(this, options);
  24535. }
  24536. this.CLASS_NAME = "SuperMap.ServerTextStyle";
  24537. }
  24538. /**
  24539. * @function SuperMap.ServerTextStyle.prototype.destroy
  24540. * @description 释放资源,将引用资源的属性置空。
  24541. */
  24542. ServerTextStyle_createClass(ServerTextStyle, [{
  24543. key: "destroy",
  24544. value: function destroy() {
  24545. var me = this;
  24546. me.align = null;
  24547. if (me.backColor) {
  24548. me.backColor.destroy();
  24549. me.backColor = null;
  24550. }
  24551. if (me.foreColor) {
  24552. me.foreColor.destroy();
  24553. me.foreColor = null;
  24554. }
  24555. me.backOpaque = null;
  24556. me.sizeFixed = null;
  24557. me.fontHeight = null;
  24558. me.fontWidth = null;
  24559. me.fontWeight = null;
  24560. me.fontName = null;
  24561. me.bold = null;
  24562. me.italic = null;
  24563. me.italicAngle = null;
  24564. me.shadow = null;
  24565. me.strikeout = null;
  24566. me.outline = null;
  24567. me.opaqueRate = null;
  24568. me.underline = null;
  24569. me.rotation = null;
  24570. }
  24571. /**
  24572. * @function SuperMap.ServerTextStyle.fromObj
  24573. * @description 从传入对象获服务端文本风格类。
  24574. * @param {Object} obj - 传入对象
  24575. * @returns {SuperMap.ServerTextStyle} 返回服务端文本风格对象
  24576. */
  24577. }], [{
  24578. key: "fromObj",
  24579. value: function fromObj(obj) {
  24580. var res = new ServerTextStyle(obj);
  24581. Util.copy(res, obj);
  24582. res.backColor = ServerColor.fromJson(obj.backColor);
  24583. res.foreColor = ServerColor.fromJson(obj.foreColor);
  24584. return res;
  24585. }
  24586. }]);
  24587. return ServerTextStyle;
  24588. }();
  24589. SuperMap.ServerTextStyle = ServerTextStyle;
  24590. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelItem.js
  24591. function ThemeLabelItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24592. 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); } }
  24593. function ThemeLabelItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelItem_defineProperties(Constructor, staticProps); return Constructor; }
  24594. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24595. * This program are made available under the terms of the Apache License, Version 2.0
  24596. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24597. /**
  24598. * @class SuperMap.ThemeLabelItem
  24599. * @category iServer Map Theme
  24600. * @classdesc 分段标签专题图的子项。
  24601. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,分段标签专题图允许用户通过 rangeExpression
  24602. * 字段指定用于分段的数值型字段,同一范围段内的标签具有相同的显示风格,其中每一个范围段就是一个专题图子项,
  24603. * 每一个子项都具有其名称、风格、起始值和终止值。注意:每个分段所表示的范围为 [Start, End)。例如:标签专题图的分段点有两个子项,
  24604. * 他们所代表的分段区间分别为[0,5),[5,10)。那么需要分别设置 SuperMap.ThemeLabelItem[0].start=0,
  24605. * SuperMap.ThemeLabelItem[0].end=5,SuperMap.ThemeLabelItem[1].start=5,SuperMap.ThemeLabelItem[1].end=10。
  24606. * @param {Object} options - 参数。
  24607. * @param {string} [options.caption] - 专题图子项的名称。
  24608. * @param {number} [options.end=0] - 标签专题图子项的终止值。
  24609. * @param {number} [options.start=0] - 标签专题图子项的分段起始值。
  24610. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  24611. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  24612. */
  24613. var ThemeLabelItem = /*#__PURE__*/function () {
  24614. function ThemeLabelItem(options) {
  24615. ThemeLabelItem_classCallCheck(this, ThemeLabelItem);
  24616. /**
  24617. * @member {string} [SuperMap.ThemeLabelItem.prototype.caption]
  24618. * @description 标签专题子项的标题。
  24619. */
  24620. this.caption = null;
  24621. /**
  24622. * @member {number} [SuperMap.ThemeLabelItem.prototype.end=0]
  24623. * @description 标签专题图子项的终止值。如果该子项是分段中最后一个子项,那么该终止值就是分段的最大值;
  24624. * 如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常。
  24625. */
  24626. this.end = 0;
  24627. /**
  24628. * @member {number} [SuperMap.ThemeLabelItem.prototype.start=0]
  24629. * @description 标签专题图子项的分段起始值。如果该子项是分段中第一项,那么该起始值就是分段的最小值;
  24630. * 如果该子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  24631. */
  24632. this.start = 0;
  24633. /**
  24634. * @member {boolean} [SuperMap.ThemeLabelItem.prototype.visible=true]
  24635. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  24636. */
  24637. this.visible = true;
  24638. /**
  24639. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelItem.prototype.style
  24640. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  24641. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  24642. */
  24643. this.style = new ServerTextStyle();
  24644. if (options) {
  24645. Util.extend(this, options);
  24646. }
  24647. this.CLASS_NAME = "SuperMap.ThemeLabelItem";
  24648. }
  24649. /**
  24650. * @function SuperMap.ThemeLabelItem.prototype.destroy
  24651. * @description 释放资源,将引用资源的属性置空。
  24652. */
  24653. ThemeLabelItem_createClass(ThemeLabelItem, [{
  24654. key: "destroy",
  24655. value: function destroy() {
  24656. var me = this;
  24657. me.caption = null;
  24658. me.end = null;
  24659. me.start = null;
  24660. if (me.style) {
  24661. me.style.destroy();
  24662. me.style = null;
  24663. }
  24664. me.visible = null;
  24665. }
  24666. /**
  24667. * @function SuperMap.ThemeLabelItem.fromObj
  24668. * @description 从传入对象获取分段标签专题图的子项类。
  24669. * @param {Object} obj - 传入对象。
  24670. * @returns {SuperMap.ThemeLabelItem} ThemeLabelItem 对象。
  24671. */
  24672. }], [{
  24673. key: "fromObj",
  24674. value: function fromObj(obj) {
  24675. if (!obj) {
  24676. return;
  24677. }
  24678. var t = new ThemeLabelItem();
  24679. Util.copy(t, obj);
  24680. return t;
  24681. }
  24682. }]);
  24683. return ThemeLabelItem;
  24684. }();
  24685. SuperMap.ThemeLabelItem = ThemeLabelItem;
  24686. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUniqueItem.js
  24687. function ThemeUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24688. 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); } }
  24689. function ThemeUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  24690. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24691. * This program are made available under the terms of the Apache License, Version 2.0
  24692. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24693. /**
  24694. * @class SuperMap.ThemeUniqueItem
  24695. * @category iServer Map Theme
  24696. * @classdesc 单值专题图子项类。
  24697. * @description 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,Name 字段代表
  24698. * 省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有 5 种不同值,则该行政区划图有 5 个专题图子项。
  24699. * @param {Object} options - 参数。
  24700. * @param {string} options.unique - 单值专题图子项的单值。
  24701. * @param {string} [options.caption] - 单值专题图子项的标题。
  24702. * @param {SuperMap.ServerStyle} [options.style] - 单值专题图子项的风格。
  24703. * @param {boolean} [options.visible=true] - 单值专题图子项是否可见。
  24704. */
  24705. var ThemeUniqueItem = /*#__PURE__*/function () {
  24706. function ThemeUniqueItem(options) {
  24707. ThemeUniqueItem_classCallCheck(this, ThemeUniqueItem);
  24708. /**
  24709. * @member {string} [SuperMap.ThemeUniqueItem.prototype.caption]
  24710. * @description 单值专题图子项的标题。
  24711. */
  24712. this.caption = null;
  24713. /**
  24714. * @member {SuperMap.ServerStyle} [SuperMap.ThemeUniqueItem.prototype.style]
  24715. * @description 单值专题图子项的显示风格。
  24716. */
  24717. this.style = new ServerStyle();
  24718. /**
  24719. * @member {string} SuperMap.ThemeUniqueItem.prototype.unique
  24720. * @description 单值专题图子项的值,可以为数字、字符串等。
  24721. */
  24722. this.unique = null;
  24723. /**
  24724. * @member {boolean} [SuperMap.ThemeUniqueItem.prototype.visible=true]
  24725. * @description 单值专题图子项的可见性。
  24726. */
  24727. this.visible = true;
  24728. if (options) {
  24729. Util.extend(this, options);
  24730. }
  24731. this.CLASS_NAME = "SuperMap.ThemeUniqueItem";
  24732. }
  24733. /**
  24734. * @function SuperMap.ThemeUniqueItem.prototype.destroy
  24735. * @description 释放资源,将引用资源的属性置空。
  24736. */
  24737. ThemeUniqueItem_createClass(ThemeUniqueItem, [{
  24738. key: "destroy",
  24739. value: function destroy() {
  24740. var me = this;
  24741. me.caption = null;
  24742. me.unique = null;
  24743. if (me.style) {
  24744. me.style.destroy();
  24745. me.style = null;
  24746. }
  24747. me.visible = null;
  24748. }
  24749. /**
  24750. * @function SuperMap.ThemeUniqueItem.prototype.toServerJSONObject
  24751. * @description 转换成对应的 JSON 格式对象。
  24752. * @returns {Object} 对应的 JSON 格式对象。
  24753. */
  24754. }, {
  24755. key: "toServerJSONObject",
  24756. value: function toServerJSONObject() {
  24757. var obj = {};
  24758. obj = Util.copyAttributes(obj, this);
  24759. if (obj.style) {
  24760. if (obj.style.toServerJSONObject) {
  24761. obj.style = obj.style.toServerJSONObject();
  24762. }
  24763. }
  24764. return obj;
  24765. }
  24766. /**
  24767. * @function SuperMap.ThemeUniqueItem.fromObj
  24768. * @description 从传入对象获取单值专题图子项类。
  24769. * @param {Object} obj - 传入对象。
  24770. * @returns {SuperMap.ThemeUniqueItem} ThemeUniqueItem 对象。
  24771. */
  24772. }], [{
  24773. key: "fromObj",
  24774. value: function fromObj(obj) {
  24775. var res = new ThemeUniqueItem();
  24776. Util.copy(res, obj);
  24777. res.style = ServerStyle.fromJson(obj.style);
  24778. return res;
  24779. }
  24780. }]);
  24781. return ThemeUniqueItem;
  24782. }();
  24783. SuperMap.ThemeUniqueItem = ThemeUniqueItem;
  24784. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeFlow.js
  24785. function ThemeFlow_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24786. 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); } }
  24787. function ThemeFlow_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFlow_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFlow_defineProperties(Constructor, staticProps); return Constructor; }
  24788. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24789. * This program are made available under the terms of the Apache License, Version 2.0
  24790. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24791. /**
  24792. * @class SuperMap.ThemeFlow
  24793. * @category iServer Map Theme
  24794. * @classdesc 标签或符号流动显示和牵引线风格设置类。
  24795. * 通过该类可以设置专题图中符号是否流动显示、是否使用牵引线以及牵引线风格。
  24796. * @param {Object} options - 参数。
  24797. * @param {boolean} [options.flowEnabled=false] - 是否流动显示标签或符号。
  24798. * @param {boolean} [options.leaderLineDisplayed=false] - 是否显示标签或符号和它标注的对象之间的牵引线。
  24799. * @param {SuperMap.ServerStyle} [options.leaderLineStyle] - 标签或符号与其标注对象之间牵引线的风格。
  24800. */
  24801. var ThemeFlow = /*#__PURE__*/function () {
  24802. function ThemeFlow(options) {
  24803. ThemeFlow_classCallCheck(this, ThemeFlow);
  24804. /**
  24805. * @member {boolean} [SuperMap.ThemeFlow.prototype.flowEnabled=false]
  24806. * @description 是否流动显示标签或符号。<br>
  24807. * 对于标签专题图而言,对于跨越比较大的区域和线条状的几何对象,在一个地图窗口中不能完全显示的情况下,如果其标签位置比较固定,
  24808. * 在当前地图窗口中该对象的标签不可见,则需要通过平移地图来查看对象的标签信息。如果采用了流动显示的效果,在当前地图窗口中,对象即使是部分显示,
  24809. * 其标签也会显示在当前地图窗口中。当平移地图时,对象的标签会随之移动,以保证在当前地图窗口中部分或全部显示的对象其标签都可见,从而可以方便地查看各要素的标签信息。
  24810. */
  24811. this.flowEnabled = false;
  24812. /**
  24813. * @member {boolean} [SuperMap.ThemeFlow.prototype.leaderLineDisplayed=false]
  24814. * @description 是否显示标签或符号和它标注的对象之间的牵引线。false表示不显示标签或符号和它标注的对象之间的牵引线。<br>
  24815. * 只有当 flowEnabled 为 true 时,牵引线才起作用。在当标签流动显示时,其位置不固定,由于牵引线始终指向要素的内点,
  24816. * 因而通过牵引线显示功能可以找到流动的标签或符号实际对应的要素。或者渲染符号偏移它所指向的对象时,图与对象之间可以采用牵引线进行连接。
  24817. */
  24818. this.leaderLineDisplayed = false;
  24819. /**
  24820. * @member {SuperMap.ServerStyle} SuperMap.ThemeFlow.prototype.leaderLineStyle
  24821. * @description 标签或符号与其标注对象之间牵引线的风格。
  24822. */
  24823. this.leaderLineStyle = new ServerStyle();
  24824. if (options) {
  24825. Util.extend(this, options);
  24826. }
  24827. this.CLASS_NAME = "SuperMap.ThemeFlow";
  24828. }
  24829. /**
  24830. * @function SuperMap.ThemeFlow.prototype.destroy
  24831. * @description 释放资源,将引用资源的属性置空。
  24832. */
  24833. ThemeFlow_createClass(ThemeFlow, [{
  24834. key: "destroy",
  24835. value: function destroy() {
  24836. var me = this;
  24837. me.flowEnabled = null;
  24838. me.leaderLineDisplayed = null;
  24839. if (me.leaderLineStyle) {
  24840. me.leaderLineStyle.destroy();
  24841. me.leaderLineStyle = null;
  24842. }
  24843. }
  24844. /**
  24845. * @function SuperMap.ThemeFlow.fromObj
  24846. * @description 从传入对象获取标签或符号流动显示和牵引线风格设置类。
  24847. * @param {Object} obj - 传入对象。
  24848. * @returns {SuperMap.ThemeFlow} ThemeFlow 对象。
  24849. */
  24850. }], [{
  24851. key: "fromObj",
  24852. value: function fromObj(obj) {
  24853. if (!obj) {
  24854. return;
  24855. }
  24856. var res = new ThemeFlow();
  24857. Util.copy(res, obj);
  24858. res.leaderLineStyle = ServerStyle.fromJson(obj.leaderLineStyle);
  24859. return res;
  24860. }
  24861. }]);
  24862. return ThemeFlow;
  24863. }();
  24864. SuperMap.ThemeFlow = ThemeFlow;
  24865. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeOffset.js
  24866. function ThemeOffset_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24867. 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); } }
  24868. function ThemeOffset_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeOffset_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeOffset_defineProperties(Constructor, staticProps); return Constructor; }
  24869. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24870. * This program are made available under the terms of the Apache License, Version 2.0
  24871. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24872. /**
  24873. * @class SuperMap.ThemeOffset
  24874. * @category iServer Map Theme
  24875. * @classdesc 专题图中文本或符号相对于要素内点的偏移量设置类。
  24876. * 通过该类可以设置专题图中标记文本或符号的偏移量以及偏移量是否随地图缩放而改变。
  24877. * @param {Object} options - 参数。
  24878. * @param {boolean} [options.offsetFixed=false] - 当前专题图是否固定标记文本或符号的偏移量。
  24879. * @param {string} [options.offsetX='0.0'] - 专题图中文本或符号相对于要素内点的水平偏移量。
  24880. * @param {string} [options.offsetY='0.0'] - 专题图中文本或符号相对于要素内点的垂直偏移量。
  24881. */
  24882. var ThemeOffset = /*#__PURE__*/function () {
  24883. function ThemeOffset(options) {
  24884. ThemeOffset_classCallCheck(this, ThemeOffset);
  24885. /**
  24886. * @member {boolean} [SuperMap.ThemeOffset.prototype.offsetFixed=false]
  24887. * @description 当前专题图是否固定标记文本或符号的偏移量。所谓固定偏移量,则文本或符号的偏移量不随地图的缩放而变化。
  24888. */
  24889. this.offsetFixed = false;
  24890. /**
  24891. * @member {string} [SuperMap.ThemeOffset.prototype.offsetX=0.0]
  24892. * @description 专题图中文本或符号相对于要素内点的水平偏移量。偏移量的单位为地图单位。
  24893. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么水平偏移量为2。
  24894. */
  24895. this.offsetX = "0.0";
  24896. /**
  24897. * @member {string} [SuperMap.ThemeOffset.prototype.offsetY=0.0]
  24898. * @description 专题图中文本或符号相对于要素内点的垂直偏移量。偏移量的单位为地图单位。
  24899. * 该偏移量的值为一个常量值或者字段表达式所表示的值,即如果字段表达式为 SmID,其中 SmID = 2,那么垂直偏移量为2。
  24900. */
  24901. this.offsetY = "0.0";
  24902. if (options) {
  24903. Util.extend(this, options);
  24904. }
  24905. this.CLASS_NAME = "SuperMap.ThemeOffset";
  24906. }
  24907. /**
  24908. * @function SuperMap.ThemeOffset.prototype.destroy
  24909. * @description 释放资源,将引用资源的属性置空。
  24910. */
  24911. ThemeOffset_createClass(ThemeOffset, [{
  24912. key: "destroy",
  24913. value: function destroy() {
  24914. var me = this;
  24915. me.offsetFixed = null;
  24916. me.offsetX = null;
  24917. me.offsetY = null;
  24918. }
  24919. /**
  24920. * @function SuperMap.ThemeOffset.fromObj
  24921. * @description 从传入对象获取专题图中文本或符号相对于要素内点的偏移量设置类。
  24922. * @param {Object} obj - 传入对象。
  24923. * @returns {SuperMap.ThemeOffset} ThemeOffset 对象。
  24924. */
  24925. }], [{
  24926. key: "fromObj",
  24927. value: function fromObj(obj) {
  24928. if (!obj) {
  24929. return;
  24930. }
  24931. var res = new ThemeOffset();
  24932. Util.copy(res, obj);
  24933. return res;
  24934. }
  24935. }]);
  24936. return ThemeOffset;
  24937. }();
  24938. SuperMap.ThemeOffset = ThemeOffset;
  24939. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMixedTextStyle.js
  24940. function LabelMixedTextStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  24941. 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); } }
  24942. function LabelMixedTextStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelMixedTextStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelMixedTextStyle_defineProperties(Constructor, staticProps); return Constructor; }
  24943. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  24944. * This program are made available under the terms of the Apache License, Version 2.0
  24945. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  24946. /**
  24947. * @class SuperMap.LabelMixedTextStyle
  24948. * @category iServer Map Theme
  24949. * @classdesc 标签文本复合风格类
  24950. * @description 该类主要用于对标签专题图中标签的文本内容进行风格设置。通过该类用户可以使标签的文字显示不同的风格,比如文本 “喜马拉雅山”,通过本类可以将前三个字用红色显示,后两个字用蓝色显示。对同一文本设置不同的风格实质上是对文本的字符进行分段,同一分段内的字符具有相同的显示风格。对字符分段有两种方式,一种是利用分隔符对文本进行分段;另一种是根据分段索引值进行分段。<br>
  24951. * 1. 利用分隔符对文本进行分段: 比如文本 “5&109” 被分隔符 “&” 分为 “5” 和 “109” 两部分,
  24952. * 在显示时,“5” 和分隔符 “&” 使用同一个风格,字符串 “109” 使用相同的风格。<br>
  24953. * 2. 利用分段索引值进行分段: 文本中字符的索引值是以0开始的整数,比如文本 “珠穆朗玛峰”,
  24954. * 第一个字符(“珠”)的索引值为 0,第二个字符(“穆”)的索引值为 1,以此类推;当设置分段索引值为 1,3,4,9 时,
  24955. * 字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),可以看出索引号为 0 的字符(即“珠” )在第一个分段内,
  24956. * 索引号为 1,2 的字符(即“穆”、“朗”)位于第二个分段内,索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  24957. * @param {Object} options - 参数。
  24958. * @param {SuperMap.ServerTextStyle} [options.defaultStyle] - 默认的文本复合风格。
  24959. * @param {string} [options.separator] - 文本的分隔符。
  24960. * @param {boolean} [options.separatorEnabled=false] - 文本的分隔符是否有效。
  24961. * @param {Array.<number>} [options.splitIndexes] - 分段索引值,分段索引值用来对文本中的字符进行分段。
  24962. * @param {Array.<SuperMap.ServerTextStyle>} [options.styles] - 文本样式集合。
  24963. */
  24964. var LabelMixedTextStyle = /*#__PURE__*/function () {
  24965. function LabelMixedTextStyle(options) {
  24966. LabelMixedTextStyle_classCallCheck(this, LabelMixedTextStyle);
  24967. /**
  24968. * @member {SuperMap.ServerTextStyle} SuperMap.LabelMixedTextStyle.prototype.defaultStyle
  24969. * @description 默认的文本复合风格,即 SuperMap.ServerTextStyle 各字段的默认值。
  24970. */
  24971. this.defaultStyle = null;
  24972. /**
  24973. * @member {string} SuperMap.LabelMixedTextStyle.prototype.separator
  24974. * @description 文本的分隔符,分隔符的风格与前一个字符的风格一样。文本的分隔符是一个将文本分割开的符号,
  24975. * 比如文本 “5_109” 被 “_” 隔符为 “5” 和 “109” 两部分,假设有风格数组:style1、style2。
  24976. * 在显示时,“5” 和分隔符 “_” 使用 Style1 风格渲染,字符串 “109” 使用 Style2 的风格。
  24977. */
  24978. this.separator = null;
  24979. /**
  24980. * @member {boolean} [SuperMap.LabelMixedTextStyle.prototype.separatorEnabled=false]
  24981. * @description 文本的分隔符是否有效。分隔符有效时利用分隔符对文本进行分段;无效时根据文本中字符的位置进行分段。
  24982. * 分段后,同一分段内的字符具有相同的显示风格。
  24983. */
  24984. this.separatorEnabled = false;
  24985. /**
  24986. * @member {Array.<number>} SuperMap.LabelMixedTextStyle.prototype.splitIndexes
  24987. * @description 分段索引值,分段索引值用来对文本中的字符进行分段。
  24988. * 文本中字符的索引值是以 0 开始的整数,比如文本“珠穆朗玛峰”,第一个字符(“珠”)的索引值为0,第二个字符(“穆”)的索引值为 1,
  24989. * 以此类推;当设置分段索引值数组为 [1,3,4,9] 时,字符分段范围相应的就是 (-∞,1),[1,3),[3,4),[4,9),[9,+∞),
  24990. * 可以看出索引号为 0 的字符(即 “珠”)在第一个分段内,索引号为 1,2 的字符(即 “穆”、“朗”)位于第二个分段内,
  24991. * 索引号为 3 的字符(“玛”)在第三个分段内,索引号为 4 的字符(“峰”)在第四个分段内,其余分段中没有字符。
  24992. */
  24993. this.splitIndexes = null;
  24994. /**
  24995. * @member {Array.<SuperMap.ServerTextStyle>} SuperMap.LabelMixedTextStyle.prototype.styles
  24996. * @description 文本样式集合。文本样式集合中的样式根据索引与不同分段一一对应,
  24997. * 如果有分段没有风格对应则使用 defaultStyle。
  24998. */
  24999. this.styles = new ServerTextStyle();
  25000. if (options) {
  25001. Util.extend(this, options);
  25002. }
  25003. this.CLASS_NAME = "SuperMap.LabelMixedTextStyle";
  25004. }
  25005. /**
  25006. * @function SuperMap.LabelMixedTextStyle.prototype.destroy
  25007. * @description 释放资源,将引用资源的属性置空。
  25008. */
  25009. LabelMixedTextStyle_createClass(LabelMixedTextStyle, [{
  25010. key: "destroy",
  25011. value: function destroy() {
  25012. var me = this;
  25013. if (me.defaultStyle) {
  25014. me.defaultStyle.destroy();
  25015. me.defaultStyle = null;
  25016. }
  25017. me.separator = null;
  25018. me.separatorEnabled = null;
  25019. if (me.splitIndexes) {
  25020. me.splitIndexes = null;
  25021. }
  25022. if (me.styles) {
  25023. for (var i = 0, styles = me.styles, len = styles.length; i < len; i++) {
  25024. styles[i].destroy();
  25025. }
  25026. me.styles = null;
  25027. }
  25028. }
  25029. /**
  25030. * @function SuperMap.LabelMixedTextStyle.fromObj
  25031. * @description 从传入对象获取标签文本复合风格类。
  25032. * @param {Object} obj - 传入对象。
  25033. * @returns {SuperMap.LabelMixedTextStyle} 返回新的 LabelMixedTextStyle 对象。
  25034. */
  25035. }], [{
  25036. key: "fromObj",
  25037. value: function fromObj(obj) {
  25038. if (!obj) {
  25039. return;
  25040. }
  25041. var res = new LabelMixedTextStyle();
  25042. var stys = obj.styles;
  25043. Util.copy(res, obj);
  25044. res.defaultStyle = new ServerTextStyle(obj.defaultStyle);
  25045. if (stys) {
  25046. res.styles = [];
  25047. for (var i = 0, len = stys.length; i < len; i++) {
  25048. res.styles.push(new ServerTextStyle(stys[i]));
  25049. }
  25050. }
  25051. return res;
  25052. }
  25053. }]);
  25054. return LabelMixedTextStyle;
  25055. }();
  25056. SuperMap.LabelMixedTextStyle = LabelMixedTextStyle;
  25057. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelText.js
  25058. function ThemeLabelText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25059. 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); } }
  25060. function ThemeLabelText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelText_defineProperties(Constructor, staticProps); return Constructor; }
  25061. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25062. * This program are made available under the terms of the Apache License, Version 2.0
  25063. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25064. /**
  25065. * @class SuperMap.ThemeLabelText
  25066. * @category iServer Map Theme
  25067. * @classdesc 标签中文本风格类。
  25068. * 通过该类可以设置标签中的文本字体大小和显示风格。
  25069. * @param {Object} options - 参数。
  25070. * @param {number} [options.maxTextHeight=0] - 标签中文本的最大高度。
  25071. * @param {number} [options.maxTextWidth=0] - 标签中文本的最大宽度。
  25072. * @param {number} [options.minTextHeight=0] - 标签中文本的最小高度。
  25073. * @param {number} [options.minTextWidth=0] - 标签中文本的最小宽度。
  25074. * @param {SuperMap.ServerTextStyle} [options.uniformStyle] - 统一文本风格。
  25075. * @param {SuperMap.LabelMixedTextStyle} [options.uniformMixedStyle] - 标签专题图统一的文本复合风格。
  25076. */
  25077. var ThemeLabelText = /*#__PURE__*/function () {
  25078. function ThemeLabelText(options) {
  25079. ThemeLabelText_classCallCheck(this, ThemeLabelText);
  25080. /**
  25081. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextHeight=0]
  25082. * @description 标签中文本的最大高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25083. * 当放大后的文本高度超过最大高度之后就不再放大。高度单位为 0.1 毫米。
  25084. */
  25085. this.maxTextHeight = 0;
  25086. /**
  25087. * @member {number} [SuperMap.ThemeLabelText.prototype.maxTextWidth=0]
  25088. * @description 标签中文本的最大宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25089. * 当放大后的文本宽度超过最大高度之后就不再放大。宽度单位为 0.1 毫米。
  25090. */
  25091. this.maxTextWidth = 0;
  25092. /**
  25093. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextHeight=0]
  25094. * @description 标签中文本的最小高度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25095. * 当缩小后的文本高度小于最小高度之后就不再缩小。高度单位为 0.1 毫米。
  25096. */
  25097. this.minTextHeight = 0;
  25098. /**
  25099. * @member {number} [SuperMap.ThemeLabelText.prototype.minTextWidth=0]
  25100. * @description 标签中文本的最小宽度。当标签文本不固定大小时,即 SuperMap.ServerTextStyle.sizeFixed = false 有效,
  25101. * 当缩小后的文本宽度小于最小宽度之后就不再缩小。宽度单位为 0.1 毫米。
  25102. */
  25103. this.minTextWidth = 0;
  25104. /**
  25105. * @member {SuperMap.ServerTextStyle} [SuperMap.ThemeLabelText.prototype.uniformStyle]
  25106. * @description 统一文本风格。当标签专题图子项的个数大于等于1时,
  25107. * uniformStyle 不起作用,各标签的风格使用子项中设置的风格。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  25108. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25109. */
  25110. this.uniformStyle = new ServerTextStyle();
  25111. /**
  25112. *@member {SuperMap.LabelMixedTextStyle} [SuperMap.ThemeLabelText.prototype.uniformMixedStyle]
  25113. *@description 标签专题图统一的文本复合风格。通过该类可以使同一个标
  25114. * 签中的文字使用多种风格显示。各种风格的优先级从高到低为:uniformMixedStyle(标签文本的复合风格),
  25115. * SuperMap.ThemeLabelItem.style(分段子项的文本风格),uniformStyle(统一文本风格)。
  25116. */
  25117. this.uniformMixedStyle = null;
  25118. if (options) {
  25119. Util.extend(this, options);
  25120. }
  25121. this.CLASS_NAME = "SuperMap.ThemeLabelText";
  25122. }
  25123. /**
  25124. * @function SuperMap.ThemeLabelText.prototype.destroy
  25125. * @description 释放资源,将引用资源的属性置空。
  25126. */
  25127. ThemeLabelText_createClass(ThemeLabelText, [{
  25128. key: "destroy",
  25129. value: function destroy() {
  25130. var me = this;
  25131. me.maxTextHeight = null;
  25132. me.maxTextWidth = null;
  25133. me.minTextHeight = null;
  25134. me.minTextWidth = null;
  25135. if (me.uniformStyle) {
  25136. me.uniformStyle.destroy();
  25137. me.uniformStyle = null;
  25138. }
  25139. if (me.uniformMixedStyle) {
  25140. me.uniformMixedStyle.destroy();
  25141. me.uniformMixedStyle = null;
  25142. }
  25143. }
  25144. /**
  25145. * @function SuperMap.ThemeLabelText.fromObj
  25146. * @description 从传入对象获取标签中文本风格类。
  25147. * @param {Object} obj - 传入对象。
  25148. * @returns {SuperMap.ThemeLabelText} ThemeLabelText 对象。
  25149. */
  25150. }], [{
  25151. key: "fromObj",
  25152. value: function fromObj(obj) {
  25153. if (!obj) {
  25154. return;
  25155. }
  25156. var res = new ThemeLabelText();
  25157. Util.copy(res, obj);
  25158. res.uniformStyle = ServerTextStyle.fromObj(obj.uniformStyle);
  25159. res.uniformMixedStyle = LabelMixedTextStyle.fromObj(obj.uniformMixedStyle);
  25160. return res;
  25161. }
  25162. }]);
  25163. return ThemeLabelText;
  25164. }();
  25165. SuperMap.ThemeLabelText = ThemeLabelText;
  25166. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelAlongLine.js
  25167. function ThemeLabelAlongLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25168. 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); } }
  25169. function ThemeLabelAlongLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelAlongLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelAlongLine_defineProperties(Constructor, staticProps); return Constructor; }
  25170. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25171. * This program are made available under the terms of the Apache License, Version 2.0
  25172. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25173. /**
  25174. * @class SuperMap.ThemeLabelAlongLine
  25175. * @category iServer Map Theme
  25176. * @classdesc 标签沿线标注样式类。
  25177. * @param {Object} options - 参数。
  25178. * @param {boolean} [options.isAlongLine=true] - 是否沿线显示文本。
  25179. * @param {SuperMap.AlongLineDirection} [options.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT] - 标签沿线标注方向。
  25180. * @param {boolean} [options.angleFixed=false] - 当沿线显示文本时,是否将文本角度固定。
  25181. * @param {boolean} [options.repeatedLabelAvoided=false] - 沿线循环标注时是否避免标签重复标注。
  25182. * @param {boolean} [options.repeatIntervalFixed=false] - 循环标注间隔是否固定。
  25183. * @param {number} [options.labelRepeatInterval=0] - 沿线且循环标注时循环标注的间隔。
  25184. */
  25185. var ThemeLabelAlongLine = /*#__PURE__*/function () {
  25186. function ThemeLabelAlongLine(options) {
  25187. ThemeLabelAlongLine_classCallCheck(this, ThemeLabelAlongLine);
  25188. /**
  25189. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.isAlongLine=true]
  25190. * @description 是否沿线显示文本。true 表示沿线显示文本,false 表示正常显示文本。
  25191. */
  25192. this.isAlongLine = true;
  25193. /**
  25194. * @member {SuperMap.AlongLineDirection} [SuperMap.ThemeLabelAlongLine.prototype.alongLineDirection=SuperMap.AlongLineDirection.LB_TO_RT]
  25195. * @description 标签沿线标注方向。
  25196. */
  25197. this.alongLineDirection = AlongLineDirection.LB_TO_RT;
  25198. /**
  25199. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.angleFixed=false]
  25200. * @description 当沿线显示文本时,是否将文本角度固定。true 表示按固定文本角度显示文本,false 表示按照沿线角度显示文本。
  25201. * 如果固定角度,则所有标签均按所设置的文本风格中字体的旋转角度来显示,不考虑沿线标注的方向;
  25202. * 如果不固定角度,在显示标签时会同时考虑字体的旋转角度和沿线标注的方向。
  25203. */
  25204. this.angleFixed = false;
  25205. /**
  25206. * @member {boolean} SuperMap.ThemeLabelAlongLine.prototype.repeatedLabelAvoided
  25207. * @description 沿线循环标注时是否避免标签重复标注。
  25208. */
  25209. this.repeatedLabelAvoided = false;
  25210. /**
  25211. * @member {boolean} [SuperMap.ThemeLabelAlongLine.prototype.repeatIntervalFixed=false]
  25212. * @description 循环标注间隔是否固定。true 表示使用固定循环标注间隔,即使用逻辑坐标来显示循环标注间隔;
  25213. * false 表示循环标注间隔随地图的缩放而变化,即使用地理坐标来显示循环标注间隔。
  25214. */
  25215. this.repeatIntervalFixed = false;
  25216. /**
  25217. * @member {number} [SuperMap.ThemeLabelAlongLine.prototype.labelRepeatInterval=0]
  25218. * @description 沿线且循环标注时循环标注的间隔。长度的单位与地图的地理单位一致。只有设定 RepeatedLabelAvoided 为 true
  25219. * 的时候,labelRepeatInterval 属性才有效。
  25220. */
  25221. this.labelRepeatInterval = 0;
  25222. if (options) {
  25223. Util.extend(this, options);
  25224. }
  25225. this.CLASS_NAME = "SuperMap.ThemeLabelAlongLine";
  25226. }
  25227. /**
  25228. * @function SuperMap.ThemeLabelAlongLine.prototype.destroy
  25229. * @description 释放资源,将引用资源的属性置空。
  25230. */
  25231. ThemeLabelAlongLine_createClass(ThemeLabelAlongLine, [{
  25232. key: "destroy",
  25233. value: function destroy() {
  25234. var me = this;
  25235. me.isAlongLine = null;
  25236. me.alongLineDirection = null;
  25237. me.angleFixed = null;
  25238. me.repeatedLabelAvoided = null;
  25239. me.repeatIntervalFixed = null;
  25240. me.labelRepeatInterval = null;
  25241. }
  25242. /**
  25243. * @function SuperMap.ThemeLabelAlongLine.fromObj
  25244. * @description 从传入对象获取标签沿线标注样式类。
  25245. * @param {Object} obj - 传入对象。
  25246. * @returns {SuperMap.ThemeLabelAlongLine} ThemeLabelAlongLine 对象。
  25247. */
  25248. }], [{
  25249. key: "fromObj",
  25250. value: function fromObj(obj) {
  25251. if (!obj) {
  25252. return;
  25253. }
  25254. var t = new ThemeLabelAlongLine();
  25255. Util.copy(t, obj);
  25256. return t;
  25257. }
  25258. }]);
  25259. return ThemeLabelAlongLine;
  25260. }();
  25261. SuperMap.ThemeLabelAlongLine = ThemeLabelAlongLine;
  25262. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelBackground.js
  25263. function ThemeLabelBackground_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25264. 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); } }
  25265. function ThemeLabelBackground_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelBackground_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelBackground_defineProperties(Constructor, staticProps); return Constructor; }
  25266. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25267. * This program are made available under the terms of the Apache License, Version 2.0
  25268. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25269. /**
  25270. * @class SuperMap.ThemeLabelBackground
  25271. * @category iServer Map Theme
  25272. * @classdesc 标签背景风格类。通过该类可以设置标签的背景形状和风格。
  25273. * @param {Object} options - 参数。
  25274. * @param {SuperMap.LabelBackShape} [options.labelBackShape=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景风格。
  25275. * @param {SuperMap.ServerStyle} [options.backStyle=SuperMap.LabelBackShape.NONE] - 标签专题图中标签背景的形状枚举类。
  25276. */
  25277. var ThemeLabelBackground = /*#__PURE__*/function () {
  25278. function ThemeLabelBackground(options) {
  25279. ThemeLabelBackground_classCallCheck(this, ThemeLabelBackground);
  25280. /**
  25281. * @member {SuperMap.LabelBackShape} [SuperMap.ThemeLabelBackground.prototype.labelBackShape=SuperMap.LabelBackShape.NONE]
  25282. * @description 标签专题图中标签背景风格。当背景形状
  25283. * labelBackShape 属性设为 NONE(即无背景形状) 时,backStyle 属性无效。
  25284. */
  25285. this.labelBackShape = LabelBackShape.NONE;
  25286. /**
  25287. * @member {SuperMap.ServerStyle} [SuperMap.ThemeLabelBackground.prototype.backStyle=SuperMap.LabelBackShape.NON]
  25288. * @description 标签专题图中标签背景的形状枚举类。背景类型可
  25289. * 以是矩形、圆角矩形、菱形、椭圆形、三角形和符号等,即不使用任何的形状作为标签的背景。
  25290. */
  25291. this.backStyle = new ServerStyle();
  25292. if (options) {
  25293. Util.extend(this, options);
  25294. }
  25295. this.CLASS_NAME = "SuperMap.ThemeLabelBackground";
  25296. }
  25297. /**
  25298. * @function SuperMap.ThemeLabelBackground.prototype.destroy
  25299. * @description 释放资源,将引用资源的属性置空。
  25300. */
  25301. ThemeLabelBackground_createClass(ThemeLabelBackground, [{
  25302. key: "destroy",
  25303. value: function destroy() {
  25304. var me = this;
  25305. me.labelBackShape = null;
  25306. if (me.backStyle) {
  25307. me.backStyle.destroy();
  25308. me.backStyle = null;
  25309. }
  25310. }
  25311. /**
  25312. * @function SuperMap.ThemeLabelBackground.fromObj
  25313. * @description 从传入对象获取标签背景风格类。
  25314. * @param {Object} obj - 传入对象。
  25315. * @returns {SuperMap.ThemeLabelBackground} ThemeLabelBackground 对象。
  25316. */
  25317. }], [{
  25318. key: "fromObj",
  25319. value: function fromObj(obj) {
  25320. if (!obj) {
  25321. return;
  25322. }
  25323. var t = new ThemeLabelBackground();
  25324. t.labelBackShape = obj.labelBackShape;
  25325. t.backStyle = ServerStyle.fromJson(obj.backStyle);
  25326. return t;
  25327. }
  25328. }]);
  25329. return ThemeLabelBackground;
  25330. }();
  25331. SuperMap.ThemeLabelBackground = ThemeLabelBackground;
  25332. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabel.js
  25333. function ThemeLabel_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeLabel_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeLabel_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeLabel_typeof(obj); }
  25334. function ThemeLabel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25335. 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); } }
  25336. function ThemeLabel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabel_defineProperties(Constructor, staticProps); return Constructor; }
  25337. function ThemeLabel_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeLabel_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeLabel_get(target, property, receiver || target); }
  25338. function ThemeLabel_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeLabel_getPrototypeOf(object); if (object === null) break; } return object; }
  25339. 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 } }); if (superClass) ThemeLabel_setPrototypeOf(subClass, superClass); }
  25340. function ThemeLabel_setPrototypeOf(o, p) { ThemeLabel_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeLabel_setPrototypeOf(o, p); }
  25341. 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); }; }
  25342. function ThemeLabel_possibleConstructorReturn(self, call) { if (call && (ThemeLabel_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeLabel_assertThisInitialized(self); }
  25343. function ThemeLabel_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25344. function ThemeLabel_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25345. function ThemeLabel_getPrototypeOf(o) { ThemeLabel_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeLabel_getPrototypeOf(o); }
  25346. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25347. * This program are made available under the terms of the Apache License, Version 2.0
  25348. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25349. /**
  25350. * @class SuperMap.ThemeLabel
  25351. * @category iServer Map Theme
  25352. * @classdesc 标签专题图类。
  25353. * @extends SuperMap.Theme
  25354. * @param {Object} options - 参数。
  25355. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 分段标签专题图的子项数组。
  25356. * @param {string} options.labelExpression - 标注字段表达式。
  25357. * @param {Array.<SuperMap.LabelMatrixCell>} options.matrixCells - 矩阵标签元素数组。
  25358. * @param {SuperMap.ThemeLabelAlongLine} [options.alongLine] - 标签沿线标注方向样式类。
  25359. * @param {SuperMap.ThemeLabelBackground} [options.background] - 标签专题图中标签的背景风格类。
  25360. * @param {SuperMap.ThemeFlow} [options.flow] - 标签专题图标签流动显示与牵引线设置类。
  25361. * @param {SuperMap.LabelOverLengthMode} [options.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  25362. * @param {number} [options.maxLabelLength=256] - 标签在每一行显示的最大长度。
  25363. * @param {number} [options.numericPrecision=0] - 通过该字段设置其显示的精度。
  25364. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  25365. * @param {boolean} [options.overlapAvoided=true] - 是否允许以文本避让方式显示文本。
  25366. * @param {string} [options.rangeExpression] - 制作分段标签专题的分段字段或字段表达式。
  25367. * @param {boolean} [options.smallGeometryLabeled=false] - 是否显示长度大于被标注对象本身长度的标签。
  25368. * @param {SuperMap.ThemeLabelText} options.text - 标签中文本风格。
  25369. * @param {number} [options.textSpace=0] - 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  25370. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  25371. */
  25372. var ThemeLabel = /*#__PURE__*/function (_Theme) {
  25373. ThemeLabel_inherits(ThemeLabel, _Theme);
  25374. var _super = ThemeLabel_createSuper(ThemeLabel);
  25375. function ThemeLabel(options) {
  25376. var _this;
  25377. ThemeLabel_classCallCheck(this, ThemeLabel);
  25378. _this = _super.call(this, "LABEL", options);
  25379. /**
  25380. * @member {SuperMap.ThemeLabelAlongLine} [SuperMap.ThemeLabel.prototype.alongLine]
  25381. * @description 标签沿线标注方向样式类。
  25382. * 在该类中可以设置标签是否沿线标注以及沿线标注的多种方式。沿线标注属性只适用于线数据集专题图。
  25383. */
  25384. _this.alongLine = new ThemeLabelAlongLine();
  25385. /**
  25386. * @member {SuperMap.ThemeLabelBackground} [SuperMap.ThemeLabel.prototype.background]
  25387. * @description 标签专题图中标签的背景风格类。通过该字段可以设置标签的背景形状和风格。
  25388. */
  25389. _this.background = new ThemeLabelBackground();
  25390. /**
  25391. * @member {SuperMap.ThemeFlow} [SuperMap.ThemeLabel.prototype.flow]
  25392. * @description 标签专题图标签流动显示与牵引线设置类。通过该字段可以设置标签是否流动显示和牵引线风格。
  25393. */
  25394. _this.flow = new ThemeFlow();
  25395. /**
  25396. * @member {Array.<SuperMap.ThemeUniqueItem>} [SuperMap.ThemeLabel.prototype.items]
  25397. * @description 分段标签专题图的子项数组。分段标签专题图使用 rangeExpression
  25398. * 指定数字型的字段作为分段数据,items 中的每个子对象的 [start,end) 分段值必须来源于属性 rangeExpression 的字段值。每个子项拥有自己的风格。
  25399. */
  25400. _this.items = null;
  25401. /**
  25402. * @member {Array.<SuperMap.ThemeLabelUniqueItem>} SuperMap.ThemeLabel.prototype.uniqueItems
  25403. * @description 单值标签专题图子项数组。单值标签专题图使用 uniqueExpression单值标签专题图子项集合。
  25404. */
  25405. _this.uniqueItems = null;
  25406. /**
  25407. * @member {string} SuperMap.ThemeLabel.prototype.labelExpression
  25408. * @description 标注字段表达式。系统将 labelExpression 对应的字段或字段表达式的值以标签的形式显示在图层中。
  25409. */
  25410. _this.labelExpression = null;
  25411. /**
  25412. * @member {SuperMap.LabelOverLengthMode} [SuperMap.ThemeLabel.prototype.labelOverLengthMode=SuperMap.LabelOverLengthMode.NONE] - 标签专题图中超长标签的处理模式枚举类。
  25413. * @description 对于标签的长度超过设置的标签最大长度 maxLabelLength 时称为超长标签。
  25414. */
  25415. _this.labelOverLengthMode = LabelOverLengthMode.NONE;
  25416. /**
  25417. * @member {Array.<SuperMap.LabelMatrixCell>} SuperMap.ThemeLabel.prototype.matrixCells
  25418. * @description 矩阵标签元素数组,用于制作矩阵标签专题图。
  25419. * 数组中可以放置符号类型的矩阵标签元素和图片类型的矩阵标签元素。
  25420. */
  25421. _this.matrixCells = null;
  25422. /**
  25423. * @member {number} [SuperMap.ThemeLabel.prototype.maxLabelLength=256]
  25424. * @description 标签在每一行显示的最大长度,一个中文为两个字符。
  25425. * 如果超过最大长度,可以采用两种方式来处理,一种是换行的模式进行显示,另一种是以省略号方式显示。单位为字符。
  25426. */
  25427. _this.maxLabelLength = 256;
  25428. /**
  25429. * @member {number} [SuperMap.ThemeLabel.prototype.numericPrecision=0]
  25430. * @description 如果显示的标签内容为数字,通过该字段设置其显示的精度。例如标签对应的数字是8071.64529347,
  25431. * 如果该属性为0时,显示8071;为1时,显示8071.6;为3时,则是8071.645。
  25432. */
  25433. _this.numericPrecision = 0;
  25434. /**
  25435. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeLabel.prototype.offset]
  25436. * @description 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  25437. */
  25438. _this.offset = new ThemeOffset();
  25439. /**
  25440. * @member {boolean} [SuperMap.ThemeLabel.prototype.overlapAvoided=true]
  25441. * @description 是否允许以文本避让方式显示文本。true 表示自动避免文本叠盖。只针对该标签专题图层中的文本数据。
  25442. * 在标签重叠度很大的情况下,即使使用自动避让功能,可能也无法完全避免标签重叠现象。
  25443. */
  25444. _this.overlapAvoided = true;
  25445. /**
  25446. * @member {string} SuperMap.ThemeLabel.prototype.rangeExpression
  25447. * @description 制作分段标签专题的分段字段或字段表达式。该表达式对应的字段(或者字段表达式)的值应该为数值型。
  25448. * 该字段与 items 分段子项联合使用,每个子项的起始值 [start,end)来源于 rangeExpression 字段值。
  25449. * 最后 labelExpression 指定的标签字段(标签专题图要显示的具体内容)会根据分段子项的风格进行分段显示。
  25450. */
  25451. _this.rangeExpression = null;
  25452. /**
  25453. * @member {string} SuperMap.ThemeLabel.prototype.uniqueExpression
  25454. * @description 用于制作单值专题图的字段或字段表达式。
  25455. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。必须与labelExpression一起使用。
  25456. */
  25457. _this.uniqueExpression = null;
  25458. /**
  25459. * @member {boolean} [SuperMap.ThemeLabel.prototype.smallGeometryLabeled=false]
  25460. * @description 是否显示长度大于被标注对象本身长度的标签。在标签的长度大于线或者面对象本身的长度时,
  25461. * 如果该值为 true,则标签文字会叠加在一起显示,为了清楚完整的显示该标签,
  25462. * 可以采用换行模式来显示标签,但必须保证每行的长度小于对象本身的长度。
  25463. */
  25464. _this.smallGeometryLabeled = false;
  25465. /**
  25466. * @member {SuperMap.ThemeLabelText} SuperMap.ThemeLabel.prototype.text
  25467. * @description 标签中文本风格。
  25468. */
  25469. _this.text = new ThemeLabelText();
  25470. /**
  25471. * @member {number} [SuperMap.ThemeLabel.prototype.textSpace=0]
  25472. * @description 沿线标注,相邻两个文字之间的间距,单位当前设置的字高。
  25473. */
  25474. _this.textSpace = 0;
  25475. if (options) {
  25476. Util.extend(ThemeLabel_assertThisInitialized(_this), options);
  25477. }
  25478. _this.CLASS_NAME = "SuperMap.ThemeLabel";
  25479. return _this;
  25480. }
  25481. /**
  25482. * @function SuperMap.ThemeLabel.prototype.destroy
  25483. * @override
  25484. */
  25485. ThemeLabel_createClass(ThemeLabel, [{
  25486. key: "destroy",
  25487. value: function destroy() {
  25488. ThemeLabel_get(ThemeLabel_getPrototypeOf(ThemeLabel.prototype), "destroy", this).call(this);
  25489. var me = this;
  25490. me.alongLine = null;
  25491. if (me.background) {
  25492. me.background.destroy();
  25493. me.background = null;
  25494. }
  25495. me.flow = null;
  25496. if (me.items) {
  25497. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  25498. items[i].destroy();
  25499. }
  25500. me.items = null;
  25501. }
  25502. if (me.uniqueItems) {
  25503. for (var j = 0, uniqueItems = me.uniqueItems, uniqueLen = uniqueItems.length; j < uniqueLen; j++) {
  25504. uniqueItems[j].destory();
  25505. }
  25506. me.uniqueItems = null;
  25507. }
  25508. me.labelExpression = null;
  25509. me.labelOverLengthMode = null;
  25510. me.matrixCells = null;
  25511. me.maxLabelLength = null;
  25512. me.numericPrecision = null;
  25513. me.overlapAvoided = null;
  25514. me.rangeExpression = null;
  25515. me.uniqueExpression = null;
  25516. if (me.offset) {
  25517. me.offset.destroy();
  25518. me.offset = null;
  25519. }
  25520. me.overlapAvoided = null;
  25521. me.smallGeometryLabeled = null;
  25522. if (me.text) {
  25523. me.text.destroy();
  25524. me.text = null;
  25525. }
  25526. me.textSpace = null;
  25527. }
  25528. /**
  25529. * @function SuperMap.ThemeLabel.prototype.toJSON
  25530. * @description 将themeLabel对象转化为 JSON 字符串。
  25531. * @returns {string} 返回转换后的 JSON 字符串。
  25532. */
  25533. }, {
  25534. key: "toJSON",
  25535. value: function toJSON() {
  25536. return Util.toJSON(this.toServerJSONObject());
  25537. }
  25538. /**
  25539. * @function SuperMap.ThemeLabel.prototype.toServerJSONObject
  25540. * @description 转换成对应的 JSON 格式对象。
  25541. * @returns {Object} 对应的 JSON 格式对象。
  25542. */
  25543. }, {
  25544. key: "toServerJSONObject",
  25545. value: function toServerJSONObject() {
  25546. var obj = {};
  25547. obj.type = this.type;
  25548. obj.memoryData = this.memoryData;
  25549. if (this.alongLine) {
  25550. obj.alongLine = this.alongLine.isAlongLine;
  25551. obj.alongLineDirection = this.alongLine.alongLineDirection;
  25552. obj.angleFixed = this.alongLine.angleFixed;
  25553. obj.isLabelRepeated = this.alongLine.isLabelRepeated;
  25554. obj.labelRepeatInterval = this.alongLine.labelRepeatInterval;
  25555. obj.repeatedLabelAvoided = this.alongLine.repeatedLabelAvoided;
  25556. obj.repeatIntervalFixed = this.alongLine.repeatIntervalFixed;
  25557. }
  25558. if (this.offset) {
  25559. obj.offsetFixed = this.offset.offsetFixed;
  25560. obj.offsetX = this.offset.offsetX;
  25561. obj.offsetY = this.offset.offsetY;
  25562. }
  25563. if (this.flow) {
  25564. obj.flowEnabled = this.flow.flowEnabled;
  25565. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  25566. obj.leaderLineStyle = this.flow.leaderLineStyle;
  25567. }
  25568. if (this.text) {
  25569. obj.maxTextHeight = this.text.maxTextHeight;
  25570. obj.maxTextWidth = this.text.maxTextWidth;
  25571. obj.minTextHeight = this.text.minTextHeight;
  25572. obj.minTextWidth = this.text.minTextWidth;
  25573. obj.uniformStyle = this.text.uniformStyle;
  25574. obj.uniformMixedStyle = this.text.uniformMixedStyle;
  25575. }
  25576. if (this.background) {
  25577. obj.labelBackShape = this.background.labelBackShape;
  25578. obj.backStyle = this.background.backStyle;
  25579. }
  25580. obj.labelOverLengthMode = this.labelOverLengthMode;
  25581. obj.maxLabelLength = this.maxLabelLength;
  25582. obj.smallGeometryLabeled = this.smallGeometryLabeled;
  25583. obj.rangeExpression = this.rangeExpression;
  25584. obj.uniqueExpression = this.uniqueExpression;
  25585. obj.numericPrecision = this.numericPrecision;
  25586. obj.items = this.items;
  25587. obj.uniqueItems = this.uniqueItems;
  25588. obj.labelExpression = this.labelExpression;
  25589. obj.overlapAvoided = this.overlapAvoided;
  25590. obj.matrixCells = this.matrixCells;
  25591. obj.textSpace = this.textSpace;
  25592. return obj;
  25593. }
  25594. /**
  25595. * @function SuperMap.ThemeLabel.fromObj
  25596. * @description 从传入对象获取标签专题图类。
  25597. * @param {Object} obj - 传入对象。
  25598. * @returns {SuperMap.ThemeLabel} ThemeLabel 对象。
  25599. */
  25600. }], [{
  25601. key: "fromObj",
  25602. value: function fromObj(obj) {
  25603. if (!obj) {
  25604. return;
  25605. }
  25606. var lab = new ThemeLabel();
  25607. var itemsL = obj.items,
  25608. itemsU = obj.uniqueItems,
  25609. cells = obj.matrixCells;
  25610. obj.matrixCells = null;
  25611. Util.copy(lab, obj);
  25612. lab.alongLine = ThemeLabelAlongLine.fromObj(obj);
  25613. lab.background = ThemeLabelBackground.fromObj(obj);
  25614. lab.flow = new ThemeFlow({
  25615. flowEnabled: obj.flowEnabled,
  25616. leaderLineDisplayed: obj.leaderLineDisplayed,
  25617. leaderLineStyle: obj.leaderLineStyle
  25618. });
  25619. if (itemsL) {
  25620. lab.items = [];
  25621. for (var i = 0, len = itemsL.length; i < len; i++) {
  25622. lab.items.push(ThemeLabelItem.fromObj(itemsL[i]));
  25623. }
  25624. }
  25625. if (itemsU) {
  25626. lab.uniqueItems = [];
  25627. for (var j = 0, uniqueLen = itemsU.length; j < uniqueLen; j++) {
  25628. lab.uniqueItems.push(ThemeUniqueItem.fromObj(itemsU[j]));
  25629. }
  25630. }
  25631. if (cells) {
  25632. lab.matrixCells = [];
  25633. for (var _i = 0, _len = cells.length; _i < _len; _i++) {//TODO
  25634. //lab.matrixCells.push(SuperMap.LabelMatrixCell.fromObj(cells[i]));
  25635. }
  25636. }
  25637. lab.offset = ThemeOffset.fromObj(obj);
  25638. lab.text = ThemeLabelText.fromObj(obj);
  25639. return lab;
  25640. }
  25641. }]);
  25642. return ThemeLabel;
  25643. }(Theme);
  25644. SuperMap.ThemeLabel = ThemeLabel;
  25645. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeUnique.js
  25646. function ThemeUnique_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeUnique_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeUnique_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeUnique_typeof(obj); }
  25647. function ThemeUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25648. 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); } }
  25649. function ThemeUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeUnique_defineProperties(Constructor, staticProps); return Constructor; }
  25650. function ThemeUnique_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeUnique_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeUnique_get(target, property, receiver || target); }
  25651. function ThemeUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  25652. 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 } }); if (superClass) ThemeUnique_setPrototypeOf(subClass, superClass); }
  25653. function ThemeUnique_setPrototypeOf(o, p) { ThemeUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeUnique_setPrototypeOf(o, p); }
  25654. 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); }; }
  25655. function ThemeUnique_possibleConstructorReturn(self, call) { if (call && (ThemeUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeUnique_assertThisInitialized(self); }
  25656. function ThemeUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25657. function ThemeUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  25658. function ThemeUnique_getPrototypeOf(o) { ThemeUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeUnique_getPrototypeOf(o); }
  25659. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25660. * This program are made available under the terms of the Apache License, Version 2.0
  25661. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25662. /**
  25663. * @class SuperMap.ThemeUnique
  25664. * @category iServer Map Theme
  25665. * @classdesc 单值专题图。
  25666. * @description 单值专题图是利用不同的颜色或符号(线型、填充)表示图层中某一属性信息的不同属性值,属性值相同的要素具有相同的渲染风格。单值专题图多用于具有分类属性的地图上,
  25667. * 比如土壤类型分布图、土地利用图、行政区划图等。单值专题图着重表示现象质的差别,一般不表示数量的特征。尤其是有交叉或重叠现象时,此类不推荐使用,例如:民族分布区等。
  25668. * @extends {SuperMap.Theme}
  25669. * @param {Object} options - 参数。
  25670. * @param {Array.<SuperMap.ThemeUniqueItem>} options.items - 单值专题图子项类数组。
  25671. * @param {string} options.uniqueExpression - 用于制作单值专题图的字段或字段表达式。
  25672. * @param {SuperMap.ServerStyle} [options.defaultStyle] - 未参与单值专题图制作的对象的显示风格。
  25673. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  25674. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  25675. */
  25676. var ThemeUnique = /*#__PURE__*/function (_Theme) {
  25677. ThemeUnique_inherits(ThemeUnique, _Theme);
  25678. var _super = ThemeUnique_createSuper(ThemeUnique);
  25679. function ThemeUnique(options) {
  25680. var _this;
  25681. ThemeUnique_classCallCheck(this, ThemeUnique);
  25682. _this = _super.call(this, "UNIQUE", options);
  25683. /**
  25684. * @member {SuperMap.ServerStyle} SuperMap.ThemeUnique.prototype.defaultStyle
  25685. * @description 未参与单值专题图制作的对象的显示风格。
  25686. * 通过单值专题图子项数组 (items)可以指定某些要素参与单值专题图制作,对于那些没有被包含的要素,即不参加单值专题表达的要素,使用该风格显示。
  25687. */
  25688. _this.defaultStyle = new ServerStyle();
  25689. /**
  25690. * @member {Array.<SuperMap.ThemeUniqueItem>} SuperMap.ThemeUnique.prototype.items
  25691. * @description 单值专题图子项类数组。
  25692. * 单值专题图是将专题值相同的要素归为一类,为每一类设定一种渲染风格,其中每一类就是一个专题图子项。比如,利用单值专题图制作行政区划图,
  25693. * Name 字段代表省/直辖市名,该字段用来做专题变量,如果该字段的字段值总共有5种不同值,则该行政区划图有 5 个专题图子项。
  25694. */
  25695. _this.items = null;
  25696. /**
  25697. * @member {string} SuperMap.ThemeUnique.prototype.uniqueExpression
  25698. * @description 用于制作单值专题图的字段或字段表达式。
  25699. * 该字段值的数据类型可以为数值型或字符型。如果设置字段表达式,只能是相同数据类型字段间的运算。
  25700. */
  25701. _this.uniqueExpression = null;
  25702. /**
  25703. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeUnique.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  25704. * @description 渐变颜色枚举类。
  25705. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  25706. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色方案完成填充。
  25707. * 但如果为某几个子项的风格进行单独设置后(设置了 ThemeUniqueItem 或 ThemeRangeItem 类中Style属性),
  25708. * 该配色方案对于这几个子项将不起作用。
  25709. */
  25710. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  25711. if (options) {
  25712. Util.extend(ThemeUnique_assertThisInitialized(_this), options);
  25713. }
  25714. _this.CLASS_NAME = "SuperMap.ThemeUnique";
  25715. return _this;
  25716. }
  25717. /**
  25718. * @function SuperMap.ThemeUnique.prototype.destroy
  25719. * @override
  25720. */
  25721. ThemeUnique_createClass(ThemeUnique, [{
  25722. key: "destroy",
  25723. value: function destroy() {
  25724. ThemeUnique_get(ThemeUnique_getPrototypeOf(ThemeUnique.prototype), "destroy", this).call(this);
  25725. var me = this;
  25726. me.uniqueExpression = null;
  25727. me.colorGradientType = null;
  25728. if (me.items) {
  25729. if (me.items.length > 0) {
  25730. for (var item in me.items) {
  25731. me.items[item].destroy();
  25732. me.items[item] = null;
  25733. }
  25734. }
  25735. me.items = null;
  25736. }
  25737. if (me.defaultStyle) {
  25738. me.defaultStyle.destroy();
  25739. me.defaultStyle = null;
  25740. }
  25741. }
  25742. /**
  25743. * @function SuperMap.ThemeUnique.prototype.toServerJSONObject
  25744. * @description 转换成对应的 JSON 格式对象。
  25745. * @returns {Object} 对应的 JSON 格式对象。
  25746. */
  25747. }, {
  25748. key: "toServerJSONObject",
  25749. value: function toServerJSONObject() {
  25750. var obj = {};
  25751. obj = Util.copyAttributes(obj, this);
  25752. if (obj.defaultStyle) {
  25753. if (obj.defaultStyle.toServerJSONObject) {
  25754. obj.defaultStyle = obj.defaultStyle.toServerJSONObject();
  25755. }
  25756. }
  25757. if (obj.items) {
  25758. var items = [],
  25759. len = obj.items.length;
  25760. for (var i = 0; i < len; i++) {
  25761. items.push(obj.items[i].toServerJSONObject());
  25762. }
  25763. obj.items = items;
  25764. }
  25765. return obj;
  25766. }
  25767. /**
  25768. * @function SuperMap.ThemeUnique.fromObj
  25769. * @description 从传入对象获取单值专题图类。
  25770. * @param {Object} obj - 传入对象。
  25771. * @returns {SuperMap.ThemeUnique} ThemeUnique 对象。
  25772. */
  25773. }], [{
  25774. key: "fromObj",
  25775. value: function fromObj(obj) {
  25776. var res = new ThemeUnique();
  25777. var uItems = obj.items;
  25778. var len = uItems ? uItems.length : 0;
  25779. Util.extend(res, obj);
  25780. res.items = [];
  25781. res.defaultStyle = ServerStyle.fromJson(obj.defaultStyle);
  25782. for (var i = 0; i < len; i++) {
  25783. res.items.push(ThemeUniqueItem.fromObj(uItems[i]));
  25784. }
  25785. return res;
  25786. }
  25787. }]);
  25788. return ThemeUnique;
  25789. }(Theme);
  25790. SuperMap.ThemeUnique = ThemeUnique;
  25791. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphAxes.js
  25792. function ThemeGraphAxes_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25793. 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); } }
  25794. function ThemeGraphAxes_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphAxes_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphAxes_defineProperties(Constructor, staticProps); return Constructor; }
  25795. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25796. * This program are made available under the terms of the Apache License, Version 2.0
  25797. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25798. /**
  25799. * @class SuperMap.ThemeGraphAxes
  25800. * @category iServer Map Theme
  25801. * @classdesc 统计专题图坐标轴样式类。
  25802. * @param {Object} options - 参数。
  25803. * @param {SuperMap.ServerColor} [options.axesColor=(0, 0, 0)] - 坐标轴颜色。
  25804. * @param {boolean} [options.axesDisplayed=false] - 是否显示坐标轴。
  25805. * @param {boolean} [options.axesGridDisplayed=false] - 是否在统计图坐标轴上显示网格。
  25806. * @param {boolean} [options.axesTextDisplayed=false] - 是否显示坐标轴的文本标注。
  25807. * @param {SuperMap.ServerTextStyle} [options.axesTextStyle] - 统计符号的最大最小尺寸。
  25808. */
  25809. var ThemeGraphAxes = /*#__PURE__*/function () {
  25810. function ThemeGraphAxes(options) {
  25811. ThemeGraphAxes_classCallCheck(this, ThemeGraphAxes);
  25812. /**
  25813. * @member {SuperMap.ServerColor} [SuperMap.ThemeGraphAxes.prototype.axesColor=(0, 0, 0)]
  25814. * @description 坐标轴颜色。当 axesDisplayed = true 时有效。
  25815. */
  25816. this.axesColor = new ServerColor(0, 0, 0);
  25817. /**
  25818. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesDisplayed=false]
  25819. * @description 是否显示坐标轴。<br>
  25820. * 由于饼状图和环状图无坐标轴,故该属性以及所有与坐标轴设置相关的属性都不适用于它们。并且只有当该值为 true 时,其它设置坐标轴的属性才起作用。
  25821. */
  25822. this.axesDisplayed = false;
  25823. /**
  25824. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesGridDisplayed=false]
  25825. * @description 是否在统计图坐标轴上显示网格。
  25826. */
  25827. this.axesGridDisplayed = false;
  25828. /**
  25829. * @member {boolean} [SuperMap.ThemeGraphAxes.prototype.axesTextDisplayed=false]
  25830. * @description 是否显示坐标轴的文本标注。
  25831. */
  25832. this.axesTextDisplayed = false;
  25833. /**
  25834. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphAxes.prototype.axesTextStyle
  25835. * @description 坐标轴文本风格。当 axesTextDisplayed = true 时有效。
  25836. */
  25837. this.axesTextStyle = new ServerTextStyle();
  25838. if (options) {
  25839. Util.extend(this, options);
  25840. }
  25841. this.CLASS_NAME = "SuperMap.ThemeGraphAxes";
  25842. }
  25843. /**
  25844. * @function SuperMap.ThemeGraphAxes.prototype.destroy
  25845. * @description 释放资源,将引用资源的属性置空。
  25846. */
  25847. ThemeGraphAxes_createClass(ThemeGraphAxes, [{
  25848. key: "destroy",
  25849. value: function destroy() {
  25850. var me = this;
  25851. if (me.axesColor) {
  25852. me.axesColor.destroy();
  25853. me.axesColor = null;
  25854. }
  25855. me.axesDisplayed = null;
  25856. me.axesGridDisplayed = null;
  25857. me.axesTextDisplayed = null;
  25858. if (me.axesTextStyle) {
  25859. me.axesTextStyle.destroy();
  25860. me.axesTextStyle = null;
  25861. }
  25862. }
  25863. /**
  25864. * @function SuperMap.ThemeGraphAxes.fromObj
  25865. * @description 从传入对象获取统计专题图坐标轴样式类。
  25866. * @param {Object} obj - 传入对象。
  25867. * @returns {SuperMap.ThemeGraphAxes} ThemeGraphAxes 对象。
  25868. */
  25869. }], [{
  25870. key: "fromObj",
  25871. value: function fromObj(obj) {
  25872. if (!obj) {
  25873. return;
  25874. }
  25875. var res = new ThemeGraphAxes();
  25876. Util.copy(res, obj);
  25877. res.axesColor = ServerColor.fromJson(obj.axesColor);
  25878. res.axesTextStyle = ServerTextStyle.fromObj(obj.axesTextStyle);
  25879. return res;
  25880. }
  25881. }]);
  25882. return ThemeGraphAxes;
  25883. }();
  25884. SuperMap.ThemeGraphAxes = ThemeGraphAxes;
  25885. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphSize.js
  25886. function ThemeGraphSize_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25887. 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); } }
  25888. function ThemeGraphSize_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphSize_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphSize_defineProperties(Constructor, staticProps); return Constructor; }
  25889. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25890. * This program are made available under the terms of the Apache License, Version 2.0
  25891. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25892. /**
  25893. * @class SuperMap.ThemeGraphSize
  25894. * @category iServer Map Theme
  25895. * @classdesc 统计专题图符号尺寸类。
  25896. * @param {Object} options - 参数。
  25897. * @param {number} [options.maxGraphSize=0] - 统计图中显示的最大图表尺寸基准值。
  25898. * @param {number} [options.minGraphSize=0] - 统计图中显示的最小图表尺寸基准值。
  25899. */
  25900. var ThemeGraphSize = /*#__PURE__*/function () {
  25901. function ThemeGraphSize(options) {
  25902. ThemeGraphSize_classCallCheck(this, ThemeGraphSize);
  25903. /**
  25904. * @member {number} [SuperMap.ThemeGraphSize.prototype.maxGraphSize=0]
  25905. * @description 获取或设置统计图中显示的最大图表尺寸基准值,单位为像素。
  25906. */
  25907. this.maxGraphSize = 0;
  25908. /**
  25909. * @member {number} [SuperMap.ThemeGraphSize.prototype.minGraphSize=0]
  25910. * @description 获取或设置统计图中显示的最小图表尺寸基准值,单位为像素。
  25911. */
  25912. this.minGraphSize = 0;
  25913. if (options) {
  25914. Util.extend(this, options);
  25915. }
  25916. this.CLASS_NAME = "SuperMap.ThemeGraphSize";
  25917. }
  25918. /**
  25919. * @function SuperMap.ThemeGraphSize.prototype.destroy
  25920. * @description 释放资源,将引用资源的属性置空。
  25921. */
  25922. ThemeGraphSize_createClass(ThemeGraphSize, [{
  25923. key: "destroy",
  25924. value: function destroy() {
  25925. var me = this;
  25926. me.maxGraphSize = null;
  25927. me.minGraphSize = null;
  25928. }
  25929. /**
  25930. * @function SuperMap.ThemeGraphSize.fromObj
  25931. * @description 从传入对象获统计专题图符号尺寸类。
  25932. * @param {Object} obj - 传入对象。
  25933. * @returns {SuperMap.ThemeGraphSize} ThemeGraphSize 对象。
  25934. */
  25935. }], [{
  25936. key: "fromObj",
  25937. value: function fromObj(obj) {
  25938. var res = new ThemeGraphSize();
  25939. Util.copy(res, obj);
  25940. return res;
  25941. }
  25942. }]);
  25943. return ThemeGraphSize;
  25944. }();
  25945. SuperMap.ThemeGraphSize = ThemeGraphSize;
  25946. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphText.js
  25947. function ThemeGraphText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  25948. 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); } }
  25949. function ThemeGraphText_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphText_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphText_defineProperties(Constructor, staticProps); return Constructor; }
  25950. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  25951. * This program are made available under the terms of the Apache License, Version 2.0
  25952. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  25953. /**
  25954. * @class SuperMap.ThemeGraphText
  25955. * @category iServer Map Theme
  25956. * @classdesc 统计图文字标注风格类。
  25957. * @param {Object} options - 可选参数。
  25958. * @param {boolean} [options.graphTextDisplayed=false] - 是否显示统计图上的文字标注。
  25959. * @param {SuperMap.ThemeGraphTextFormat} [options.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION] - 统计专题图文本显示格式。
  25960. * @param {SuperMap.ServerTextStyle} [options.graphTextStyle] - 统计图上的文字标注风格。
  25961. */
  25962. var ThemeGraphText = /*#__PURE__*/function () {
  25963. function ThemeGraphText(options) {
  25964. ThemeGraphText_classCallCheck(this, ThemeGraphText);
  25965. /**
  25966. * @member {boolean} [SuperMap.ThemeGraphText.prototype.graphTextDisplayed=false]
  25967. * @description 是否显示统计图上的文字标注。
  25968. */
  25969. this.graphTextDisplayed = false;
  25970. /**
  25971. * @member {SuperMap.ThemeGraphTextFormat} [SuperMap.ThemeGraphText.prototype.graphTextFormat=SuperMap.ThemeGraphTextFormat.CAPTION]
  25972. * @description 统计专题图文本显示格式。
  25973. * 文本显示格式包括百分数、真实数值、标题、标题+百分数、标题+真实数值。
  25974. */
  25975. this.graphTextFormat = ThemeGraphTextFormat.CAPTION;
  25976. /**
  25977. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeGraphText.prototype.graphTextStyle
  25978. * @description 统计图上的文字标注风格。
  25979. */
  25980. this.graphTextStyle = new ServerTextStyle();
  25981. if (options) {
  25982. Util.extend(this, options);
  25983. }
  25984. this.CLASS_NAME = "SuperMap.ThemeGraphText";
  25985. }
  25986. /**
  25987. * @function SuperMap.ThemeGraphText.prototype.destroy
  25988. * @description 释放资源,将引用资源的属性置空。
  25989. */
  25990. ThemeGraphText_createClass(ThemeGraphText, [{
  25991. key: "destroy",
  25992. value: function destroy() {
  25993. var me = this;
  25994. me.graphTextDisplayed = null;
  25995. me.graphTextFormat = null;
  25996. if (me.graphTextStyle) {
  25997. me.graphTextStyle.destroy();
  25998. me.graphTextStyle = null;
  25999. }
  26000. }
  26001. /**
  26002. * @function SuperMap.ThemeGraphText.fromObj
  26003. * @description 从传入对象获取统计图文字标注风格类。
  26004. * @param {Object} obj - 传入对象。
  26005. * @returns {SuperMap.ThemeGraphText} ThemeGraphText 对象。
  26006. */
  26007. }], [{
  26008. key: "fromObj",
  26009. value: function fromObj(obj) {
  26010. var res = new ThemeGraphText();
  26011. Util.copy(res, obj);
  26012. res.graphTextStyle = ServerTextStyle.fromObj(obj.graphTextStyle);
  26013. return res;
  26014. }
  26015. }]);
  26016. return ThemeGraphText;
  26017. }();
  26018. SuperMap.ThemeGraphText = ThemeGraphText;
  26019. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraphItem.js
  26020. function ThemeGraphItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26021. 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); } }
  26022. function ThemeGraphItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraphItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraphItem_defineProperties(Constructor, staticProps); return Constructor; }
  26023. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26024. * This program are made available under the terms of the Apache License, Version 2.0
  26025. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26026. /**
  26027. * @class SuperMap.ThemeGraphItem
  26028. * @category iServer Map Theme
  26029. * @classdesc 统计专题图子项类。
  26030. * @param {Object} options - 参数。
  26031. * @param {string} [options.caption] - 专题图子项的名称。
  26032. * @param {string} options.graphExpression - 统计专题图的专题变量。
  26033. * @param {Array.<number>} [options.memoryDoubleValues] - 内存数组方式制作专题图时的值数组。
  26034. * @param {SuperMap.ServerStyle} [options.uniformStyle] - 统计专题图子项的显示风格
  26035. */
  26036. var ThemeGraphItem = /*#__PURE__*/function () {
  26037. function ThemeGraphItem(options) {
  26038. ThemeGraphItem_classCallCheck(this, ThemeGraphItem);
  26039. /**
  26040. * @member {string} [SuperMap.ThemeGraphItem.prototype.caption]
  26041. * @description 专题图子项的名称。
  26042. */
  26043. this.caption = null;
  26044. /**
  26045. * @member {string} SuperMap.ThemeGraphItem.prototype.graphExpression
  26046. * @description 统计专题图的专题变量。专题变量可以是一个字段或字段表达式。字段必须为数值型;表达式只能为数值型的字段间的运算。
  26047. */
  26048. this.graphExpression = null;
  26049. /**
  26050. * @member {Array.<number>} [SuperMap.ThemeGraphItem.prototype.memoryDoubleValues]
  26051. * @description 内存数组方式制作专题图时的值数组。<br>
  26052. * 内存数组方式制作专题图时,只对 SmID 值在键数组({@link SuperMap.ThemeGraph.memoryKeys})中的记录制作专题图。
  26053. * 值数组的数值个数必须与键数组中数值的个数一致。 值数组中的值将代替原来的专题值来制作统计专题图。
  26054. * 比如:利用面积字段和周长字段(即有两个统计专题图子项 )作为专题变量制作统计专题图。
  26055. */
  26056. this.memoryDoubleValues = null;
  26057. /**
  26058. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraphItem.prototype.uniformStyle]
  26059. * @description 统计专题图子项的显示风格。
  26060. * 每一个统计专题图子项都对应一种显示风格。
  26061. */
  26062. this.uniformStyle = new ServerStyle();
  26063. if (options) {
  26064. Util.extend(this, options);
  26065. }
  26066. this.CLASS_NAME = "SuperMap.ThemeGraphItem";
  26067. }
  26068. /**
  26069. * @function SuperMap.ThemeGraphItem.prototype.destroy
  26070. * @description 释放资源,将引用资源的属性置空。
  26071. */
  26072. ThemeGraphItem_createClass(ThemeGraphItem, [{
  26073. key: "destroy",
  26074. value: function destroy() {
  26075. var me = this;
  26076. me.caption = null;
  26077. me.graphExpression = null;
  26078. me.memoryDoubleValues = null;
  26079. me.uniformStyle = null;
  26080. }
  26081. /**
  26082. * @function SuperMap.ThemeGraphItem.fromObj
  26083. * @description 从传入对象获取统计专题图子项类。
  26084. * @param {Object} obj - 传入对象。
  26085. * @returns {SuperMap.ThemeGraphItem} ThemeGraphItem 对象。
  26086. */
  26087. }], [{
  26088. key: "fromObj",
  26089. value: function fromObj(obj) {
  26090. if (!obj) {
  26091. return;
  26092. }
  26093. var res = new ThemeGraphItem();
  26094. Util.copy(res, obj);
  26095. res.uniformStyle = ServerStyle.fromJson(obj.uniformStyle);
  26096. return res;
  26097. }
  26098. }]);
  26099. return ThemeGraphItem;
  26100. }();
  26101. SuperMap.ThemeGraphItem = ThemeGraphItem;
  26102. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraph.js
  26103. function ThemeGraph_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGraph_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGraph_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGraph_typeof(obj); }
  26104. function ThemeGraph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26105. 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); } }
  26106. function ThemeGraph_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraph_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraph_defineProperties(Constructor, staticProps); return Constructor; }
  26107. function ThemeGraph_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraph_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeGraph_get(target, property, receiver || target); }
  26108. function ThemeGraph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraph_getPrototypeOf(object); if (object === null) break; } return object; }
  26109. 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 } }); if (superClass) ThemeGraph_setPrototypeOf(subClass, superClass); }
  26110. function ThemeGraph_setPrototypeOf(o, p) { ThemeGraph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraph_setPrototypeOf(o, p); }
  26111. 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); }; }
  26112. function ThemeGraph_possibleConstructorReturn(self, call) { if (call && (ThemeGraph_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraph_assertThisInitialized(self); }
  26113. function ThemeGraph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26114. function ThemeGraph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26115. function ThemeGraph_getPrototypeOf(o) { ThemeGraph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraph_getPrototypeOf(o); }
  26116. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26117. * This program are made available under the terms of the Apache License, Version 2.0
  26118. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26119. /**
  26120. * @class SuperMap.ThemeGraph
  26121. * @category iServer Map Theme
  26122. * @classdesc 统计专题图类。
  26123. * @extends {SuperMap.Theme}
  26124. * @param {Object} options - 参数。
  26125. * @param {Array.<SuperMap.ThemeGraphItem>} options.items - 统计专题图子项集合。
  26126. * @param {number} [options.barWidth=0] - 柱状专题图中每一个柱的宽度。
  26127. * @param {SuperMap.ThemeFlow} [options.flow] - 统计专题图流动显示与牵引线设置。
  26128. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 统计图中地理要素的值与图表尺寸间的映射关系。
  26129. * @param {SuperMap.ThemeGraphAxes} [options.graphAxes] - 统计图中坐标轴样式相关信息。
  26130. * @param {SuperMap.ThemeGraphSize} [options.graphSize=0] - 统计符号的最大最小尺寸。
  26131. * @param {boolean} [options.graphSizeFixed=false] - 缩放地图时统计图符号是否固定大小。
  26132. * @param {SuperMap.ThemeGraphText} [options.graphText] - 统计图上的文字是否可以见以及文字标注风格。
  26133. * @param {SuperMap.GraphAxesTextDisplayMode} [options.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE] - 统计专题图坐标轴文本显示模式。
  26134. * @param {SuperMap.ThemeGraphType} [options.graphType=SuperMap.ThemeGraphType.AREA] - 统计专题图类型。
  26135. * @param {Array.<number>} [options.memoryKeys] - 以内存数组方式制作专题图时的键数组。
  26136. * @param {boolean} [options.negativeDisplayed=false] - 专题图中是否显示属性为负值的数据。
  26137. * @param {SuperMap.ThemeOffset} [options.offset] - 统计图相对于要素内点的偏移量。
  26138. * @param {boolean} [options.overlapAvoided=true] - 统计图是否采用避让方式显示。
  26139. * @param {number} [options.roseAngle=0] - 统计图中玫瑰图或三维玫瑰图用于等分的角度。
  26140. * @param {number} [options.startAngle=0] - 饼状统计图扇形的起始角度。
  26141. */
  26142. var ThemeGraph = /*#__PURE__*/function (_Theme) {
  26143. ThemeGraph_inherits(ThemeGraph, _Theme);
  26144. var _super = ThemeGraph_createSuper(ThemeGraph);
  26145. function ThemeGraph(options) {
  26146. var _this;
  26147. ThemeGraph_classCallCheck(this, ThemeGraph);
  26148. _this = _super.call(this, "GRAPH", options);
  26149. /**
  26150. * @member {number} [SuperMap.ThemeGraph.prototype.barWidth=0]
  26151. * @description 柱状专题图中每一个柱的宽度。使用地图坐标单位。
  26152. * 只有选择的统计图类型为柱状图(柱状图、三维柱状图、堆叠柱状图、三维堆叠柱状图)时,此项才可设置。
  26153. */
  26154. _this.barWidth = 0;
  26155. /**
  26156. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraph.prototype.flow
  26157. * @description 统计专题图流动显示与牵引线设置。
  26158. * 通过该字段可以设置统计符号是否流动显示和牵引线风格。
  26159. */
  26160. _this.flow = new ThemeFlow();
  26161. /**
  26162. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraph.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  26163. * @description 统计图中地理要素的值与图表尺寸间的映射关系(常数、对数、平方根),即分级方式。
  26164. * 分级主要是为了减少制作统计专题图中数据大小之间的差异,使得统计图的视觉效果比较好,同时不同类别之间的比较也还是有意义的。
  26165. * 提供三种分级模式:常数、对数和平方根,对于有值为负数的字段,不可以采用对数和平方根的分级方式。不同的等级方式用于确定符号大小的数值是不相同的。
  26166. */
  26167. _this.graduatedMode = GraduatedMode.CONSTANT;
  26168. /**
  26169. * @member {SuperMap.ThemeGraphAxes} SuperMap.ThemeGraph.prototype.graphAxes
  26170. * @description 用于设置统计图中坐标轴样式相关信息,如坐标轴颜色、是否显示、坐标文本样式等。
  26171. */
  26172. _this.graphAxes = new ThemeGraphAxes();
  26173. /**
  26174. * @member {SuperMap.ThemeGraphSize} [SuperMap.ThemeGraph.prototype.graphSize=0]
  26175. * @description 用于设置统计符号的最大最小尺寸。
  26176. */
  26177. _this.graphSize = new ThemeGraphSize();
  26178. /**
  26179. * @member {boolean} [SuperMap.ThemeGraph.prototype.graphSizeFixed=false]
  26180. * @description 缩放地图时统计图符号是否固定大小。即统计图符号将随地图缩放。
  26181. */
  26182. _this.graphSizeFixed = false;
  26183. /**
  26184. * @member {SuperMap.ThemeGraphText} SuperMap.ThemeGraph.prototype.graphText
  26185. * @description 统计图上的文字是否可以见以及文字标注风格。
  26186. */
  26187. _this.graphText = new ThemeGraphText();
  26188. /**
  26189. * @member {SuperMap.ThemeGraphType} [SuperMap.ThemeGraph.prototype.graphType=SuperMap.ThemeGraphType.AREA]
  26190. * @description 统计专题图类型。SuperMap 提供了多种类型的统计图,
  26191. * 分别为面积图、阶梯图、折线图、点状图、柱状图、三维柱状图、饼图、三维饼图、玫瑰图、三维玫瑰图、堆叠柱状图、三维堆叠柱状图、环状图。默认为面积图。
  26192. */
  26193. _this.graphType = ThemeGraphType.AREA;
  26194. /**
  26195. * @member {SuperMap.GraphAxesTextDisplayMode} [SuperMap.ThemeGraph.prototype.graphAxesTextDisplayMode=SuperMap.GraphAxesTextDisplayMode.NONE]
  26196. * @description 统计专题图坐标轴文本显示模式。
  26197. */
  26198. _this.graphAxesTextDisplayMode = GraphAxesTextDisplayMode.NONE;
  26199. /**
  26200. * @member {Array.<SuperMap.ThemeGraphItem>} SuperMap.ThemeGraph.prototype.items
  26201. * @description 统计专题图子项集合。
  26202. * 统计专题图可以基于多个变量,反映多种属性,即可以将多个专题变量的值绘制在一个统计图上。每一个专题变量对应的统计图即为一个专题图子项。
  26203. * 对于每个专题图子项可以为其设置标题、风格,甚至可以将该子项再制作成范围分段专题图。
  26204. */
  26205. _this.items = null;
  26206. /**
  26207. * @member {Array.<number>} SuperMap.ThemeGraph.prototype.memoryKeys
  26208. * @description 以内存数组方式制作专题图时的键数组。
  26209. * 键数组内的数值代表 SmID 值,它与 SuperMap.ThemeGraphItem 类中的值数组(SuperMap.ThemeGraphItem.memoryDoubleValues)要关联起来应用。
  26210. * 键数组中数值的个数必须要与值数组的数值个数一致。值数组中的值将代替原来的专题值来制作统计专题图。
  26211. * 目前所有的专题图都支持以内存数组的方式制作专题图,但统计专题图与其他专题图指定内存数组的方式不同,
  26212. * 统计专题图使用 memoryKeys 指定内存数组,而其他专题图则使用 memoryData 来指定内存数组。
  26213. * @example
  26214. * memoryKeys 的使用方法如下:
  26215. * function addThemeGraph() {
  26216. * removeTheme();
  26217. * //创建统计专题图对象,SuperMap.ThemeGraph 必设 items。
  26218. * //专题图参数 ThemeParameters 必设 theme(即以设置好的分段专题图对象)、dataSourceName 和 datasetName
  26219. * var style1 = new SuperMap.ServerStyle({
  26220. * fillForeColor: new SuperMap.ServerColor(92,73,234),
  26221. * lineWidth: 0.1
  26222. * }),
  26223. * style2 = new SuperMap.ServerStyle({
  26224. * fillForeColor: new SuperMap.ServerColor(211,111,240),
  26225. * lineWidth: 0.1
  26226. * }),
  26227. * item1 = new SuperMap.ThemeGraphItem({
  26228. * memoryDoubleValues:[1.18,0.95,0.37,1.31,0.8,1.5],
  26229. * caption: "1992-1995人口增长率",
  26230. * graphExpression: "Pop_Rate95",
  26231. * uniformStyle: style1
  26232. * }),
  26233. * item2 = new SuperMap.ThemeGraphItem({
  26234. * //以内存数组方式制作专题图时的值数组
  26235. * memoryDoubleValues:[2.71,0,0.74,3.1,2.2,3.5],
  26236. * caption: "1995-1999人口增长率", //专题图子项的名称
  26237. * graphExpression: "Pop_Rate99", //统计专题图的专题变量
  26238. * uniformStyle: style2 //统计专题图子项的显示风格
  26239. * }),
  26240. * themeGraph = new SuperMap.ThemeGraph({
  26241. * //以内存数组方式制作专题图时的键数组,键数组内的数值代表 SmID 值
  26242. * memoryKeys:[1,2,4,8,10,12],
  26243. * items: new Array(item1,item2),
  26244. * barWidth: 0.03,
  26245. * //统计图中地理要素的值与图表尺寸间的映射关系为平方根
  26246. * graduatedMode: SuperMap.GraduatedMode.SQUAREROOT,
  26247. * //graphAxes用于设置统计图中坐标轴样式相关信息
  26248. * graphAxes: new SuperMap.ThemeGraphAxes({
  26249. * axesDisplayed: true
  26250. * }),
  26251. * graphSize: new SuperMap.ThemeGraphSize({
  26252. * maxGraphSize: 1,
  26253. * minGraphSize: 0.35
  26254. * }),
  26255. * //统计图上的文字是否可以见以及文字标注风格
  26256. * graphText: new SuperMap.ThemeGraphText({
  26257. * graphTextDisplayed: true,
  26258. * graphTextFormat: SuperMap.ThemeGraphTextFormat.VALUE,
  26259. * graphTextStyle: new SuperMap.ServerTextStyle({
  26260. * sizeFixed: true,
  26261. * fontHeight: 9,
  26262. * fontWidth: 5
  26263. * })
  26264. * }),
  26265. * //统计专题图类型为三维柱状图
  26266. * graphType: SuperMap.ThemeGraphType.BAR3D
  26267. * }),
  26268. * //专题图参数对象
  26269. * themeParameters = new SuperMap.ThemeParameters({
  26270. * themes: [themeGraph],
  26271. * dataSourceNames: ["Jingjin"],
  26272. * datasetNames: ["BaseMap_R"]
  26273. * }),
  26274. * //与服务端交互
  26275. * themeService=new SuperMap.ThemeService(url, {
  26276. * eventListeners: {
  26277. * "processCompleted": ThemeCompleted,
  26278. * "processFailed": themeFailed
  26279. * }
  26280. * });
  26281. * themeService.processAsync(themeParameters);
  26282. * }
  26283. */
  26284. _this.memoryKeys = null;
  26285. /**
  26286. * @member {boolean} [SuperMap.ThemeGraph.prototype.negativeDisplayed=false]
  26287. * @description 专题图中是否显示属性为负值的数据。true 表示显示;falese 不显示。
  26288. */
  26289. _this.negativeDisplayed = false;
  26290. /**
  26291. * @member {SuperMap.ThemeOffset} SuperMap.ThemeGraph.prototype.offset
  26292. * @description 用于设置统计图相对于要素内点的偏移量。
  26293. */
  26294. _this.offset = new ThemeOffset();
  26295. /**
  26296. * @member {boolean} SuperMap.ThemeGraph.prototype.overlapAvoided
  26297. * @description 统计图是否采用避让方式显示。<br>
  26298. * 1.对数据集制作统计专题图:当统计图采用避让方式显示时,如果 overlapAvoided 为 true,则在统计图重叠度很大的情况下,
  26299. * 会出现无法完全避免统计图重叠的现象;如果 overlapAvoided 为 false,会过滤掉一些统计图,从而保证所有的统计图均不重叠。<br>
  26300. * 2.对数据集同时制作统计专题图和标签专题图:当统计图不显示子项文本时,标签专题图的标签即使和统计图重叠,两者也都可正常显示;
  26301. * 当统计图显示子项文本时,如果统计图中的子项文本和标签专题图中的标签不重叠,则两者均正常显示;如果重叠,则会过滤掉统计图的子项文本,只显示标签。
  26302. */
  26303. _this.overlapAvoided = true;
  26304. /**
  26305. * @member {number} [SuperMap.ThemeGraph.prototype.roseAngle=0]
  26306. * @description 统计图中玫瑰图或三维玫瑰图用于等分的角度,默认为 0 度,精确到 0.1 度。在角度为0或者大于 360 度的情况下均使用 360 度来等分制作统计图的字段数。
  26307. */
  26308. _this.roseAngle = 0;
  26309. /**
  26310. * @member {number} [SuperMap.ThemeGraph.prototype.startAngle=0]
  26311. * @description 饼状统计图扇形的起始角度。精确到 0.1 度,以水平方向为正向。只有选择的统计图类型为饼状图(饼图、三维饼图、玫瑰图、三维玫瑰图)时,此项才可设置。
  26312. */
  26313. _this.startAngle = 0;
  26314. if (options) {
  26315. Util.extend(ThemeGraph_assertThisInitialized(_this), options);
  26316. }
  26317. _this.CLASS_NAME = "SuperMap.ThemeGraph";
  26318. return _this;
  26319. }
  26320. /**
  26321. * @function SuperMap.ThemeGraph.prototype.destroy
  26322. * @override
  26323. */
  26324. ThemeGraph_createClass(ThemeGraph, [{
  26325. key: "destroy",
  26326. value: function destroy() {
  26327. ThemeGraph_get(ThemeGraph_getPrototypeOf(ThemeGraph.prototype), "destroy", this).call(this);
  26328. var me = this;
  26329. me.barWidth = null;
  26330. if (me.flow) {
  26331. me.flow.destroy();
  26332. me.flow = null;
  26333. }
  26334. me.graduatedMode = null;
  26335. if (me.graphAxes) {
  26336. me.graphAxes.destroy();
  26337. me.graphAxes = null;
  26338. }
  26339. if (me.graphSize) {
  26340. me.graphSize.destroy();
  26341. me.graphSize = null;
  26342. }
  26343. me.graphSizeFixed = null;
  26344. if (me.graphText) {
  26345. me.graphText.destroy();
  26346. me.graphText = null;
  26347. }
  26348. me.graphType = null;
  26349. if (me.items) {
  26350. for (var i = 0, items = me.items, len = items.length; i < len; i++) {
  26351. items[i].destroy();
  26352. }
  26353. me.items = null;
  26354. }
  26355. me.memoryKeys = null;
  26356. me.negativeDisplayed = null;
  26357. if (me.offset) {
  26358. me.offset.destroy();
  26359. me.offset = null;
  26360. }
  26361. me.overlapAvoided = null;
  26362. me.roseAngle = null;
  26363. me.startAngle = null;
  26364. me.graphAxesTextDisplayMode = null;
  26365. }
  26366. /**
  26367. * @function SuperMap.ThemeGraph.prototype.toJSON
  26368. * @description 将 SuperMap.ThemeGraph 对象转化为 JSON 字符串。
  26369. * @returns {string} 返回转换后的 JSON 字符串。
  26370. */
  26371. }, {
  26372. key: "toJSON",
  26373. value: function toJSON() {
  26374. return Util.toJSON(this.toServerJSONObject());
  26375. }
  26376. /**
  26377. * @function SuperMap.ThemeGraph.prototype.toServerJSONObject
  26378. * @description 转换成对应的 JSON 格式对象。
  26379. * @returns {Object} 对应的 JSON 格式对象。
  26380. */
  26381. }, {
  26382. key: "toServerJSONObject",
  26383. value: function toServerJSONObject() {
  26384. var obj = {};
  26385. obj.type = this.type;
  26386. if (this.graphText) {
  26387. obj.graphTextDisplayed = this.graphText.graphTextDisplayed;
  26388. obj.graphTextFormat = this.graphText.graphTextFormat;
  26389. obj.graphTextStyle = this.graphText.graphTextStyle;
  26390. }
  26391. if (this.flow) {
  26392. obj.flowEnabled = this.flow.flowEnabled;
  26393. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  26394. obj.leaderLineStyle = this.flow.leaderLineStyle;
  26395. }
  26396. if (this.graphAxes) {
  26397. obj.axesColor = this.graphAxes.axesColor;
  26398. obj.axesDisplayed = this.graphAxes.axesDisplayed;
  26399. obj.axesGridDisplayed = this.graphAxes.axesGridDisplayed;
  26400. obj.axesTextDisplayed = this.graphAxes.axesTextDisplayed;
  26401. obj.axesTextStyle = this.graphAxes.axesTextStyle;
  26402. }
  26403. if (this.graphSize) {
  26404. obj.maxGraphSize = this.graphSize.maxGraphSize;
  26405. obj.minGraphSize = this.graphSize.minGraphSize;
  26406. }
  26407. if (this.offset) {
  26408. obj.offsetFixed = this.offset.offsetFixed;
  26409. obj.offsetX = this.offset.offsetX;
  26410. obj.offsetY = this.offset.offsetY;
  26411. }
  26412. obj.barWidth = this.barWidth;
  26413. obj.graduatedMode = this.graduatedMode;
  26414. obj.graphSizeFixed = this.graphSizeFixed;
  26415. obj.graphType = this.graphType;
  26416. obj.graphAxesTextDisplayMode = this.graphAxesTextDisplayMode;
  26417. obj.items = this.items;
  26418. obj.memoryKeys = this.memoryKeys;
  26419. obj.negativeDisplayed = this.negativeDisplayed;
  26420. obj.overlapAvoided = this.overlapAvoided;
  26421. obj.roseAngle = this.roseAngle;
  26422. obj.startAngle = this.startAngle;
  26423. return obj;
  26424. }
  26425. /**
  26426. * @function SuperMap.ThemeGraph.fromObj
  26427. * @description 从传入对象获取统计专题图类。
  26428. * @param {Object} obj - 传入对象。
  26429. * @returns {SuperMap.ThemeGraph} ThemeGraph 对象。
  26430. */
  26431. }], [{
  26432. key: "fromObj",
  26433. value: function fromObj(obj) {
  26434. var res = new ThemeGraph();
  26435. var itemsG = obj.items;
  26436. var len = itemsG ? itemsG.length : 0;
  26437. Util.copy(res, obj);
  26438. res.items = [];
  26439. res.flow = ThemeFlow.fromObj(obj);
  26440. res.graphAxes = ThemeGraphAxes.fromObj(obj);
  26441. res.graphSize = ThemeGraphSize.fromObj(obj);
  26442. res.graphText = ThemeGraphText.fromObj(obj);
  26443. res.offset = ThemeOffset.fromObj(obj);
  26444. for (var i = 0; i < len; i++) {
  26445. res.items.push(ThemeGraphItem.fromObj(itemsG[i]));
  26446. }
  26447. return res;
  26448. }
  26449. }]);
  26450. return ThemeGraph;
  26451. }(Theme);
  26452. SuperMap.ThemeGraph = ThemeGraph;
  26453. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeDotDensity.js
  26454. function ThemeDotDensity_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeDotDensity_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeDotDensity_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeDotDensity_typeof(obj); }
  26455. function ThemeDotDensity_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26456. 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); } }
  26457. function ThemeDotDensity_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeDotDensity_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeDotDensity_defineProperties(Constructor, staticProps); return Constructor; }
  26458. 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 } }); if (superClass) ThemeDotDensity_setPrototypeOf(subClass, superClass); }
  26459. function ThemeDotDensity_setPrototypeOf(o, p) { ThemeDotDensity_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeDotDensity_setPrototypeOf(o, p); }
  26460. 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); }; }
  26461. function ThemeDotDensity_possibleConstructorReturn(self, call) { if (call && (ThemeDotDensity_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeDotDensity_assertThisInitialized(self); }
  26462. function ThemeDotDensity_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26463. function ThemeDotDensity_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26464. function ThemeDotDensity_getPrototypeOf(o) { ThemeDotDensity_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeDotDensity_getPrototypeOf(o); }
  26465. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26466. * This program are made available under the terms of the Apache License, Version 2.0
  26467. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26468. /**
  26469. * @class SuperMap.ThemeDotDensity
  26470. * @category iServer Map Theme
  26471. * @classdesc 点密度专题图。
  26472. * @description 点密度专题图用一定大小、形状相同的点表示现象分布范围、数量特征和分布密度。点的多少和所代表的意义由地图的内容确定。
  26473. * 点密度专题图利用图层的某一数值属性信息(专题值)映射为不同等级,每一级别使用不同数量或表现为密度的点符号来表示。
  26474. * 该专题值在各个分区内的分布情况,体现不同区域的相对数量差异。多用于具有数量特征的地图上,
  26475. * 比如表示不同地区的粮食产量、GDP、人口等的分级,主要针对区域或面状的要素,因而,点密度专题图适用于面数据集。
  26476. * 注意:点密度专题图中点的分布是随机的,并不代表实际的分布位置。即使在相关设置完全相同的情况下,
  26477. * 每次制作出的专题图,点的数量相同,但点的位置都有差异。
  26478. * @extends {SuperMap.Theme}
  26479. * @param {Object} options - 参数。
  26480. * @param {string} options.dotExpression - 创建点密度专题图的字段或字段表达式。
  26481. * @param {SuperMap.ServerStyle} [options.style] - 点密度专题图中点的风格。
  26482. * @param {number} [options.value] - 专题图中每一个点所代表的数值。
  26483. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26484. */
  26485. var ThemeDotDensity = /*#__PURE__*/function (_Theme) {
  26486. ThemeDotDensity_inherits(ThemeDotDensity, _Theme);
  26487. var _super = ThemeDotDensity_createSuper(ThemeDotDensity);
  26488. function ThemeDotDensity(options) {
  26489. var _this;
  26490. ThemeDotDensity_classCallCheck(this, ThemeDotDensity);
  26491. _this = _super.call(this, "DOTDENSITY", options);
  26492. /**
  26493. * @member {string} SuperMap.ThemeDotDensity.prototype.dotExpression
  26494. * @description 创建点密度专题图的字段或字段表达式。点的数目或密集程度的来源。
  26495. */
  26496. _this.dotExpression = null;
  26497. /**
  26498. * @member {SuperMap.ServerStyle} SuperMap.ThemeDotDensity.prototype.style
  26499. * @description 点密度专题图中点的风格。
  26500. */
  26501. _this.style = new ServerStyle();
  26502. /**
  26503. * @member {number} SuperMap.ThemeDotDensity.prototype.value
  26504. * @description 专题图中每一个点所代表的数值。<br>
  26505. * 点值的确定与地图比例尺以及点的大小有关。地图比例尺越大,相应的图面范围也越大,
  26506. * 点相应就可以越多,此时点值就可以设置相对小一些。点形状越大,
  26507. * 点值相应就应该设置的小一些。点值过大或过小都是不合适的。
  26508. */
  26509. _this.value = null;
  26510. if (options) {
  26511. Util.extend(ThemeDotDensity_assertThisInitialized(_this), options);
  26512. }
  26513. _this.CLASS_NAME = "SuperMap.ThemeDotDensity";
  26514. return _this;
  26515. }
  26516. /**
  26517. * @function SuperMap.ThemeDotDensity.prototype.destroy
  26518. * @description 释放资源,将引用资源的属性置空。
  26519. */
  26520. ThemeDotDensity_createClass(ThemeDotDensity, [{
  26521. key: "destroy",
  26522. value: function destroy() {
  26523. var me = this;
  26524. me.dotExpression = null;
  26525. me.value = null;
  26526. if (me.style) {
  26527. me.style.destroy();
  26528. me.style = null;
  26529. }
  26530. }
  26531. /**
  26532. * @function SuperMap.ThemeDotDensity.prototype.toServerJSONObject
  26533. * @description 转换成对应的 JSON 格式对象。
  26534. * @returns {Object} 对应的 JSON 格式对象。
  26535. */
  26536. }, {
  26537. key: "toServerJSONObject",
  26538. value: function toServerJSONObject() {
  26539. var obj = {};
  26540. obj = Util.copyAttributes(obj, this);
  26541. if (obj.style) {
  26542. if (obj.style.toServerJSONObject) {
  26543. obj.style = obj.style.toServerJSONObject();
  26544. }
  26545. }
  26546. return obj;
  26547. }
  26548. /**
  26549. * @function SuperMap.ThemeDotDensity.fromObj
  26550. * @description 从传入对象获取点密度专题图中点的风格。
  26551. * @param {Object} obj - 传入对象。
  26552. * @returns {SuperMap.ThemeDotDensity} ThemeDotDensity 对象。
  26553. */
  26554. }], [{
  26555. key: "fromObj",
  26556. value: function fromObj(obj) {
  26557. if (!obj) {
  26558. return;
  26559. }
  26560. var res = new ThemeDotDensity();
  26561. Util.copy(res, obj);
  26562. res.style = ServerStyle.fromJson(obj.style);
  26563. return res;
  26564. }
  26565. }]);
  26566. return ThemeDotDensity;
  26567. }(Theme);
  26568. SuperMap.ThemeDotDensity = ThemeDotDensity;
  26569. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbolStyle.js
  26570. function ThemeGraduatedSymbolStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26571. 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); } }
  26572. function ThemeGraduatedSymbolStyle_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbolStyle_defineProperties(Constructor, staticProps); return Constructor; }
  26573. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26574. * This program are made available under the terms of the Apache License, Version 2.0
  26575. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26576. /**
  26577. * @class SuperMap.ThemeGraduatedSymbolStyle
  26578. * @category iServer Map Theme
  26579. * @classdesc 等级符号专题图正负零值显示风格类。
  26580. * @param {Object} options - 参数。
  26581. * @param {boolean} [options.negativeDisplayed=false] - 是否显示负值。
  26582. * @param {SuperMap.ServerStyle} [options.negativeStyle] - 负值的等级符号风格。
  26583. * @param {SuperMap.ServerStyle} [options.positiveStyle] - 正值的等级符号风格。
  26584. * @param {boolean} [options.zeroDisplayed=false] - 是否显示 0 值。
  26585. * @param {SuperMap.ServerStyle} [options.zeroStyle] - 0 值的等级符号风格。
  26586. */
  26587. var ThemeGraduatedSymbolStyle = /*#__PURE__*/function () {
  26588. function ThemeGraduatedSymbolStyle(options) {
  26589. ThemeGraduatedSymbolStyle_classCallCheck(this, ThemeGraduatedSymbolStyle);
  26590. /**
  26591. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeDisplayed=false]
  26592. * @description 是否显示负值。
  26593. */
  26594. this.negativeDisplayed = false;
  26595. /**
  26596. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.negativeStyle]
  26597. * @description 负值的等级符号风格。
  26598. */
  26599. this.negativeStyle = new ServerStyle();
  26600. /**
  26601. * @member {SuperMap.ServerStyle} [SuperMap.ThemeGraduatedSymbolStyle.prototype.positiveStyle]
  26602. * @description 正值的等级符号风格。
  26603. */
  26604. this.positiveStyle = new ServerStyle();
  26605. /**
  26606. * @member {boolean} [SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroDisplayed=false]
  26607. * @description 是否显示 0 值。
  26608. */
  26609. this.zeroDisplayed = false;
  26610. /**
  26611. * @member {SuperMap.ServerStyle} SuperMap.ThemeGraduatedSymbolStyle.prototype.zeroStyle
  26612. * @description 0 值的等级符号风格。
  26613. */
  26614. this.zeroStyle = new ServerStyle();
  26615. if (options) {
  26616. Util.extend(this, options);
  26617. }
  26618. this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbolStyle";
  26619. }
  26620. /**
  26621. * @function SuperMap.ThemeGraduatedSymbolStyle.prototype.destroy
  26622. * @description 释放资源,将引用资源的属性置空。
  26623. */
  26624. ThemeGraduatedSymbolStyle_createClass(ThemeGraduatedSymbolStyle, [{
  26625. key: "destroy",
  26626. value: function destroy() {
  26627. var me = this;
  26628. me.negativeDisplayed = null;
  26629. me.negativeStyle = null;
  26630. me.positiveStyle = null;
  26631. me.zeroDisplayed = null;
  26632. me.zeroStyle = null;
  26633. }
  26634. /**
  26635. * @function SuperMap.ThemeGraduatedSymbolStyle.fromObj
  26636. * @description 从传入对象获取等级符号专题图正负零值显示风格类。
  26637. * @param {Object} obj - 传入对象。
  26638. * @returns {SuperMap.ThemeGraduatedSymbolStyle} ThemeGraduatedSymbolStyle 对象。
  26639. */
  26640. }], [{
  26641. key: "fromObj",
  26642. value: function fromObj(obj) {
  26643. if (!obj) {
  26644. return;
  26645. }
  26646. var res = new ThemeGraduatedSymbolStyle();
  26647. Util.copy(res, obj);
  26648. res.negativeStyle = ServerStyle.fromJson(obj.negativeStyle);
  26649. res.positiveStyle = ServerStyle.fromJson(obj.positiveStyle);
  26650. res.zeroStyle = ServerStyle.fromJson(obj.zeroStyle);
  26651. return res;
  26652. }
  26653. }]);
  26654. return ThemeGraduatedSymbolStyle;
  26655. }();
  26656. SuperMap.ThemeGraduatedSymbolStyle = ThemeGraduatedSymbolStyle;
  26657. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGraduatedSymbol.js
  26658. function ThemeGraduatedSymbol_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGraduatedSymbol_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGraduatedSymbol_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGraduatedSymbol_typeof(obj); }
  26659. function ThemeGraduatedSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26660. 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); } }
  26661. function ThemeGraduatedSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGraduatedSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGraduatedSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  26662. function ThemeGraduatedSymbol_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGraduatedSymbol_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeGraduatedSymbol_get(target, property, receiver || target); }
  26663. function ThemeGraduatedSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGraduatedSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  26664. 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 } }); if (superClass) ThemeGraduatedSymbol_setPrototypeOf(subClass, superClass); }
  26665. function ThemeGraduatedSymbol_setPrototypeOf(o, p) { ThemeGraduatedSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGraduatedSymbol_setPrototypeOf(o, p); }
  26666. 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); }; }
  26667. function ThemeGraduatedSymbol_possibleConstructorReturn(self, call) { if (call && (ThemeGraduatedSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGraduatedSymbol_assertThisInitialized(self); }
  26668. function ThemeGraduatedSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26669. function ThemeGraduatedSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26670. function ThemeGraduatedSymbol_getPrototypeOf(o) { ThemeGraduatedSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGraduatedSymbol_getPrototypeOf(o); }
  26671. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26672. * This program are made available under the terms of the Apache License, Version 2.0
  26673. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26674. /**
  26675. * @class SuperMap.ThemeGraduatedSymbol
  26676. * @category iServer Map Theme
  26677. * @classdesc 等级符号专题图。
  26678. * @extends {SuperMap.Theme}
  26679. * @param {Object} options - 参数。
  26680. * @param {SuperMap.ThemeGraduatedSymbolStyle} options.style - 用于设置等级符号图正负和零值显示风格。
  26681. * @param {string} options.expression - 等级符号专题图的字段或字段表达式。
  26682. * @param {number} [options.baseValue=0] - 等级符号专题图的基准值,单位同专题变量的单位。
  26683. * @param {SuperMap.ThemeFlow} [options.flow] - 等级符号专题图符号流动显示与牵引线设置类。
  26684. * @param {SuperMap.GraduatedMode} [options.graduatedMode=SuperMap.GraduatedMode.CONSTANT] - 等级符号专题图分级模式。
  26685. * @param {SuperMap.ThemeOffset} [options.offset] - 用于设置标签专题图中标记文本相对于要素内点的偏移量对象。
  26686. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26687. */
  26688. var ThemeGraduatedSymbol = /*#__PURE__*/function (_Theme) {
  26689. ThemeGraduatedSymbol_inherits(ThemeGraduatedSymbol, _Theme);
  26690. var _super = ThemeGraduatedSymbol_createSuper(ThemeGraduatedSymbol);
  26691. function ThemeGraduatedSymbol(options) {
  26692. var _this;
  26693. ThemeGraduatedSymbol_classCallCheck(this, ThemeGraduatedSymbol);
  26694. _this = _super.call(this, "GRADUATEDSYMBOL", options);
  26695. /**
  26696. * @member {number} [SuperMap.ThemeGraduatedSymbol.prototype.baseValue=0]
  26697. * @description 等级符号专题图的基准值,单位同专题变量的单位。<br>
  26698. * 依据此值系统会自动根据分级方式计算其余值对应的符号大小,每个符号的显示大小等于
  26699. * ThemeValueSection.positiveStyle(或 zeroStyle,negativeStyle).markerSize * value / basevalue,
  26700. * 其中 value 是 expression 所指定字段对应的值经过分级计算之后的值。默认值为0,建议通过多次尝试设置该值才能达到较好的显示效果。
  26701. */
  26702. _this.baseValue = 0;
  26703. /**
  26704. * @member {string} SuperMap.ThemeGraduatedSymbol.prototype.expression
  26705. * @description 用于创建等级符号专题图的字段或字段表达式,字段或字段表达式应为数值型。
  26706. */
  26707. _this.expression = null;
  26708. /**
  26709. * @member {SuperMap.ThemeFlow} SuperMap.ThemeGraduatedSymbol.prototype.flow
  26710. * @description 等级符号专题图符号流动显示与牵引线设置类。<br>
  26711. * 通过该字段可以设置等级符号是否流动显示和牵引线风格。
  26712. */
  26713. _this.flow = new ThemeFlow();
  26714. /**
  26715. * @member {SuperMap.GraduatedMode} [SuperMap.ThemeGraduatedSymbol.prototype.graduatedMode=SuperMap.GraduatedMode.CONSTANT]
  26716. * @description 等级符号专题图分级模式。<br>
  26717. * 分级主要是为了减少制作等级符号专题图中数据大小之间的差异。如果数据之间差距较大,则可以采用对数或者平方根的分级方式来进行,
  26718. * 这样就减少了数据之间的绝对大小的差异,使得等级符号图的视觉效果比较好,同时不同类别之间的比较也是有意义的。
  26719. * 有三种分级模式:常数、对数和平方根,对于有值为负数的字段,在用对数或平方根方式分级时,默认对负数取正。
  26720. * 不同的分级模式用于确定符号大小的数值是不相同的:常数按照字段的原始数据进行;对数则是对每条记录对应的专题变量取自然对数;
  26721. * 平方根则是对其取平方根,然后用最终得到的结果来确定其等级符号的大小。
  26722. */
  26723. _this.graduatedMode = SuperMap.GraduatedMode.CONSTAN;
  26724. /**
  26725. * @member {SuperMap.ThemeOffset} [SuperMap.ThemeGraduatedSymbol.prototype.offset]
  26726. * @description 用于设置等级符号图相对于要素内点的偏移量。
  26727. */
  26728. _this.offset = new ThemeOffset();
  26729. /**
  26730. * @member {SuperMap.ThemeGraduatedSymbolStyle} SuperMap.ThemeGraduatedSymbol.prototype.style
  26731. * @description 用于设置等级符号图正负和零值显示风格。
  26732. */
  26733. _this.style = new ThemeGraduatedSymbolStyle();
  26734. if (options) {
  26735. Util.extend(ThemeGraduatedSymbol_assertThisInitialized(_this), options);
  26736. }
  26737. _this.CLASS_NAME = "SuperMap.ThemeGraduatedSymbol";
  26738. return _this;
  26739. }
  26740. /**
  26741. * @function SuperMap.ThemeGraduatedSymbol.prototype.destroy
  26742. * @description 释放资源,将引用资源的属性置空。
  26743. */
  26744. ThemeGraduatedSymbol_createClass(ThemeGraduatedSymbol, [{
  26745. key: "destroy",
  26746. value: function destroy() {
  26747. ThemeGraduatedSymbol_get(ThemeGraduatedSymbol_getPrototypeOf(ThemeGraduatedSymbol.prototype), "destroy", this).call(this);
  26748. var me = this;
  26749. me.expression = null;
  26750. if (me.flow) {
  26751. me.flow.destroy();
  26752. me.flow = null;
  26753. }
  26754. me.graduatedMode = GraduatedMode.CONSTANT;
  26755. if (me.offset) {
  26756. me.offset.destroy();
  26757. me.offset = null;
  26758. }
  26759. if (me.style) {
  26760. me.style.destroy();
  26761. me.style = null;
  26762. }
  26763. }
  26764. /**
  26765. * @function SuperMap.ThemeGraduatedSymbol.prototype.toJSON
  26766. * @description 将 themeLabel 对象转化为 JSON 字符串。
  26767. * @returns {string} 返回转换后的 JSON 字符串。
  26768. */
  26769. }, {
  26770. key: "toJSON",
  26771. value: function toJSON() {
  26772. return Util.toJSON(this.toServerJSONObject());
  26773. }
  26774. /**
  26775. * @function SuperMap.ThemeGraduatedSymbol.prototype.toServerJSONObject
  26776. * @description 转换成对应的 JSON 格式对象。
  26777. * @returns {Object} 对应的 JSON 格式对象。
  26778. */
  26779. }, {
  26780. key: "toServerJSONObject",
  26781. value: function toServerJSONObject() {
  26782. var obj = {};
  26783. obj.type = this.type;
  26784. obj.memoryData = this.memoryData;
  26785. obj.baseValue = this.baseValue;
  26786. obj.expression = this.expression;
  26787. obj.graduatedMode = this.graduatedMode;
  26788. if (this.flow) {
  26789. obj.flowEnabled = this.flow.flowEnabled;
  26790. obj.leaderLineDisplayed = this.flow.leaderLineDisplayed;
  26791. obj.leaderLineStyle = this.flow.leaderLineStyle;
  26792. }
  26793. if (this.offset) {
  26794. obj.offsetFixed = this.offset.offsetFixed;
  26795. obj.offsetX = this.offset.offsetX;
  26796. obj.offsetY = this.offset.offsetY;
  26797. }
  26798. if (this.style) {
  26799. obj.negativeStyle = this.style.negativeStyle;
  26800. obj.negativeDisplayed = this.style.negativeDisplayed;
  26801. obj.positiveStyle = this.style.positiveStyle;
  26802. obj.zeroDisplayed = this.style.zeroDisplayed;
  26803. obj.zeroStyle = this.style.zeroStyle;
  26804. }
  26805. return obj;
  26806. }
  26807. /**
  26808. * @function SuperMap.ThemeGraduatedSymbol.fromObj
  26809. * @description 从传入对象获取等级符号专题图。
  26810. * @param {Object} obj - 传入对象。
  26811. * @returns {SuperMap.ThemeGraduatedSymbol} 等级符号专题图对象。
  26812. */
  26813. }], [{
  26814. key: "fromObj",
  26815. value: function fromObj(obj) {
  26816. if (!obj) {
  26817. return;
  26818. }
  26819. var res = new SuperMap.ThemeGraduatedSymbol();
  26820. Util.copy(res, obj);
  26821. res.flow = ThemeFlow.fromObj(obj);
  26822. res.offset = ThemeOffset.fromObj(obj);
  26823. res.style = ThemeGraduatedSymbolStyle.fromObj(obj);
  26824. return res;
  26825. }
  26826. }]);
  26827. return ThemeGraduatedSymbol;
  26828. }(Theme);
  26829. SuperMap.ThemeGraduatedSymbol = ThemeGraduatedSymbol;
  26830. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRangeItem.js
  26831. function ThemeRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26832. 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); } }
  26833. function ThemeRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  26834. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26835. * This program are made available under the terms of the Apache License, Version 2.0
  26836. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26837. /**
  26838. * @class SuperMap.ThemeRangeItem
  26839. * @category iServer Map Theme
  26840. * @classdesc 范围分段专题图子项类。
  26841. * @description 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  26842. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为[start, end)。
  26843. * @param {Object} options - 参数。
  26844. * @param {string} [options.caption] - 分段专题图子项的标题。
  26845. * @param {number} [options.end=0] - 分段专题图子项的终止值。
  26846. * @param {number} [options.start=0] - 分段专题图子项的起始值。
  26847. * @param {SuperMap.ServerStyle} options.style - 分段专题图子项的风格。
  26848. * @param {boolean} [options.visible=true] - 分段专题图子项是否可见。
  26849. */
  26850. var ThemeRangeItem = /*#__PURE__*/function () {
  26851. function ThemeRangeItem(options) {
  26852. ThemeRangeItem_classCallCheck(this, ThemeRangeItem);
  26853. /**
  26854. * @member {string} [SuperMap.ThemeRangeItem.prototype.caption]
  26855. * @description 分段专题图子项的标题。
  26856. */
  26857. this.caption = null;
  26858. /**
  26859. * @member {number} [SuperMap.ThemeRangeItem.prototype.end=0]
  26860. * @description 分段专题图子项的终止值,即该段专题值范围的最大值。<br>
  26861. * 如果该子项是分段中最后一个子项,则该终止值应大于分段字段(ThemeRange 类的 rangeExpression 属性)的最大值,若该终止值小于分段字段最大值,
  26862. * 则剩余部分由内部随机定义其颜色;如果不是最后一项,该终止值必须与其下一子项的起始值相同,否则系统抛出异常;
  26863. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  26864. */
  26865. this.end = 0;
  26866. /**
  26867. * @member {number} [SuperMap.ThemeRangeItem.prototype.start=0]
  26868. * @description 分段专题图子项的起始值,即该段专题值范围的最小值。<br>
  26869. * 如果该子项是分段中第一个子项,那么该起始值就是分段的最小值;如果子项的序号大于等于 1 的时候,该起始值必须与前一子项的终止值相同,否则系统会抛出异常。
  26870. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按您设置的值对分段结果进行调整。
  26871. */
  26872. this.start = 0;
  26873. /**
  26874. * @member {SuperMap.ServerStyle} SuperMap.ThemeRangeItem.prototype.style
  26875. * @description 分段专题图子项的风格。
  26876. * 每一个分段专题图子项都对应一种显示风格。
  26877. */
  26878. this.style = new ServerStyle();
  26879. /**
  26880. * @member {boolean} [SuperMap.ThemeRangeItem.prototype.visible=true]
  26881. * @description 分段专题图子项是否可见。
  26882. */
  26883. this.visible = true;
  26884. if (options) {
  26885. Util.extend(this, options);
  26886. }
  26887. this.CLASS_NAME = "SuperMap.ThemeRangeItem";
  26888. }
  26889. /**
  26890. * @function SuperMap.ThemeRangeItem.prototype.destroy
  26891. * @description 释放资源,将引用资源的属性置空。
  26892. */
  26893. ThemeRangeItem_createClass(ThemeRangeItem, [{
  26894. key: "destroy",
  26895. value: function destroy() {
  26896. var me = this;
  26897. me.caption = null;
  26898. me.end = null;
  26899. me.start = null;
  26900. if (me.style) {
  26901. me.style.destroy();
  26902. me.style = null;
  26903. }
  26904. me.visible = null;
  26905. }
  26906. /**
  26907. * @function SuperMap.ThemeRangeItem.prototypetoServerJSONObject
  26908. * @description 转换成对应的 JSON 格式对象。
  26909. * @returns {Object} 对应的 JSON 格式对象。
  26910. */
  26911. }, {
  26912. key: "toServerJSONObject",
  26913. value: function toServerJSONObject() {
  26914. var obj = {};
  26915. obj = Util.copyAttributes(obj, this);
  26916. if (obj.style) {
  26917. if (obj.style.toServerJSONObject) {
  26918. obj.style = obj.style.toServerJSONObject();
  26919. }
  26920. }
  26921. return obj;
  26922. }
  26923. /**
  26924. * @function SuperMap.ThemeRangeItem.fromObj
  26925. * @description 从传入对象获取范围分段专题图子项类。
  26926. * @param {Object} obj - 传入对象。
  26927. * @returns {SuperMap.ThemeRangeItem} ThemeRangeItem 对象。
  26928. */
  26929. }], [{
  26930. key: "fromObj",
  26931. value: function fromObj(obj) {
  26932. if (!obj) {
  26933. return;
  26934. }
  26935. var res = new ThemeRangeItem();
  26936. Util.copy(res, obj);
  26937. res.style = ServerStyle.fromJson(obj.style);
  26938. return res;
  26939. }
  26940. }]);
  26941. return ThemeRangeItem;
  26942. }();
  26943. SuperMap.ThemeRangeItem = ThemeRangeItem;
  26944. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeRange.js
  26945. function ThemeRange_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeRange_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeRange_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeRange_typeof(obj); }
  26946. function ThemeRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  26947. 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); } }
  26948. function ThemeRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeRange_defineProperties(Constructor, staticProps); return Constructor; }
  26949. function ThemeRange_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeRange_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeRange_get(target, property, receiver || target); }
  26950. function ThemeRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeRange_getPrototypeOf(object); if (object === null) break; } return object; }
  26951. 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 } }); if (superClass) ThemeRange_setPrototypeOf(subClass, superClass); }
  26952. function ThemeRange_setPrototypeOf(o, p) { ThemeRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeRange_setPrototypeOf(o, p); }
  26953. 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); }; }
  26954. function ThemeRange_possibleConstructorReturn(self, call) { if (call && (ThemeRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeRange_assertThisInitialized(self); }
  26955. function ThemeRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  26956. function ThemeRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  26957. function ThemeRange_getPrototypeOf(o) { ThemeRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeRange_getPrototypeOf(o); }
  26958. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  26959. * This program are made available under the terms of the Apache License, Version 2.0
  26960. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  26961. /**
  26962. * @class SuperMap.ThemeRange
  26963. * @category iServer Map Theme
  26964. * @classdesc 范围分段专题图。
  26965. * @description 范围分段专题图是按照指定的分段方法(如:等距离分段法)对字段的属性值进行分段,使用不同的颜色或符号(线型、填充)表示不同范围段落的属性值在整体上的分布情况,体现区域的差异。
  26966. * 在分段专题图中,专题值按照某种分段方式被分成多个范围段,要素根据各自的专题值被分配到其中一个范围段中,在同一个范围段中的要素使用相同的颜色,填充,符号等风格进行显示。
  26967. * 分段专题图所基于的专题变量必须为数值型,分段专题图一般用来反映连续分布现象的数量或程度特征,如降水量的分布,土壤侵蚀强度的分布等。
  26968. * @extends {SuperMap.Theme}
  26969. * @param {Object} options - 参数。
  26970. * @param {Array.<SuperMap.ThemeRangeItem>} options.items - 分段专题图子项数组。
  26971. * @param {string} options.rangeExpression - 分段字段表达式。
  26972. * @param {number} options.rangeParameter - 分段参数。
  26973. * @param {number} options.rangeParameter - 分段参数。
  26974. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  26975. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  26976. * @param {SuperMap.ThemeMemoryData} [options.memoryData] - 专题图内存数据。
  26977. */
  26978. var ThemeRange = /*#__PURE__*/function (_Theme) {
  26979. ThemeRange_inherits(ThemeRange, _Theme);
  26980. var _super = ThemeRange_createSuper(ThemeRange);
  26981. function ThemeRange(options) {
  26982. var _this;
  26983. ThemeRange_classCallCheck(this, ThemeRange);
  26984. _this = _super.call(this, "RANGE", options);
  26985. /**
  26986. * @member {string} SuperMap.ThemeRange.prototype.precision
  26987. * @description 精准度
  26988. */
  26989. _this.precision = '1.0E-12';
  26990. /**
  26991. * @member {Array.<SuperMap.ThemeRangeItem>} SuperMap.ThemeRange.prototype.items
  26992. * @description 分段专题图子项数组。<br>
  26993. * 在分段专题图中,字段值按照某种分段模式被分成多个范围段,每个范围段即为一个子项,同一范围段的要素属于同一个分段专题图子项。
  26994. * 每个子项都有其分段起始值、终止值、名称和风格等。每个分段所表示的范围为 [start, end)。
  26995. * 如果设置了范围分段模式和分段数,则会自动计算每段的范围 [start, end),故无需设置 [start, end);当然可以设置,那么结果就会按照您设置的值对分段结果进行调整。
  26996. */
  26997. _this.items = null;
  26998. /**
  26999. * @member {string} SuperMap.ThemeRange.prototype.rangeExpression
  27000. * @description 分段字段表达式。<br>
  27001. * 由于范围分段专题图基于各种分段方法根据一定的距离进行分段,因而范围分段专题图所基于的字段值的数据类型必须为数值型。对于字段表达式,只能为数值型的字段间的运算。
  27002. */
  27003. _this.rangeExpression = null;
  27004. /**
  27005. * @member {SuperMap.RangeMode} [SuperMap.ThemeRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  27006. * @description 分段专题图的分段模式。<br>
  27007. * 在分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  27008. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  27009. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  27010. */
  27011. _this.rangeMode = RangeMode.EQUALINTERVAL;
  27012. /**
  27013. * @member {number} SuperMap.ThemeRange.prototype.rangeParameter
  27014. * @description 分段参数。
  27015. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数;当分段模式为标准差分段法时,
  27016. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  27017. */
  27018. _this.rangeParameter = 0;
  27019. /**
  27020. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  27021. * @description 渐变颜色枚举类。<br>
  27022. * 渐变色是由起始色根据一定算法逐渐过渡到终止色的一种混合型颜色。
  27023. * 该类作为单值专题图参数类、分段专题图参数类的属性,负责设置单值专题图、分段专题图的配色方案,在默认情况下专题图所有子项会根据这个配色
  27024. * 方案完成填*充。但如果为某几个子项的风格进行单独设置后(设置了 {@link SuperMap.ThemeUniqueItem} 或 {@link SuperMap.ThemeRangeItem} 类中Style属性),
  27025. * 该配色方案对于这几个子项将不起作用。
  27026. */
  27027. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  27028. if (options) {
  27029. Util.extend(ThemeRange_assertThisInitialized(_this), options);
  27030. }
  27031. _this.CLASS_NAME = "SuperMap.ThemeRange";
  27032. return _this;
  27033. }
  27034. /**
  27035. * @function SuperMap.ThemeRange.prototype.destroy
  27036. * @override
  27037. */
  27038. ThemeRange_createClass(ThemeRange, [{
  27039. key: "destroy",
  27040. value: function destroy() {
  27041. ThemeRange_get(ThemeRange_getPrototypeOf(ThemeRange.prototype), "destroy", this).call(this);
  27042. var me = this;
  27043. if (me.items) {
  27044. if (me.items.length > 0) {
  27045. for (var item in me.items) {
  27046. me.items[item].destroy();
  27047. me.items[item] = null;
  27048. }
  27049. }
  27050. me.items = null;
  27051. }
  27052. me.rangeExpression = null;
  27053. me.rangeMode = null;
  27054. me.rangeParameter = null;
  27055. me.colorGradientType = null;
  27056. }
  27057. /**
  27058. * @function SuperMap.ThemeRange.fromObj
  27059. * @description 从传入对象获取范围分段专题图类。
  27060. * @param {Object} obj - 传入对象。
  27061. * @returns {SuperMap.ThemeRange} ThemeRange 对象。
  27062. */
  27063. }], [{
  27064. key: "fromObj",
  27065. value: function fromObj(obj) {
  27066. if (!obj) {
  27067. return;
  27068. }
  27069. var res = new ThemeRange();
  27070. Util.copy(res, obj);
  27071. var itemsR = obj.items;
  27072. var len = itemsR ? itemsR.length : 0;
  27073. res.items = [];
  27074. for (var i = 0; i < len; i++) {
  27075. res.items.push(ThemeRangeItem.fromObj(itemsR[i]));
  27076. }
  27077. return res;
  27078. }
  27079. }]);
  27080. return ThemeRange;
  27081. }(Theme);
  27082. SuperMap.ThemeRange = ThemeRange;
  27083. ;// CONCATENATED MODULE: ./src/common/iServer/UGCLayer.js
  27084. function UGCLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27085. 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); } }
  27086. function UGCLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCLayer_defineProperties(Constructor, staticProps); return Constructor; }
  27087. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27088. * This program are made available under the terms of the Apache License, Version 2.0
  27089. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27090. /**
  27091. * @class SuperMap.UGCLayer
  27092. * @category iServer Map Layer
  27093. * @classdesc UGC 图层类。
  27094. * @param {Object} options - 参数。
  27095. * @param {SuperMap.Bounds} options.bounds - 图层范围。
  27096. * @param {string} options.name - 图层的名称。
  27097. * @param {SuperMap.UGCLayerType} options.type - 图层类型
  27098. * @param {string} [options.caption] - 图层的标题。
  27099. * @param {string} [options.description] - 图层的描述信息。
  27100. * @param {boolean} [options.queryable] - 图层中的对象是否可以查询。
  27101. * @param {boolean} [options.subUGCLayers] - 是否允许图层的符号大小随图缩放。
  27102. * @param {boolean} [options.visible=false] - 地图对象在同一范围内时,是否重叠显示。
  27103. */
  27104. var UGCLayer = /*#__PURE__*/function () {
  27105. function UGCLayer(options) {
  27106. UGCLayer_classCallCheck(this, UGCLayer);
  27107. options = options || {};
  27108. /**
  27109. * @member {SuperMap.Bounds} SuperMap.UGCLayer.prototype.bounds
  27110. * @description 图层范围。
  27111. */
  27112. this.bounds = null;
  27113. /**
  27114. * @member {string} [SuperMap.UGCLayer.prototype.caption]
  27115. * @description 图层的标题。默认情况下图层的标题与图层的名称一致。在图例、图层控制列表中显示的图层名称就是该图层的标题值。
  27116. */
  27117. this.caption = null;
  27118. /**
  27119. * @member {string} SuperMap.UGCLayer.prototype.description
  27120. * @description 图层的描述信息。
  27121. */
  27122. this.description = null;
  27123. /**
  27124. * @member {string} SuperMap.UGCLayer.prototype.name
  27125. * @description 图层的名称。图层的名称在图层所在的地图中唯一标识此图层。该属性区分大小写。
  27126. */
  27127. this.name = null;
  27128. /**
  27129. * @member {boolean} SuperMap.UGCLayer.prototype.queryable
  27130. * @description 图层中的对象是否可以查询。
  27131. */
  27132. this.queryable = null;
  27133. /**
  27134. * @member {Array} SuperMap.UGCLayer.prototype.subLayers
  27135. * @description 子图层集。
  27136. */
  27137. this.subLayers = null;
  27138. /**
  27139. * @member {SuperMap.UGCLayerType} SuperMap.UGCLayer.prototype.type
  27140. * @description 图层类型。
  27141. */
  27142. this.type = null;
  27143. /**
  27144. * @member {boolean} SuperMap.UGCLayer.prototype.visible
  27145. * @description 地图对象在同一范围内时,是否重叠显示。
  27146. */
  27147. this.visible = null;
  27148. Util.extend(this, options);
  27149. this.CLASS_NAME = "SuperMap.UGCLayer";
  27150. }
  27151. /**
  27152. * @function SuperMap.UGCLayer.prototype.destroy
  27153. * @description 释放资源,将引用资源的属性置空。
  27154. */
  27155. UGCLayer_createClass(UGCLayer, [{
  27156. key: "destroy",
  27157. value: function destroy() {
  27158. var me = this;
  27159. Util.reset(me);
  27160. }
  27161. /**
  27162. * @function SuperMap.UGCLayer.prototype.fromJson
  27163. * @description 将服务端 JSON 对象转换成当前客户端对象。
  27164. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27165. */
  27166. }, {
  27167. key: "fromJson",
  27168. value: function fromJson(jsonObject) {
  27169. jsonObject = jsonObject ? jsonObject : {};
  27170. Util.extend(this, jsonObject);
  27171. var b = this.bounds;
  27172. if (b) {
  27173. this.bounds = new Bounds(b.leftBottom.x, b.leftBottom.y, b.rightTop.x, b.rightTop.y);
  27174. }
  27175. }
  27176. /**
  27177. * @function SuperMap.UGCLayer.prototype.toServerJSONObject
  27178. * @description 转换成对应的 JSON 格式对象。
  27179. * @returns {Object} 对应的 JSON 格式对象。
  27180. */
  27181. }, {
  27182. key: "toServerJSONObject",
  27183. value: function toServerJSONObject() {
  27184. var jsonObject = {};
  27185. jsonObject = Util.copyAttributes(jsonObject, this);
  27186. if (jsonObject.bounds) {
  27187. if (jsonObject.bounds.toServerJSONObject) {
  27188. jsonObject.bounds = jsonObject.bounds.toServerJSONObject();
  27189. }
  27190. }
  27191. return jsonObject;
  27192. }
  27193. }]);
  27194. return UGCLayer;
  27195. }();
  27196. SuperMap.UGCLayer = UGCLayer;
  27197. ;// CONCATENATED MODULE: ./src/common/iServer/OverlapDisplayedOptions.js
  27198. function OverlapDisplayedOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27199. 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); } }
  27200. function OverlapDisplayedOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlapDisplayedOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlapDisplayedOptions_defineProperties(Constructor, staticProps); return Constructor; }
  27201. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27202. * This program are made available under the terms of the Apache License, Version 2.0
  27203. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27204. /**
  27205. * @class SuperMap.OverlapDisplayedOptions
  27206. * @category iServer Map Layer
  27207. * @classdesc 地图压盖过滤显示选项。
  27208. * @description 在文本或专题图元素显示较密集的区域,文本之间或专题元素之间会发生相互压盖的现象,
  27209. * 该类可以分别控制各种类型的对象的压盖显示情况,进而很好地处理地图中各种类型对象的压盖显示问题。
  27210. * @param {Object} options - 参数。
  27211. * @param {boolean} [options.allowPointOverlap=true] - 点和点压盖时是否显示压盖的点对象。
  27212. * @param {boolean} [options.allowPointWithTextDisplay=true] - 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  27213. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  27214. * @param {boolean} [options.allowTextOverlap=false] - 文本压盖时是否显示压盖的文本对象。
  27215. * @param {boolean} [options.allowTextAndPointOverlap=true] - 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  27216. * @param {boolean} [options.allowThemeGraduatedSymbolOverlap=false] - 等级符号元素压盖时是否显示压盖的等级符号元素。
  27217. * @param {boolean} [options.allowThemeGraphOverlap=false] - 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  27218. * @param {number} [options.horizontalOverlappedSpaceSize=0] - 两个对象之间的横向压盖间距,单位为 0.1 毫米,跟 verticalOverlappedSpaceSize 结合使用,
  27219. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  27220. * @param {number} [options.verticalOverlappedSpaceSize=0] - 两个对象之间的纵向压盖间距,单位为 0.1 毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  27221. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  27222. */
  27223. var OverlapDisplayedOptions = /*#__PURE__*/function () {
  27224. function OverlapDisplayedOptions(options) {
  27225. OverlapDisplayedOptions_classCallCheck(this, OverlapDisplayedOptions);
  27226. options = options || {};
  27227. /**
  27228. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointOverlap=true]
  27229. * @description 点和点压盖时是否显示压盖的点对象。
  27230. */
  27231. this.allowPointOverlap = true;
  27232. /**
  27233. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowPointWithTextDisplay=true]
  27234. * @description 标签和相应普通图层上的点是否一起过滤显示,如果过滤显示,
  27235. * 只以图层集合中对应数据集的索引最小的图层的点风格来绘制点。
  27236. */
  27237. this.allowPointWithTextDisplay = true;
  27238. /**
  27239. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextOverlap=false]
  27240. * @description 文本压盖时是否显示压盖的文本对象。
  27241. */
  27242. this.allowTextOverlap = false;
  27243. /**
  27244. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowTextAndPointOverlap=true]
  27245. * @description 文本和点压盖时是否显示压盖的文本或点对象(此属性不处理文本之间的压盖和点之间的压盖)。
  27246. */
  27247. this.allowTextAndPointOverlap = true;
  27248. /**
  27249. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraduatedSymbolOverlap=false]
  27250. * @description 等级符号元素压盖时是否显示压盖的等级符号元素。
  27251. */
  27252. this.allowThemeGraduatedSymbolOverlap = false;
  27253. /**
  27254. * @member {boolean} [SuperMap.OverlapDisplayedOptions.prototype.allowThemeGraphOverlap=false]
  27255. * @description 统计专题图元素压盖时是否显示压盖的统计专题图元素。
  27256. */
  27257. this.allowThemeGraphOverlap = false;
  27258. /**
  27259. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.horizontalOverlappedSpaceSize=0]
  27260. * @description 两个对象之间的横向压盖间距,单位为0.1毫米,跟 verticalOverlappedSpaceSize 结合使用,
  27261. * 当两个对象的横向间距小于该值,且纵向间距小于 verticalOverlappedSpaceSize 时认为压盖。
  27262. */
  27263. this.horizontalOverlappedSpaceSize = 0;
  27264. /**
  27265. * @member {number} [SuperMap.OverlapDisplayedOptions.prototype.verticalOverlappedSpaceSize=0]
  27266. * @description 两个对象之间的纵向压盖间距,单位为0.1毫米,跟 horizontalOverlappedSpaceSize 结合使用,
  27267. * 当两个对象的纵向间距小于该值,且横向间距小于 horizontalOverlappedSpaceSize 时认为压盖。
  27268. */
  27269. this.verticalOverlappedSpaceSize = 0;
  27270. Util.extend(this, options);
  27271. this.ugcLayer = new UGCLayer(options);
  27272. this.CLASS_NAME = "SuperMap.OverlapDisplayedOptions";
  27273. }
  27274. /**
  27275. * @function SuperMap.OverlapDisplayedOptions.prototype.destroy
  27276. * @description 释放资源,将资源的属性置空。
  27277. */
  27278. OverlapDisplayedOptions_createClass(OverlapDisplayedOptions, [{
  27279. key: "destroy",
  27280. value: function destroy() {
  27281. Util.reset(this);
  27282. }
  27283. /**
  27284. * @function SuperMap.OverlapDisplayedOptions.prototype.fromJson
  27285. * @description 将服务端 JSON 对象转换成当前客户端对象。
  27286. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27287. */
  27288. }, {
  27289. key: "fromJson",
  27290. value: function fromJson(jsonObject) {
  27291. this.ugcLayer.fromJson.apply(this, [jsonObject]);
  27292. }
  27293. /**
  27294. * @function SuperMap.OverlapDisplayedOptions.prototype.toServerJSONObject
  27295. * @description 转换成对应的 JSON 格式对象。
  27296. * @returns {Object} 对应的 JSON 格式对象。
  27297. */
  27298. }, {
  27299. key: "toServerJSONObject",
  27300. value: function toServerJSONObject() {
  27301. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  27302. return jsonObject;
  27303. }
  27304. /**
  27305. * @function SuperMap.OverlapDisplayedOptions.prototype.toString
  27306. * @description 转换成对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  27307. * @returns {string} 对应的 tileLayer 请求瓦片时 overlapDisplayedOptions 参数。
  27308. */
  27309. }, {
  27310. key: "toString",
  27311. value: function toString() {
  27312. var jsonObject = this.ugcLayer.toServerJSONObject.apply(this, arguments);
  27313. var str = "{";
  27314. for (var attr in jsonObject) {
  27315. if (jsonObject.hasOwnProperty(attr)) {
  27316. str += "'" + attr + "':" + jsonObject[attr] + ",";
  27317. }
  27318. }
  27319. str = str.substr(0, str.length - 1);
  27320. str += "}";
  27321. return str;
  27322. }
  27323. }]);
  27324. return OverlapDisplayedOptions;
  27325. }();
  27326. SuperMap.OverlapDisplayedOptions = OverlapDisplayedOptions;
  27327. ;// CONCATENATED MODULE: ./src/common/iServer/UGCMapLayer.js
  27328. function UGCMapLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UGCMapLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UGCMapLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UGCMapLayer_typeof(obj); }
  27329. function UGCMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27330. 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); } }
  27331. function UGCMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
  27332. function UGCMapLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UGCMapLayer_get = Reflect.get; } 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(receiver); } return desc.value; }; } return UGCMapLayer_get(target, property, receiver || target); }
  27333. function UGCMapLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCMapLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  27334. 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 } }); if (superClass) UGCMapLayer_setPrototypeOf(subClass, superClass); }
  27335. function UGCMapLayer_setPrototypeOf(o, p) { UGCMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCMapLayer_setPrototypeOf(o, p); }
  27336. 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); }; }
  27337. function UGCMapLayer_possibleConstructorReturn(self, call) { if (call && (UGCMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCMapLayer_assertThisInitialized(self); }
  27338. function UGCMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27339. function UGCMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27340. function UGCMapLayer_getPrototypeOf(o) { UGCMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCMapLayer_getPrototypeOf(o); }
  27341. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27342. * This program are made available under the terms of the Apache License, Version 2.0
  27343. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27344. /**
  27345. * @class SuperMap.UGCMapLayer
  27346. * @category iServer Map Layer
  27347. * @classdesc UGC 地图图层类。
  27348. * @extends {SuperMap.UGCLayer}
  27349. * @param {Object} options - 参数。
  27350. * @param {boolean} [options.completeLineSymbolDisplayed] - 是否显示完整线型。
  27351. * @param {number} [options.maxScale] - 地图最大比例尺。
  27352. * @param {number} [options.minScale] - 地图最小比例尺。
  27353. * @param {number} [options.minVisibleGeometrySize] - 几何对象的最小可见大小,以像素为单位。
  27354. * @param {number} [options.opaqueRate] - 图层的不透明度。
  27355. * @param {boolean} [options.symbolScalable] - 是否允许图层的符号大小随图缩放。
  27356. * @param {number} [options.symbolScale] - 图层的符号缩放基准比例尺。
  27357. * @param {boolean} [options.overlapDisplayed=false] - 地图对象在同一范围内时,是否重叠显示。
  27358. * @param {SuperMap.OverlapDisplayedOptions} [options.overlapDisplayedOptions] - 地图的压盖过滤显示选项,当overlapDisplayed 为 false 时有效。
  27359. */
  27360. var UGCMapLayer = /*#__PURE__*/function (_UGCLayer) {
  27361. UGCMapLayer_inherits(UGCMapLayer, _UGCLayer);
  27362. var _super = UGCMapLayer_createSuper(UGCMapLayer);
  27363. function UGCMapLayer(options) {
  27364. var _this;
  27365. UGCMapLayer_classCallCheck(this, UGCMapLayer);
  27366. options = options || {};
  27367. _this = _super.call(this, options);
  27368. /**
  27369. * @member {boolean} SuperMap.UGCMapLayer.prototype.completeLineSymbolDisplayed
  27370. * @description 是否显示完整线型。
  27371. */
  27372. _this.completeLineSymbolDisplayed = null;
  27373. /**
  27374. * @member {number} SuperMap.UGCMapLayer.prototype.maxScale
  27375. * @description 地图最大比例尺。
  27376. */
  27377. _this.maxScale = null;
  27378. /**
  27379. * @member {number} SuperMap.UGCMapLayer.prototype.minScale
  27380. * @description 地图最小比例尺。
  27381. */
  27382. _this.minScale = null;
  27383. /**
  27384. * @member {number} SuperMap.UGCMapLayer.prototype.minVisibleGeometrySize
  27385. * @description 几何对象的最小可见大小,以像素为单位。
  27386. */
  27387. _this.minVisibleGeometrySize = null;
  27388. /**
  27389. * @member {number} SuperMap.UGCMapLayer.prototype.opaqueRate
  27390. * @description 图层的不透明度。
  27391. */
  27392. _this.opaqueRate = null;
  27393. /**
  27394. * @member {boolean} SuperMap.UGCMapLayer.prototype.symbolScalable
  27395. * @description 是否允许图层的符号大小随图缩放。
  27396. */
  27397. _this.symbolScalable = null;
  27398. /**
  27399. * @member {number} SuperMap.UGCMapLayer.prototype.symbolScale
  27400. * @description 图层的符号缩放基准比例尺。
  27401. */
  27402. _this.symbolScale = null;
  27403. /**
  27404. * @member {boolean} [SuperMap.UGCMapLayer.prototype.overlapDisplayed=false]
  27405. * @description 地图对象在同一范围内时,是否重叠显示。
  27406. */
  27407. _this.overlapDisplayed = null;
  27408. /**
  27409. * @member {SuperMap.OverlapDisplayedOptions} SuperMap.UGCMapLayer.prototype.overlapDisplayedOptions
  27410. * @description 地图的压盖过滤显示选项,当 overlapDisplayed 为 false 时有效。
  27411. */
  27412. _this.overlapDisplayedOptions = null;
  27413. _this.CLASS_NAME = "SuperMap.UGCMapLayer";
  27414. return _this;
  27415. }
  27416. /**
  27417. * @function SuperMap.UGCMapLayer.prototype.destroy
  27418. * @override
  27419. */
  27420. UGCMapLayer_createClass(UGCMapLayer, [{
  27421. key: "destroy",
  27422. value: function destroy() {
  27423. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "destroy", this).call(this);
  27424. Util.reset(this);
  27425. }
  27426. /**
  27427. * @function SuperMap.UGCMapLayer.prototype.fromJson
  27428. * @description 将服务端 JSON 对象转换成当前客户端对象
  27429. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27430. */
  27431. }, {
  27432. key: "fromJson",
  27433. value: function fromJson(jsonObject) {
  27434. UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "fromJson", this).call(this, jsonObject);
  27435. }
  27436. /**
  27437. * @function SuperMap.UGCMapLayer.prototype.toServerJSONObject
  27438. * @description 转换成对应的 JSON 格式对象。
  27439. * @returns {Object} 对应的 JSON 格式对象。
  27440. */
  27441. }, {
  27442. key: "toServerJSONObject",
  27443. value: function toServerJSONObject() {
  27444. return UGCMapLayer_get(UGCMapLayer_getPrototypeOf(UGCMapLayer.prototype), "toServerJSONObject", this).call(this);
  27445. }
  27446. }]);
  27447. return UGCMapLayer;
  27448. }(UGCLayer);
  27449. SuperMap.UGCMapLayer = UGCMapLayer;
  27450. ;// CONCATENATED MODULE: ./src/common/iServer/UGCSubLayer.js
  27451. function UGCSubLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UGCSubLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UGCSubLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UGCSubLayer_typeof(obj); }
  27452. function UGCSubLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27453. 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); } }
  27454. function UGCSubLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UGCSubLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UGCSubLayer_defineProperties(Constructor, staticProps); return Constructor; }
  27455. function UGCSubLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UGCSubLayer_get = Reflect.get; } 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(receiver); } return desc.value; }; } return UGCSubLayer_get(target, property, receiver || target); }
  27456. function UGCSubLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UGCSubLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  27457. 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 } }); if (superClass) UGCSubLayer_setPrototypeOf(subClass, superClass); }
  27458. function UGCSubLayer_setPrototypeOf(o, p) { UGCSubLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UGCSubLayer_setPrototypeOf(o, p); }
  27459. 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); }; }
  27460. function UGCSubLayer_possibleConstructorReturn(self, call) { if (call && (UGCSubLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UGCSubLayer_assertThisInitialized(self); }
  27461. function UGCSubLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27462. function UGCSubLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27463. function UGCSubLayer_getPrototypeOf(o) { UGCSubLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UGCSubLayer_getPrototypeOf(o); }
  27464. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27465. * This program are made available under the terms of the Apache License, Version 2.0
  27466. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27467. /**
  27468. * @class SuperMap.UGCSubLayer
  27469. * @category iServer Map Layer
  27470. * @classdesc 地图服务图层属性信息类。影像图层(Image)、专题图层(ServerTheme)、栅格图层(Grid)、矢量图层(Vector)等图层均继承该类。
  27471. * @extends {SuperMap.UGCMapLayer}
  27472. * @param {Object} options - 参数。
  27473. * @param {SuperMap.DatasetInfo} options.datasetInfo - 数据集信息。
  27474. * @param {string} [options.displayFilter] - 图层显示过滤条件。
  27475. * @param {SuperMap.JoinItem} [options.joinItems] - 连接信息类。
  27476. * @param {string} [options.representationField] - 存储制图表达信息的字段。
  27477. * @param {SuperMap.LayerType} [options.ugcLayerType] - 图层类型。
  27478. */
  27479. var UGCSubLayer = /*#__PURE__*/function (_UGCMapLayer) {
  27480. UGCSubLayer_inherits(UGCSubLayer, _UGCMapLayer);
  27481. var _super = UGCSubLayer_createSuper(UGCSubLayer);
  27482. function UGCSubLayer(options) {
  27483. var _this;
  27484. UGCSubLayer_classCallCheck(this, UGCSubLayer);
  27485. options = options || {};
  27486. _this = _super.call(this, options);
  27487. /**
  27488. * @member {SuperMap.DatasetInfo} SuperMap.UGCSubLayer.prototype.datasetInfo
  27489. * @description 数据集信息。
  27490. */
  27491. _this.datasetInfo = null;
  27492. /**
  27493. * @member {string} SuperMap.UGCSubLayer.prototype.displayFilter
  27494. * @description 图层显示过滤条件。
  27495. */
  27496. _this.displayFilter = null;
  27497. /**
  27498. * @member {SuperMap.JoinItem} SuperMap.UGCSubLayer.prototype.joinItems
  27499. * @description 连接信息类。
  27500. */
  27501. _this.joinItems = null;
  27502. /**
  27503. * @member {string} SuperMap.UGCSubLayer.prototype.representationField
  27504. * @description 存储制图表达信息的字段。
  27505. */
  27506. _this.representationField = null;
  27507. /**
  27508. * @member {SuperMap.LayerType} SuperMap.UGCSubLayer.prototype.ugcLayerType
  27509. * @description 图层类型。
  27510. */
  27511. _this.ugcLayerType = null;
  27512. _this.CLASS_NAME = "SuperMap.UGCSubLayer";
  27513. return _this;
  27514. }
  27515. /**
  27516. * @function SuperMap.UGCSubLayer.prototype.fromJson
  27517. * @description 将服务端 JSON 对象转换成当前客户端对象
  27518. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27519. */
  27520. UGCSubLayer_createClass(UGCSubLayer, [{
  27521. key: "fromJson",
  27522. value: function fromJson(jsonObject) {
  27523. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "fromJson", this).call(this, jsonObject);
  27524. if (this.datasetInfo) {
  27525. this.datasetInfo = new DatasetInfo(this.datasetInfo);
  27526. }
  27527. if (this.joinItems && this.joinItems.length) {
  27528. var newJoinItems = [];
  27529. for (var i = 0; i < this.joinItems.length; i++) {
  27530. newJoinItems[i] = new JoinItem(this.joinItems[i]);
  27531. }
  27532. this.joinItems = newJoinItems;
  27533. }
  27534. }
  27535. /**
  27536. * @function SuperMap.UGCSubLayer.prototype.destroy
  27537. * @override
  27538. */
  27539. }, {
  27540. key: "destroy",
  27541. value: function destroy() {
  27542. UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "destroy", this).call(this);
  27543. Util.reset(this);
  27544. }
  27545. /**
  27546. * @function SuperMap.UGCSubLayer.prototype.toServerJSONObject
  27547. * @description 转换成对应的 JSON 格式对象。
  27548. * @returns {Object} 对应的 JSON 格式对象。
  27549. */
  27550. }, {
  27551. key: "toServerJSONObject",
  27552. value: function toServerJSONObject() {
  27553. var jsonObject = UGCSubLayer_get(UGCSubLayer_getPrototypeOf(UGCSubLayer.prototype), "toServerJSONObject", this).call(this);
  27554. if (jsonObject.joinItems) {
  27555. var joinItems = [];
  27556. for (var i = 0; i < jsonObject.joinItems.length; i++) {
  27557. if (jsonObject.joinItems[i].toServerJSONObject) {
  27558. joinItems[i] = jsonObject.joinItems[i].toServerJSONObject();
  27559. }
  27560. }
  27561. jsonObject.joinItems = joinItems;
  27562. }
  27563. if (jsonObject.datasetInfo) {
  27564. if (jsonObject.datasetInfo.toServerJSONObject) {
  27565. jsonObject.datasetInfo = jsonObject.datasetInfo.toServerJSONObject();
  27566. }
  27567. }
  27568. return jsonObject;
  27569. }
  27570. }]);
  27571. return UGCSubLayer;
  27572. }(UGCMapLayer);
  27573. SuperMap.UGCSubLayer = UGCSubLayer;
  27574. ;// CONCATENATED MODULE: ./src/common/iServer/ServerTheme.js
  27575. function ServerTheme_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ServerTheme_typeof = function _typeof(obj) { return typeof obj; }; } else { ServerTheme_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ServerTheme_typeof(obj); }
  27576. function ServerTheme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27577. 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); } }
  27578. function ServerTheme_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerTheme_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerTheme_defineProperties(Constructor, staticProps); return Constructor; }
  27579. function ServerTheme_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ServerTheme_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ServerTheme_get(target, property, receiver || target); }
  27580. function ServerTheme_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ServerTheme_getPrototypeOf(object); if (object === null) break; } return object; }
  27581. 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 } }); if (superClass) ServerTheme_setPrototypeOf(subClass, superClass); }
  27582. function ServerTheme_setPrototypeOf(o, p) { ServerTheme_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServerTheme_setPrototypeOf(o, p); }
  27583. 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); }; }
  27584. function ServerTheme_possibleConstructorReturn(self, call) { if (call && (ServerTheme_typeof(call) === "object" || typeof call === "function")) { return call; } return ServerTheme_assertThisInitialized(self); }
  27585. function ServerTheme_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27586. function ServerTheme_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27587. function ServerTheme_getPrototypeOf(o) { ServerTheme_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServerTheme_getPrototypeOf(o); }
  27588. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27589. * This program are made available under the terms of the Apache License, Version 2.0
  27590. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27591. /**
  27592. * @class SuperMap.ServerTheme
  27593. * @category iServer Map Theme
  27594. * @classdesc UGC 专题图图层类。
  27595. * @extends {SuperMap.UGCSubLayer}
  27596. * @param {SuperMap.Theme} theme - 专题图对象。
  27597. * @param {SuperMap.LonLat} themeElementPosition - 专题图元素位置。
  27598. */
  27599. var ServerTheme = /*#__PURE__*/function (_UGCSubLayer) {
  27600. ServerTheme_inherits(ServerTheme, _UGCSubLayer);
  27601. var _super = ServerTheme_createSuper(ServerTheme);
  27602. function ServerTheme(options) {
  27603. var _this;
  27604. ServerTheme_classCallCheck(this, ServerTheme);
  27605. options = options || {};
  27606. _this = _super.call(this, options);
  27607. /**
  27608. * @member {SuperMap.Theme} SuperMap.ServerTheme.prototype.theme
  27609. * @description 专题图对象。
  27610. */
  27611. _this.theme = null;
  27612. /**
  27613. * @member {SuperMap.LonLat} SuperMap.ServerTheme.prototype.themeElementPosition
  27614. * @description 专题图元素位置。
  27615. */
  27616. _this.themeElementPosition = null;
  27617. _this.CLASS_NAME = "SuperMap.ServerTheme";
  27618. return _this;
  27619. }
  27620. /**
  27621. * @function SuperMap.ServerTheme.prototype.destroy
  27622. * @override
  27623. */
  27624. ServerTheme_createClass(ServerTheme, [{
  27625. key: "destroy",
  27626. value: function destroy() {
  27627. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "destroy", this).call(this);
  27628. Util.reset(this);
  27629. }
  27630. /**
  27631. * @function SuperMap.ServerTheme.prototype.fromJson
  27632. * @description 将服务端 JSON 对象转换成当前客户端对象
  27633. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27634. */
  27635. }, {
  27636. key: "fromJson",
  27637. value: function fromJson(jsonObject) {
  27638. ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "fromJson", this).call(this, jsonObject);
  27639. var themeObj = this.theme;
  27640. var themeT = themeObj && themeObj.type;
  27641. switch (themeT) {
  27642. case 'LABEL':
  27643. this.theme = ThemeLabel.fromObj(themeObj);
  27644. break;
  27645. case 'UNIQUE':
  27646. this.theme = ThemeUnique.fromObj(themeObj);
  27647. break;
  27648. case 'GRAPH':
  27649. this.theme = ThemeGraph.fromObj(themeObj);
  27650. break;
  27651. case 'DOTDENSITY':
  27652. this.theme = ThemeDotDensity.fromObj(themeObj);
  27653. break;
  27654. case 'GRADUATEDSYMBOL':
  27655. this.theme = ThemeGraduatedSymbol.fromObj(themeObj);
  27656. break;
  27657. case 'RANGE':
  27658. this.theme = ThemeRange.fromObj(themeObj);
  27659. break;
  27660. default:
  27661. break;
  27662. }
  27663. if (this.themeElementPosition) {
  27664. //待测试
  27665. this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y);
  27666. }
  27667. }
  27668. /**
  27669. * @function SuperMap.ServerTheme.prototype.toServerJSONObject
  27670. * @description 转换成对应的 JSON 格式对象。
  27671. */
  27672. }, {
  27673. key: "toServerJSONObject",
  27674. value: function toServerJSONObject() {
  27675. //普通属性直接赋值
  27676. var jsonObject = ServerTheme_get(ServerTheme_getPrototypeOf(ServerTheme.prototype), "toServerJSONObject", this).call(this);
  27677. if (jsonObject.themeElementPosition) {
  27678. if (jsonObject.themeElementPosition.toServerJSONObject) {
  27679. jsonObject.themeElementPosition = jsonObject.themeElementPosition.toServerJSONObject();
  27680. }
  27681. }
  27682. if (jsonObject.theme) {
  27683. if (jsonObject.theme.toServerJSONObject) {
  27684. jsonObject.theme = jsonObject.theme.toServerJSONObject();
  27685. }
  27686. }
  27687. return jsonObject;
  27688. }
  27689. }]);
  27690. return ServerTheme;
  27691. }(UGCSubLayer);
  27692. SuperMap.ServerTheme = ServerTheme;
  27693. ;// CONCATENATED MODULE: ./src/common/iServer/Grid.js
  27694. function Grid_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Grid_typeof = function _typeof(obj) { return typeof obj; }; } else { Grid_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Grid_typeof(obj); }
  27695. function Grid_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27696. 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); } }
  27697. function Grid_createClass(Constructor, protoProps, staticProps) { if (protoProps) Grid_defineProperties(Constructor.prototype, protoProps); if (staticProps) Grid_defineProperties(Constructor, staticProps); return Constructor; }
  27698. function Grid_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Grid_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Grid_get(target, property, receiver || target); }
  27699. function Grid_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Grid_getPrototypeOf(object); if (object === null) break; } return object; }
  27700. 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 } }); if (superClass) Grid_setPrototypeOf(subClass, superClass); }
  27701. function Grid_setPrototypeOf(o, p) { Grid_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Grid_setPrototypeOf(o, p); }
  27702. 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); }; }
  27703. function Grid_possibleConstructorReturn(self, call) { if (call && (Grid_typeof(call) === "object" || typeof call === "function")) { return call; } return Grid_assertThisInitialized(self); }
  27704. function Grid_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27705. function Grid_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27706. function Grid_getPrototypeOf(o) { Grid_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Grid_getPrototypeOf(o); }
  27707. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27708. * This program are made available under the terms of the Apache License, Version 2.0
  27709. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27710. /**
  27711. * @class SuperMap.Grid
  27712. * @category iServer Map Layer
  27713. * @classdesc UGC 栅格图层类。
  27714. * @extends {SuperMap.UGCSubLayer}
  27715. * @param {Object} options - 参数。
  27716. * @param {Array.<Object>} [options.colorDictionary] - 颜色对照表对象。
  27717. * @param {number} [options.brightness] - Grid 图层的亮度。
  27718. * @param {SuperMap.ColorGradientType} [options.colorGradientType] - 颜色渐变枚举。
  27719. * @param {SuperMap.ServerColor} [options.colors] - 颜色表对象。
  27720. * @param {number} [options.contrast] - Grid 图层的对比度。
  27721. * @param {SuperMap.GridType} [options.gridType] - 格网类型。
  27722. * @param {number} [options.horizontalSpacing] - 格网水平间隔大小。
  27723. * @param {boolean} [options.sizeFixed] - 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  27724. * @param {SuperMap.ServerStyle} [options.solidStyle] - 格网实线的样式。
  27725. * @param {SuperMap.ServerColor} [options.specialColor] - 栅格数据集无值数据的颜色。
  27726. * @param {number} [options.specialValue] - 图层的特殊值。
  27727. * @param {boolean} [options.specialValueTransparent] - 图层的特殊值(specialValue)所处区域是否透明。
  27728. * @param {number} [options.verticalSpacing] - 格网垂直间隔大小。
  27729. */
  27730. var Grid = /*#__PURE__*/function (_UGCSubLayer) {
  27731. Grid_inherits(Grid, _UGCSubLayer);
  27732. var _super = Grid_createSuper(Grid);
  27733. function Grid(options) {
  27734. var _this;
  27735. Grid_classCallCheck(this, Grid);
  27736. options = options || {};
  27737. _this = _super.call(this, options);
  27738. /**
  27739. * @member {Array.<SuperMap.ColorDictionary>} SuperMap.Grid.prototype.colorDictionarys
  27740. * @description 颜色对照表对象。
  27741. */
  27742. _this.colorDictionarys = null;
  27743. /**
  27744. * @member {number} SuperMap.Grid.prototype.brightness
  27745. * @description Grid 图层的亮度。
  27746. */
  27747. _this.brightness = null;
  27748. /**
  27749. * @member {SuperMap.ColorGradientType} SuperMap.Grid.prototype.colorGradientType
  27750. * @description 渐变颜色枚举值。
  27751. */
  27752. _this.colorGradientType = null;
  27753. /**
  27754. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.colors
  27755. * @description 颜色表对象。
  27756. */
  27757. _this.colors = null;
  27758. /**
  27759. * @member {number} SuperMap.Grid.prototype.contrast
  27760. * @description Grid 图层的对比度。
  27761. */
  27762. _this.contrast = null;
  27763. /**
  27764. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.dashStyle
  27765. * @description 栅格数据集特殊值数据的颜色。
  27766. */
  27767. _this.dashStyle = null;
  27768. /**
  27769. * @member {SuperMap.GridType} SuperMap.Grid.prototype.gridType
  27770. * @description 格网类型。
  27771. */
  27772. _this.gridType = null;
  27773. /**
  27774. * @member {number} SuperMap.Grid.prototype.horizontalSpacing
  27775. * @description 格网水平间隔大小。
  27776. */
  27777. _this.horizontalSpacing = null;
  27778. /**
  27779. * @member {boolean} SuperMap.Grid.prototype.sizeFixed
  27780. * @description 格网是否固定大小,如果不固定大小,则格网随着地图缩放。
  27781. */
  27782. _this.sizeFixed = null;
  27783. /**
  27784. * @member {SuperMap.ServerStyle} SuperMap.Grid.prototype.solidStyle
  27785. * @description 格网实线的样式。
  27786. */
  27787. _this.solidStyle = null;
  27788. /**
  27789. * @member {SuperMap.ServerColor} SuperMap.Grid.prototype.specialColor
  27790. * @description 栅格数据集无值数据的颜色。
  27791. */
  27792. _this.specialColor = null;
  27793. /**
  27794. * @member {number} SuperMap.Grid.prototype.specialValue
  27795. * @description 图层的特殊值。
  27796. */
  27797. _this.specialValue = null;
  27798. /**
  27799. * @member {boolean} SuperMap.Grid.prototype.specialValueTransparent
  27800. * @description 图层的特殊值(specialValue)所处区域是否透明。
  27801. */
  27802. _this.specialValueTransparent = null;
  27803. /**
  27804. * @member {number} SuperMap.Grid.prototype.verticalSpacing
  27805. * @description 格网垂直间隔大小。
  27806. */
  27807. _this.verticalSpacing = null;
  27808. _this.CLASS_NAME = "SuperMap.Grid";
  27809. return _this;
  27810. }
  27811. /**
  27812. * @function SuperMap.Grid.prototype.destroy
  27813. * @description 释放资源,将引用资源的属性置空。
  27814. */
  27815. Grid_createClass(Grid, [{
  27816. key: "destroy",
  27817. value: function destroy() {
  27818. Grid_get(Grid_getPrototypeOf(Grid.prototype), "destroy", this).call(this);
  27819. Util.reset(this);
  27820. }
  27821. /**
  27822. * @function SuperMap.Grid.prototype.fromJson
  27823. * @description 将服务端 JSON 对象转换成当前客户端对象。
  27824. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27825. */
  27826. }, {
  27827. key: "fromJson",
  27828. value: function fromJson(jsonObject) {
  27829. Grid_get(Grid_getPrototypeOf(Grid.prototype), "fromJson", this).call(this, jsonObject);
  27830. if (this.specialColor) {
  27831. this.specialColor = new ServerColor(this.specialColor.red, this.specialColor.green, this.specialColor.blue);
  27832. }
  27833. if (this.colors) {
  27834. var colors = [],
  27835. color;
  27836. for (var i in this.colors) {
  27837. color = this.colors[i];
  27838. colors.push(new ServerColor(color.red, color.green, color.blue));
  27839. }
  27840. this.colors = colors;
  27841. }
  27842. if (this.dashStyle) {
  27843. this.dashStyle = new ServerStyle(this.dashStyle);
  27844. }
  27845. if (this.solidStyle) {
  27846. this.solidStyle = new ServerStyle(this.solidStyle);
  27847. }
  27848. if (this.colorDictionary) {
  27849. var colorDics = [],
  27850. colorDic;
  27851. for (var key in this.colorDictionary) {
  27852. colorDic = this.colorDictionary[key];
  27853. colorDics.push(new ColorDictionary({
  27854. elevation: key,
  27855. color: colorDic
  27856. }));
  27857. }
  27858. this.colorDictionarys = colorDics;
  27859. }
  27860. delete this.colorDictionary;
  27861. }
  27862. /**
  27863. * @function SuperMap.Grid.prototype.toServerJSONObject
  27864. * @description 转换成对应的 JSON 对象。
  27865. * @returns JSON 对象。
  27866. */
  27867. }, {
  27868. key: "toServerJSONObject",
  27869. value: function toServerJSONObject() {
  27870. var jsonObject = Grid_get(Grid_getPrototypeOf(Grid.prototype), "toServerJSONObject", this).call(this);
  27871. if (jsonObject.dashStyle) {
  27872. if (jsonObject.dashStyle.toServerJSONObject) {
  27873. jsonObject.dashStyle = jsonObject.dashStyle.toServerJSONObject();
  27874. }
  27875. }
  27876. if (jsonObject.solidStyle) {
  27877. if (jsonObject.solidStyle.toServerJSONObject) {
  27878. jsonObject.solidStyle = jsonObject.solidStyle.toServerJSONObject();
  27879. }
  27880. }
  27881. return jsonObject;
  27882. }
  27883. }]);
  27884. return Grid;
  27885. }(UGCSubLayer);
  27886. SuperMap.Grid = Grid;
  27887. ;// CONCATENATED MODULE: ./src/common/iServer/Image.js
  27888. function Image_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Image_typeof = function _typeof(obj) { return typeof obj; }; } else { Image_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Image_typeof(obj); }
  27889. function Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  27890. 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); } }
  27891. function Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) Image_defineProperties(Constructor, staticProps); return Constructor; }
  27892. function Image_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Image_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Image_get(target, property, receiver || target); }
  27893. function Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Image_getPrototypeOf(object); if (object === null) break; } return object; }
  27894. 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 } }); if (superClass) Image_setPrototypeOf(subClass, superClass); }
  27895. function Image_setPrototypeOf(o, p) { Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Image_setPrototypeOf(o, p); }
  27896. 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); }; }
  27897. function Image_possibleConstructorReturn(self, call) { if (call && (Image_typeof(call) === "object" || typeof call === "function")) { return call; } return Image_assertThisInitialized(self); }
  27898. function Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  27899. function Image_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  27900. function Image_getPrototypeOf(o) { Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Image_getPrototypeOf(o); }
  27901. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  27902. * This program are made available under the terms of the Apache License, Version 2.0
  27903. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  27904. /**
  27905. * @class SuperMap.Image
  27906. * @category iServer Map Layer
  27907. * @classdesc UGC 影像图层类
  27908. * @extends {SuperMap.UGCSubLayer}
  27909. * @param {Object} options - 参数。
  27910. * @param {SuperMap.ColorSpaceType} [options.colorSpaceType] - 返回影像图层的色彩显示模式。
  27911. * @param {number} [options.brightness] - 影像图层的亮度。
  27912. * @param {Array.<number>} [options.displayBandIndexes] - 返回当前影像图层显示的波段索引。
  27913. * @param {number} [options.contrast] - 影像图层的对比度。
  27914. * @param {boolean} [options.transparent] - 是否背景透明。
  27915. * @param {SuperMap.ServerColor} [options.transparentColor] - 返回背景透明色。
  27916. * @param {number} [options.transparentColorTolerance] - 背景透明色容限。
  27917. */
  27918. var UGCImage = /*#__PURE__*/function (_UGCSubLayer) {
  27919. Image_inherits(UGCImage, _UGCSubLayer);
  27920. var _super = Image_createSuper(UGCImage);
  27921. function UGCImage(options) {
  27922. var _this;
  27923. Image_classCallCheck(this, UGCImage);
  27924. options = options || {};
  27925. _this = _super.call(this, options);
  27926. /**
  27927. * @member {number} SuperMap.Image.prototype.brightness
  27928. * @description 影像图层的亮度。
  27929. */
  27930. _this.brightness = null;
  27931. /**
  27932. * @member {SuperMap.ColorSpaceType} SuperMap.Image.prototype.colorSpaceType
  27933. * @description 返回影像图层的色彩显示模式。
  27934. */
  27935. _this.colorSpaceType = null;
  27936. /**
  27937. * @member {number} SuperMap.Image.prototype.contrast
  27938. * @description 影像图层的对比度。
  27939. */
  27940. _this.contrast = null;
  27941. /**
  27942. * @member {Array.<number>} SuperMap.Image.prototype.displayBandIndexes
  27943. * @description 返回当前影像图层显示的波段索引。
  27944. */
  27945. _this.displayBandIndexes = null;
  27946. /**
  27947. * @member {boolean} SuperMap.Image.prototype.transparent
  27948. * @description 是否背景透明。
  27949. */
  27950. _this.transparent = null;
  27951. /**
  27952. * @member {SuperMap.ServerColor} SuperMap.Image.prototype.transparentColor
  27953. * @description 返回背景透明色。
  27954. */
  27955. _this.transparentColor = null;
  27956. /**
  27957. * @member {number} SuperMap.Image.prototype.transparentColorTolerance
  27958. * @description 背景透明色容限。
  27959. */
  27960. _this.transparentColorTolerance = null;
  27961. _this.CLASS_NAME = "SuperMap.Image";
  27962. return _this;
  27963. }
  27964. /**
  27965. * @function SuperMap.Image.prototype.destroy
  27966. * @override
  27967. */
  27968. Image_createClass(UGCImage, [{
  27969. key: "destroy",
  27970. value: function destroy() {
  27971. Image_get(Image_getPrototypeOf(UGCImage.prototype), "destroy", this).call(this);
  27972. Util.reset(this);
  27973. }
  27974. /**
  27975. * @function SuperMap.Image.prototype.fromJson
  27976. * @description 将服务端 JSON 对象转换成当前客户端对象。
  27977. * @param {Object} jsonObject - 要转换的 JSON 对象。
  27978. */
  27979. }, {
  27980. key: "fromJson",
  27981. value: function fromJson(jsonObject) {
  27982. Image_get(Image_getPrototypeOf(UGCImage.prototype), "fromJson", this).call(this, jsonObject);
  27983. if (this.transparentColor) {
  27984. this.transparentColor = new ServerColor(this.transparentColor.red, this.transparentColor.green, this.transparentColor.blue);
  27985. }
  27986. }
  27987. /**
  27988. * @function SuperMap.Image.prototype.toServerJSONObject
  27989. * @description 转换成对应的 JSON 格式对象。
  27990. */
  27991. }, {
  27992. key: "toServerJSONObject",
  27993. value: function toServerJSONObject() {
  27994. return Image_get(Image_getPrototypeOf(UGCImage.prototype), "toServerJSONObject", this).call(this);
  27995. }
  27996. }]);
  27997. return UGCImage;
  27998. }(UGCSubLayer);
  27999. SuperMap.Image = UGCImage;
  28000. ;// CONCATENATED MODULE: ./src/common/iServer/Vector.js
  28001. function iServer_Vector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { iServer_Vector_typeof = function _typeof(obj) { return typeof obj; }; } else { iServer_Vector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return iServer_Vector_typeof(obj); }
  28002. function iServer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28003. 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); } }
  28004. function iServer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) iServer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) iServer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  28005. function iServer_Vector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { iServer_Vector_get = Reflect.get; } 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(receiver); } return desc.value; }; } return iServer_Vector_get(target, property, receiver || target); }
  28006. function iServer_Vector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = iServer_Vector_getPrototypeOf(object); if (object === null) break; } return object; }
  28007. 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 } }); if (superClass) iServer_Vector_setPrototypeOf(subClass, superClass); }
  28008. function iServer_Vector_setPrototypeOf(o, p) { iServer_Vector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return iServer_Vector_setPrototypeOf(o, p); }
  28009. 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); }; }
  28010. function iServer_Vector_possibleConstructorReturn(self, call) { if (call && (iServer_Vector_typeof(call) === "object" || typeof call === "function")) { return call; } return iServer_Vector_assertThisInitialized(self); }
  28011. function iServer_Vector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28012. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28013. function iServer_Vector_getPrototypeOf(o) { iServer_Vector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return iServer_Vector_getPrototypeOf(o); }
  28014. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28015. * This program are made available under the terms of the Apache License, Version 2.0
  28016. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28017. /**
  28018. * @class SuperMap.Vector
  28019. * @category iServer Map TileFeature
  28020. * @classdesc UGC 矢量图层类。
  28021. * @extends {SuperMap.UGCSubLayer}
  28022. * @param {Object} options - 参数。
  28023. * @param {SuperMap.ServerStyle} [options.style] - 矢量图层的风格。
  28024. */
  28025. var Vector_Vector = /*#__PURE__*/function (_UGCSubLayer) {
  28026. iServer_Vector_inherits(Vector, _UGCSubLayer);
  28027. var _super = iServer_Vector_createSuper(Vector);
  28028. function Vector(options) {
  28029. var _this;
  28030. iServer_Vector_classCallCheck(this, Vector);
  28031. options = options || {};
  28032. _this = _super.call(this, options);
  28033. /**
  28034. * @member {SuperMap.ServerStyle} SuperMap.Vector.prototype.style
  28035. * @description 矢量图层的风格。
  28036. */
  28037. _this.style = null;
  28038. _this.CLASS_NAME = "SuperMap.Vector";
  28039. return _this;
  28040. }
  28041. /**
  28042. * @function SuperMap.Vector.prototype.destroy
  28043. * @override
  28044. */
  28045. iServer_Vector_createClass(Vector, [{
  28046. key: "destroy",
  28047. value: function destroy() {
  28048. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "destroy", this).call(this);
  28049. Util.reset(this);
  28050. }
  28051. /**
  28052. * @function SuperMap.Vector.prototype.fromJson
  28053. * @description 将服务端 JSON 对象转换成当前客户端对象。
  28054. * @param {Object} jsonObject - 要转换的 JSON 对象。
  28055. */
  28056. }, {
  28057. key: "fromJson",
  28058. value: function fromJson(jsonObject) {
  28059. iServer_Vector_get(iServer_Vector_getPrototypeOf(Vector.prototype), "fromJson", this).call(this, jsonObject);
  28060. var sty = this.style;
  28061. if (sty) {
  28062. this.style = new ServerStyle(sty);
  28063. }
  28064. }
  28065. /**
  28066. * @function SuperMap.Vector.prototype.toServerJSONObject
  28067. * @description 转换成对应的 JSON 格式对象。
  28068. * @returns {Object} 对应的 JSON 格式对象
  28069. */
  28070. }, {
  28071. key: "toServerJSONObject",
  28072. value: function toServerJSONObject() {
  28073. var jsonObject = SuperMap.toServerJSONObject();
  28074. if (jsonObject.style) {
  28075. if (jsonObject.style.toServerJSONObject) {
  28076. jsonObject.style = jsonObject.style.toServerJSONObject();
  28077. }
  28078. }
  28079. return jsonObject;
  28080. }
  28081. }]);
  28082. return Vector;
  28083. }(UGCSubLayer);
  28084. SuperMap.Vector = Vector_Vector;
  28085. ;// CONCATENATED MODULE: ./src/common/iServer/GetLayersInfoService.js
  28086. function GetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GetLayersInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { GetLayersInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GetLayersInfoService_typeof(obj); }
  28087. function GetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28088. 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); } }
  28089. function GetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  28090. function GetLayersInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GetLayersInfoService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GetLayersInfoService_get(target, property, receiver || target); }
  28091. function GetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  28092. 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 } }); if (superClass) GetLayersInfoService_setPrototypeOf(subClass, superClass); }
  28093. function GetLayersInfoService_setPrototypeOf(o, p) { GetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GetLayersInfoService_setPrototypeOf(o, p); }
  28094. 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); }; }
  28095. function GetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (GetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return GetLayersInfoService_assertThisInitialized(self); }
  28096. function GetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28097. function GetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28098. function GetLayersInfoService_getPrototypeOf(o) { GetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GetLayersInfoService_getPrototypeOf(o); }
  28099. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28100. * This program are made available under the terms of the Apache License, Version 2.0
  28101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28102. /**
  28103. * @class SuperMap.GetLayersInfoService
  28104. * @category iServer Map Layer
  28105. * @classdesc 获取图层信息服务类构造函数。
  28106. * @extends {SuperMap.CommonServiceBase}
  28107. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  28108. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  28109. * 如 http://localhost:8090/iserver/services/map-world/rest/maps/World 。
  28110. * 如果查询临时图层的信息,请指定完成的url,包含临时图层ID信息,如:
  28111. * http://localhost:8090/iserver/services/map-world/rest/maps/World/tempLayersSet/resourceID
  28112. * @param {Object} options - 参数。
  28113. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  28114. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  28115. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  28116. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  28117. * @param {Object} [options.headers] - 请求头。
  28118. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  28119. */
  28120. var GetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  28121. GetLayersInfoService_inherits(GetLayersInfoService, _CommonServiceBase);
  28122. var _super = GetLayersInfoService_createSuper(GetLayersInfoService);
  28123. function GetLayersInfoService(url, options) {
  28124. var _this;
  28125. GetLayersInfoService_classCallCheck(this, GetLayersInfoService);
  28126. _this = _super.call(this, url, options);
  28127. /**
  28128. * @member {boolean} SuperMap.GetLayersInfoService.prototype.isTempLayers
  28129. * @description 当前url对应的图层是否是临时图层。
  28130. */
  28131. _this.isTempLayers = false;
  28132. if (options) {
  28133. Util.extend(GetLayersInfoService_assertThisInitialized(_this), options);
  28134. }
  28135. _this.CLASS_NAME = "SuperMap.GetLayersInfoService";
  28136. return _this;
  28137. }
  28138. /**
  28139. * @function SuperMap.GetLayersInfoService.prototype.destroy
  28140. * @override
  28141. */
  28142. GetLayersInfoService_createClass(GetLayersInfoService, [{
  28143. key: "destroy",
  28144. value: function destroy() {
  28145. GetLayersInfoService_get(GetLayersInfoService_getPrototypeOf(GetLayersInfoService.prototype), "destroy", this).call(this);
  28146. Util.reset(this);
  28147. }
  28148. /**
  28149. * @function SuperMap.GetLayersInfoService.prototype.processAsync
  28150. * @description 负责将客户端的更新参数传递到服务端。
  28151. */
  28152. }, {
  28153. key: "processAsync",
  28154. value: function processAsync() {
  28155. var me = this,
  28156. method = "GET";
  28157. if (!me.isTempLayers) {
  28158. me.url = Util.urlPathAppend(me.url, 'layers');
  28159. }
  28160. me.request({
  28161. method: method,
  28162. params: null,
  28163. scope: me,
  28164. success: me.serviceProcessCompleted,
  28165. failure: me.serviceProcessFailed
  28166. });
  28167. }
  28168. /**
  28169. * @function SuperMap.GetLayersInfoService.prototype.serviceProcessCompleted
  28170. * @description 编辑完成,执行此方法。
  28171. * @param {Object} result - 服务器返回的结果对象。
  28172. */
  28173. }, {
  28174. key: "serviceProcessCompleted",
  28175. value: function serviceProcessCompleted(result) {
  28176. var me = this,
  28177. existRes,
  28178. layers,
  28179. len;
  28180. result = Util.transformResult(result);
  28181. existRes = !!result && result.length > 0;
  28182. layers = existRes ? result[0].subLayers.layers : null;
  28183. len = layers ? layers.length : 0;
  28184. me.handleLayers(len, layers);
  28185. me.events.triggerEvent("processCompleted", {
  28186. result: result[0]
  28187. });
  28188. }
  28189. /**
  28190. * TODO 专题图时候可能会用到
  28191. * @function SuperMap.GetLayersInfoService.prototype.handleLayers
  28192. * @description 处理 iServer 新增图层组数据 (subLayers.layers 中可能还会含有 subLayers.layers)
  28193. * @param {number} len - subLayers.layers的长度
  28194. * @param {Array.<number>} layers - subLayers.layers的长度数组
  28195. */
  28196. }, {
  28197. key: "handleLayers",
  28198. value: function handleLayers(len, layers) {
  28199. var me = this,
  28200. tempLayer;
  28201. if (len) {
  28202. for (var i = 0; i < len; i++) {
  28203. if (layers[i].subLayers && layers[i].subLayers.layers && layers[i].subLayers.layers.length > 0) {
  28204. me.handleLayers(layers[i].subLayers.layers.length, layers[i].subLayers.layers);
  28205. } else {
  28206. var type = layers[i].ugcLayerType;
  28207. switch (type) {
  28208. case 'THEME':
  28209. tempLayer = new ServerTheme();
  28210. tempLayer.fromJson(layers[i]);
  28211. layers[i] = tempLayer;
  28212. break;
  28213. case 'GRID':
  28214. tempLayer = new Grid();
  28215. tempLayer.fromJson(layers[i]);
  28216. layers[i] = tempLayer;
  28217. break;
  28218. case 'IMAGE':
  28219. tempLayer = new UGCImage();
  28220. tempLayer.fromJson(layers[i]);
  28221. layers[i] = tempLayer;
  28222. break;
  28223. case 'VECTOR':
  28224. tempLayer = new Vector_Vector();
  28225. tempLayer.fromJson(layers[i]);
  28226. layers[i] = tempLayer;
  28227. break;
  28228. default:
  28229. break;
  28230. }
  28231. }
  28232. }
  28233. }
  28234. }
  28235. }]);
  28236. return GetLayersInfoService;
  28237. }(CommonServiceBase);
  28238. SuperMap.GetLayersInfoService = GetLayersInfoService;
  28239. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystParameters.js
  28240. function InterpolationAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28241. 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); } }
  28242. function InterpolationAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  28243. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28244. * This program are made available under the terms of the Apache License, Version 2.0
  28245. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28246. /**
  28247. * @class SuperMap.InterpolationAnalystParameters
  28248. * @category iServer SpatialAnalyst InterpolationAnalyst
  28249. * @classdesc 插值分析参数类。
  28250. * @param {Object} options - 参数。
  28251. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  28252. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  28253. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  28254. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。
  28255. * @param {string} [options.dataset] - 用于做插值分析的数据源中数据集的名称。当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  28256. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  28257. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  28258. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  28259. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28260. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  28261. * @param {SuperMap.PixelFormat} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  28262. * @param {string} [options.InterpolationAnalystType="dataset"] - 插值分析类型("dataset" 或 "geometry")。
  28263. */
  28264. var InterpolationAnalystParameters = /*#__PURE__*/function () {
  28265. function InterpolationAnalystParameters(options) {
  28266. InterpolationAnalystParameters_classCallCheck(this, InterpolationAnalystParameters);
  28267. if (!options) {
  28268. return;
  28269. }
  28270. /**
  28271. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.InterpolationAnalystParameters.prototype.bounds
  28272. * @description 插值分析的范围,用于确定结果栅格数据集的范围。
  28273. * 如果缺省,则默认为原数据集的范围。鉴于此插值方法为内插方法,原数据集的范围内的插值结果才相对有参考价值,
  28274. * 因此建议此参数不大于原数据集范围。
  28275. */
  28276. this.bounds = null;
  28277. /**
  28278. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.searchRadius=0]
  28279. * @description 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  28280. * 计算某个位置的Z 值时,会以该位置为圆心,以查找范围的值为半径,落在这个范围内的采样点都将参与运算。
  28281. * 该值需要根据待插值点数据的分布状况和点数据集范围进行设置。
  28282. */
  28283. this.searchRadius = 0;
  28284. /**
  28285. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.zValueFieldName
  28286. * @description 数据集插值分析中,用于指定进行插值分析的目标字段名,插值分析不支持文本类型的字段。
  28287. * 含义为每个插值点在插值过程中的权重,可以将所有点此字段值设置为 1,即所有点在整体插值中权重相同。
  28288. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此为必选参数。
  28289. */
  28290. this.zValueFieldName = null;
  28291. /**
  28292. * @member {number} [SuperMap.InterpolationAnalystParameters.prototype.zValueScale=1]
  28293. * @description 用于进行插值分析值的缩放比率。
  28294. * 参加插值分析的值将乘以该参数值后再进行插值,也就是对进行插值分析的值进行统一的扩大或缩小。
  28295. */
  28296. this.zValueScale = 1;
  28297. /**
  28298. * @member {number} SuperMap.InterpolationAnalystParameters.prototype.resolution
  28299. * @description 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28300. * 该值不能超过待分析数据集的范围边长。
  28301. * 且该值设置时,应该考虑点数据集范围大小来取值,一般为结果栅格行列值(即结果栅格数据集范围除以分辨率),在 500 以内可以较好地体现密度走势。
  28302. */
  28303. this.resolution = null;
  28304. /**
  28305. * @member {SuperMap.FilterParameter} [SuperMap.InterpolationAnalystParameters.prototype.filterQueryParameter]
  28306. * @description 过滤条件,对分析数据集中的点进行过滤,设置为 null 表示对数据集中的所有点进行分析。
  28307. */
  28308. this.filterQueryParameter = null;
  28309. /**
  28310. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasetName
  28311. * @description 插值分析结果数据集的名称。
  28312. */
  28313. this.outputDatasetName = null;
  28314. /**
  28315. * @member {string} SuperMap.InterpolationAnalystParameters.prototype.outputDatasourceName
  28316. * @description 插值分析结果数据源的名称。
  28317. */
  28318. this.outputDatasourceName = null;
  28319. /**
  28320. * @member {SuperMap.PixelFormat} [SuperMap.InterpolationAnalystParameters.prototype.pixelFormat]
  28321. * @description 指定结果栅格数据集存储的像素格式。支持存储的像素格式有 BIT16、BIT32、DOUBLE、SINGLE、UBIT1、UBIT4、UBIT8、UBIT24、UBIT32。
  28322. */
  28323. this.pixelFormat = null;
  28324. /**
  28325. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.dataset]
  28326. * @description 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。
  28327. * 当插值分析类型(InterpolationAnalystType)为 dataset 时,此参数为必选。
  28328. */
  28329. this.dataset = null;
  28330. /**
  28331. * @member {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [SuperMap.InterpolationAnalystParameters.prototype.inputPoints]
  28332. * @description 用于做插值分析的离散点(离散点包括Z值)集合。
  28333. * 当插值分析类型(InterpolationAnalystType)为 geometry 时,此参数为必设参数。
  28334. * 通过离散点直接进行插值分析不需要指定输入数据集inputDatasourceName,inputDatasetName以及zValueFieldName。
  28335. */
  28336. this.inputPoints = null;
  28337. /**
  28338. * @member {string} [SuperMap.InterpolationAnalystParameters.prototype.InterpolationAnalystType="dataset"]
  28339. * @description 插值分析类型。差值分析包括数据集插值分析和几何插值分析两类,
  28340. * "dataset" 表示对数据集进行插值分析,"geometry" 表示对离散点数组进行插值分析。
  28341. */
  28342. this.InterpolationAnalystType = "dataset";
  28343. /**
  28344. * @member {Object} SuperMap.InterpolationAnalystParameters.prototype.clipParam
  28345. * @description 对插值分析结果进行裁剪的参数。
  28346. */
  28347. this.clipParam = null;
  28348. Util.extend(this, options);
  28349. this.CLASS_NAME = "SuperMap.InterpolationAnalystParameters";
  28350. }
  28351. /**
  28352. * @function SuperMap.InterpolationAnalystParameters.prototype.destroy
  28353. * @description 释放资源,将引用资源的属性置空。
  28354. */
  28355. InterpolationAnalystParameters_createClass(InterpolationAnalystParameters, [{
  28356. key: "destroy",
  28357. value: function destroy() {
  28358. var me = this;
  28359. me.bounds = null;
  28360. me.searchRadius = null;
  28361. me.zValueFieldName = null;
  28362. me.zValueScale = null;
  28363. me.resolution = null;
  28364. me.filterQueryParameter = null;
  28365. me.outputDatasetName = null;
  28366. me.pixelFormat = null;
  28367. }
  28368. /**
  28369. * @function SuperMap.InterpolationAnalystParameters.toObject
  28370. * @param {SuperMap.InterpolationAnalystParameters} interpolationAnalystParameters - 插值分析参数类。
  28371. * @param {SuperMap.InterpolationAnalystParameters} tempObj - 插值分析参数对象。
  28372. * @description 将插值分析参数对象转换成 JSON 对象。
  28373. * @returns JSON 对象。
  28374. */
  28375. }], [{
  28376. key: "toObject",
  28377. value: function toObject(interpolationAnalystParameters, tempObj) {
  28378. for (var name in interpolationAnalystParameters) {
  28379. if (name === "inputPoints" && interpolationAnalystParameters.InterpolationAnalystType === "geometry") {
  28380. var objs = [];
  28381. for (var i = 0; i < interpolationAnalystParameters.inputPoints.length; i++) {
  28382. var item = interpolationAnalystParameters.inputPoints[i];
  28383. var obj = {
  28384. x: item.x,
  28385. y: item.y,
  28386. z: item.tag
  28387. };
  28388. objs.push(obj);
  28389. }
  28390. tempObj[name] = objs;
  28391. } else {
  28392. tempObj[name] = interpolationAnalystParameters[name];
  28393. }
  28394. }
  28395. }
  28396. }]);
  28397. return InterpolationAnalystParameters;
  28398. }();
  28399. SuperMap.InterpolationAnalystParameters = InterpolationAnalystParameters;
  28400. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationRBFAnalystParameters.js
  28401. function InterpolationRBFAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationRBFAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationRBFAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationRBFAnalystParameters_typeof(obj); }
  28402. function InterpolationRBFAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28403. 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); } }
  28404. function InterpolationRBFAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationRBFAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationRBFAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  28405. function InterpolationRBFAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationRBFAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return InterpolationRBFAnalystParameters_get(target, property, receiver || target); }
  28406. function InterpolationRBFAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationRBFAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  28407. 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 } }); if (superClass) InterpolationRBFAnalystParameters_setPrototypeOf(subClass, superClass); }
  28408. function InterpolationRBFAnalystParameters_setPrototypeOf(o, p) { InterpolationRBFAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationRBFAnalystParameters_setPrototypeOf(o, p); }
  28409. 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); }; }
  28410. function InterpolationRBFAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationRBFAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationRBFAnalystParameters_assertThisInitialized(self); }
  28411. function InterpolationRBFAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28412. function InterpolationRBFAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28413. function InterpolationRBFAnalystParameters_getPrototypeOf(o) { InterpolationRBFAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationRBFAnalystParameters_getPrototypeOf(o); }
  28414. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28415. * This program are made available under the terms of the Apache License, Version 2.0
  28416. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28417. /**
  28418. * @class SuperMap.InterpolationRBFAnalystParameters
  28419. * @category iServer SpatialAnalyst InterpolationAnalyst
  28420. * @classdesc 样条插值(径向基函数插值法)分析参数类。
  28421. * @extends {SuperMap.InterpolationAnalystParameters}
  28422. * @param {Object} options - 参数。
  28423. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  28424. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  28425. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  28426. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  28427. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  28428. * @param {number} [options.smooth=0.1] - 光滑系数,该值表示插值函数曲线与点的逼近程度,值域为0到1。
  28429. * @param {number} [options.tension=40] - 张力系数,用于调整结果栅格数据表面的特性。
  28430. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置参与差值运算的点数。
  28431. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  28432. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  28433. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  28434. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  28435. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28436. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  28437. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  28438. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(InterpolationAnalystType)为 dataset 时。此参数为必选。
  28439. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。此参数为必选。
  28440. * @example
  28441. * var myInterpolationRBFAnalystParameters = new SuperMap.InterpolationRBFAnalystParameters({
  28442. * dataset:"SamplesP@Interpolation",
  28443. * smooth: 0.1,
  28444. * tension: 40,
  28445. * searchMode: "QUADTREE",
  28446. * maxPointCountForInterpolation: 20,
  28447. * maxPointCountInNode: 5,
  28448. * pixelFormat: "BIT16",
  28449. * zValueFieldName: "AVG_TMP",
  28450. * resolution: 3000,
  28451. * filterQueryParameter: {
  28452. * attributeFilter: ""
  28453. * },
  28454. * outputDatasetName: "myRBF"
  28455. * });
  28456. */
  28457. var InterpolationRBFAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  28458. InterpolationRBFAnalystParameters_inherits(InterpolationRBFAnalystParameters, _InterpolationAnalyst);
  28459. var _super = InterpolationRBFAnalystParameters_createSuper(InterpolationRBFAnalystParameters);
  28460. function InterpolationRBFAnalystParameters(options) {
  28461. var _this;
  28462. InterpolationRBFAnalystParameters_classCallCheck(this, InterpolationRBFAnalystParameters);
  28463. _this = _super.call(this, options);
  28464. /**
  28465. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.smooth=0.1]
  28466. * @description 光滑系数,值域为 0 到 1,常用取值如 0、0.001、0.01、0.1、和 0.5。
  28467. * 该值表示插值函数曲线与点的逼近程度,此数值越大,函数曲线与点的偏差越大,反之越小。
  28468. */
  28469. _this.smooth = 0.1;
  28470. /**
  28471. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.tension=40]
  28472. * @description 张力系数,常用取值如 0、1、5 和 10。
  28473. * 用于调整结果栅格数据表面的特性,张力越大,插值时每个点对计算结果影响越小,反之越大。
  28474. */
  28475. _this.tension = 40;
  28476. /**
  28477. * @member {SuperMap.SearchMode} SuperMap.InterpolationRBFAnalystParameters.prototype.searchMode
  28478. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  28479. * 具体如下:
  28480. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  28481. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  28482. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  28483. */
  28484. _this.searchMode = null;
  28485. /**
  28486. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.expectedCount=12]
  28487. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  28488. */
  28489. _this.expectedCount = 12;
  28490. /**
  28491. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountForInterpolation=200]
  28492. * @description 【块查找】方式下,最多参与插值的点数。
  28493. */
  28494. _this.maxPointCountForInterpolation = 200;
  28495. /**
  28496. * @member {number} [SuperMap.InterpolationRBFAnalystParameters.prototype.maxPointCountInNode=50]
  28497. * @description 【块查找】方式下,单个块内最多参与运算点数。
  28498. */
  28499. _this.maxPointCountInNode = 50;
  28500. if (options) {
  28501. Util.extend(InterpolationRBFAnalystParameters_assertThisInitialized(_this), options);
  28502. }
  28503. _this.CLASS_NAME = "SuperMap.InterpolationRBFAnalystParameters";
  28504. return _this;
  28505. }
  28506. /**
  28507. * @function SuperMap.InterpolationRBFAnalystParameters.prototype.destroy
  28508. * @description 释放资源,将引用资源的属性置空。
  28509. */
  28510. InterpolationRBFAnalystParameters_createClass(InterpolationRBFAnalystParameters, [{
  28511. key: "destroy",
  28512. value: function destroy() {
  28513. InterpolationRBFAnalystParameters_get(InterpolationRBFAnalystParameters_getPrototypeOf(InterpolationRBFAnalystParameters.prototype), "destroy", this).call(this);
  28514. var me = this;
  28515. me.smooth = null;
  28516. me.tension = null;
  28517. me.searchMode = null;
  28518. me.expectedCount = null;
  28519. me.maxPointCountForInterpolation = null;
  28520. me.maxPointCountInNode = null;
  28521. }
  28522. /**
  28523. * @function SuperMap.InterpolationRBFAnalystParameters.toObject
  28524. * @param {SuperMap.InterpolationRBFAnalystParameters} datasetInterpolationRBFAnalystParameters - 样条插值(径向基函数插值法)分析参数类
  28525. * @param {SuperMap.InterpolationRBFAnalystParameters} tempObj - 样条插值(径向基函数插值法)分析参数对象
  28526. * @description 将样条插值(径向基函数插值法)分析参数对象转换为 JSON 对象。
  28527. * @returns JSON 对象。
  28528. */
  28529. }], [{
  28530. key: "toObject",
  28531. value: function toObject(datasetInterpolationRBFAnalystParameters, tempObj) {
  28532. for (var name in datasetInterpolationRBFAnalystParameters) {
  28533. tempObj[name] = datasetInterpolationRBFAnalystParameters[name];
  28534. }
  28535. }
  28536. }]);
  28537. return InterpolationRBFAnalystParameters;
  28538. }(InterpolationAnalystParameters);
  28539. SuperMap.InterpolationRBFAnalystParameters = InterpolationRBFAnalystParameters;
  28540. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationDensityAnalystParameters.js
  28541. function InterpolationDensityAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationDensityAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationDensityAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationDensityAnalystParameters_typeof(obj); }
  28542. function InterpolationDensityAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28543. 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); } }
  28544. function InterpolationDensityAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationDensityAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationDensityAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  28545. function InterpolationDensityAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationDensityAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return InterpolationDensityAnalystParameters_get(target, property, receiver || target); }
  28546. function InterpolationDensityAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationDensityAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  28547. 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 } }); if (superClass) InterpolationDensityAnalystParameters_setPrototypeOf(subClass, superClass); }
  28548. function InterpolationDensityAnalystParameters_setPrototypeOf(o, p) { InterpolationDensityAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationDensityAnalystParameters_setPrototypeOf(o, p); }
  28549. 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); }; }
  28550. function InterpolationDensityAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationDensityAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationDensityAnalystParameters_assertThisInitialized(self); }
  28551. function InterpolationDensityAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28552. function InterpolationDensityAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28553. function InterpolationDensityAnalystParameters_getPrototypeOf(o) { InterpolationDensityAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationDensityAnalystParameters_getPrototypeOf(o); }
  28554. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28555. * This program are made available under the terms of the Apache License, Version 2.0
  28556. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28557. /**
  28558. * @class SuperMap.InterpolationDensityAnalystParameters
  28559. * @category iServer SpatialAnalyst InterpolationAnalyst
  28560. * @classdesc 点密度差值分析参数类。
  28561. * @param {Object} options - 参数。
  28562. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  28563. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  28564. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  28565. * @param {number} [options.searchRadius=0] - 查找半径,即参与运算点的查找范围,与点数据集单位相同。
  28566. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型( SuperMap.InterpolationAnalystType)为 dataset 时。此为必选参数。
  28567. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  28568. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28569. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  28570. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  28571. * @param {string} [options.dataset] - 用来做插值分析的数据源中数据集的名称,该名称用形如 "数据集名称@数据源别名" 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  28572. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  28573. * @extends {SuperMap.InterpolationAnalystParameters}
  28574. * @example
  28575. * var myInterpolationDensityAnalystParameters = new SuperMap.InterpolationDensityAnalystParameters({
  28576. * dataset: "SamplesP@Interpolation",
  28577. * searchRadius: "100000",
  28578. * pixelFormat: "BIT16",
  28579. * zValueFieldName: "AVG_TMP",
  28580. * resolution: 3000,
  28581. * filterQueryParameter: {
  28582. * attributeFilter: ""
  28583. * },
  28584. * outputDatasetName: "myDensity"
  28585. * });
  28586. */
  28587. var InterpolationDensityAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  28588. InterpolationDensityAnalystParameters_inherits(InterpolationDensityAnalystParameters, _InterpolationAnalyst);
  28589. var _super = InterpolationDensityAnalystParameters_createSuper(InterpolationDensityAnalystParameters);
  28590. function InterpolationDensityAnalystParameters(options) {
  28591. var _this;
  28592. InterpolationDensityAnalystParameters_classCallCheck(this, InterpolationDensityAnalystParameters);
  28593. _this = _super.call(this, options);
  28594. if (options) {
  28595. Util.extend(InterpolationDensityAnalystParameters_assertThisInitialized(_this), options);
  28596. }
  28597. _this.CLASS_NAME = "SuperMap.InterpolationDensityAnalystParameters";
  28598. return _this;
  28599. }
  28600. /**
  28601. * @function SuperMap.InterpolationDensityAnalystParameters.prototype.destroy
  28602. * @description 释放资源,将引用资源的属性置空。
  28603. */
  28604. InterpolationDensityAnalystParameters_createClass(InterpolationDensityAnalystParameters, [{
  28605. key: "destroy",
  28606. value: function destroy() {
  28607. InterpolationDensityAnalystParameters_get(InterpolationDensityAnalystParameters_getPrototypeOf(InterpolationDensityAnalystParameters.prototype), "destroy", this).call(this);
  28608. }
  28609. }]);
  28610. return InterpolationDensityAnalystParameters;
  28611. }(InterpolationAnalystParameters);
  28612. SuperMap.InterpolationDensityAnalystParameters = InterpolationDensityAnalystParameters;
  28613. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationIDWAnalystParameters.js
  28614. function InterpolationIDWAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationIDWAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationIDWAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationIDWAnalystParameters_typeof(obj); }
  28615. function InterpolationIDWAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28616. 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); } }
  28617. function InterpolationIDWAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationIDWAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationIDWAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  28618. function InterpolationIDWAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationIDWAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return InterpolationIDWAnalystParameters_get(target, property, receiver || target); }
  28619. function InterpolationIDWAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationIDWAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  28620. 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 } }); if (superClass) InterpolationIDWAnalystParameters_setPrototypeOf(subClass, superClass); }
  28621. function InterpolationIDWAnalystParameters_setPrototypeOf(o, p) { InterpolationIDWAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationIDWAnalystParameters_setPrototypeOf(o, p); }
  28622. 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); }; }
  28623. function InterpolationIDWAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationIDWAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationIDWAnalystParameters_assertThisInitialized(self); }
  28624. function InterpolationIDWAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28625. function InterpolationIDWAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28626. function InterpolationIDWAnalystParameters_getPrototypeOf(o) { InterpolationIDWAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationIDWAnalystParameters_getPrototypeOf(o); }
  28627. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28628. * This program are made available under the terms of the Apache License, Version 2.0
  28629. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28630. /**
  28631. * @class SuperMap.InterpolationIDWAnalystParameters
  28632. * @category iServer SpatialAnalyst InterpolationAnalyst
  28633. * @classdesc 反距离加权插值(IDW)分析参数类。
  28634. * @param {Object} options - 参数。
  28635. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  28636. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  28637. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  28638. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  28639. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  28640. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  28641. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置查找半径,即参与运算点的查找范围,与点数据集单位相同。
  28642. * @param {number} [options.power=2] - 距离权重计算的幂次。
  28643. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  28644. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28645. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  28646. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  28647. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如”数据集名称@数据源别名”形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,必设参数。
  28648. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(SuperMap.InterpolationAnalystType)为 geometry 时,必设参数。
  28649. * @extends {SuperMap.InterpolationAnalystParameters}
  28650. * @example 例如:
  28651. * var myInterpolationIDWAnalystParameters = new SuperMap.InterpolationIDWAnalystParameters({
  28652. * dataset:"SamplesP@Interpolation",
  28653. * power: 2,
  28654. * searchMode: "KDTREE_FIXED_COUNT",
  28655. * expectedCount: 12,
  28656. * pixelFormat: "BIT16",
  28657. * zValueFieldName: "AVG_TMP",
  28658. * resolution: 3000,
  28659. * filterQueryParameter: {
  28660. * attributeFilter: ""
  28661. * },
  28662. * outputDatasetName: "myIDW"
  28663. * });
  28664. *
  28665. */
  28666. var InterpolationIDWAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  28667. InterpolationIDWAnalystParameters_inherits(InterpolationIDWAnalystParameters, _InterpolationAnalyst);
  28668. var _super = InterpolationIDWAnalystParameters_createSuper(InterpolationIDWAnalystParameters);
  28669. function InterpolationIDWAnalystParameters(options) {
  28670. var _this;
  28671. InterpolationIDWAnalystParameters_classCallCheck(this, InterpolationIDWAnalystParameters);
  28672. _this = _super.call(this, options);
  28673. /**
  28674. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.power=2]
  28675. * @description 距离权重计算的幂次。
  28676. * 该值决定了权值下降的速度,幂次越大,随距离的增大权值下降越快,距离预测点越远的点的权值也越小。
  28677. * 理论上,参数值必须大于0,但是0.5到3之间时运算结果更合理,因此推荐值为0.5~3。
  28678. */
  28679. _this.power = 2;
  28680. /**
  28681. * @member {SuperMap.SearchMode} SuperMap.InterpolationIDWAnalystParameters.prototype.searchMode
  28682. * @description 插值运算时,查找参与运算点的方式,支持固定点数查找、定长查找。
  28683. * 具体如下:
  28684. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。
  28685. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。
  28686. */
  28687. _this.searchMode = null;
  28688. /**
  28689. * @member {number} [SuperMap.InterpolationIDWAnalystParameters.prototype.expectedCount=12]
  28690. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数。
  28691. */
  28692. _this.expectedCount = 12;
  28693. if (options) {
  28694. Util.extend(InterpolationIDWAnalystParameters_assertThisInitialized(_this), options);
  28695. }
  28696. _this.CLASS_NAME = "SuperMap.InterpolationIDWAnalystParameters";
  28697. return _this;
  28698. }
  28699. /**
  28700. * @function SuperMap.InterpolationIDWAnalystParameters.prototype.destroy
  28701. * @description 释放资源,将引用资源的属性置空。
  28702. */
  28703. InterpolationIDWAnalystParameters_createClass(InterpolationIDWAnalystParameters, [{
  28704. key: "destroy",
  28705. value: function destroy() {
  28706. InterpolationIDWAnalystParameters_get(InterpolationIDWAnalystParameters_getPrototypeOf(InterpolationIDWAnalystParameters.prototype), "destroy", this).call(this);
  28707. var me = this;
  28708. me.power = null;
  28709. me.searchMode = null;
  28710. me.expectedCount = null;
  28711. }
  28712. }]);
  28713. return InterpolationIDWAnalystParameters;
  28714. }(InterpolationAnalystParameters);
  28715. SuperMap.InterpolationIDWAnalystParameters = InterpolationIDWAnalystParameters;
  28716. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationKrigingAnalystParameters.js
  28717. function InterpolationKrigingAnalystParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationKrigingAnalystParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationKrigingAnalystParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationKrigingAnalystParameters_typeof(obj); }
  28718. function InterpolationKrigingAnalystParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28719. 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); } }
  28720. function InterpolationKrigingAnalystParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationKrigingAnalystParameters_defineProperties(Constructor, staticProps); return Constructor; }
  28721. function InterpolationKrigingAnalystParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationKrigingAnalystParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return InterpolationKrigingAnalystParameters_get(target, property, receiver || target); }
  28722. function InterpolationKrigingAnalystParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationKrigingAnalystParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  28723. 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 } }); if (superClass) InterpolationKrigingAnalystParameters_setPrototypeOf(subClass, superClass); }
  28724. function InterpolationKrigingAnalystParameters_setPrototypeOf(o, p) { InterpolationKrigingAnalystParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationKrigingAnalystParameters_setPrototypeOf(o, p); }
  28725. 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); }; }
  28726. function InterpolationKrigingAnalystParameters_possibleConstructorReturn(self, call) { if (call && (InterpolationKrigingAnalystParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationKrigingAnalystParameters_assertThisInitialized(self); }
  28727. function InterpolationKrigingAnalystParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28728. function InterpolationKrigingAnalystParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28729. function InterpolationKrigingAnalystParameters_getPrototypeOf(o) { InterpolationKrigingAnalystParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationKrigingAnalystParameters_getPrototypeOf(o); }
  28730. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28731. * This program are made available under the terms of the Apache License, Version 2.0
  28732. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28733. /**
  28734. * @class SuperMap.InterpolationKrigingAnalystParameters
  28735. * @category iServer SpatialAnalyst InterpolationAnalyst
  28736. * @classdesc 克吕金插值分析参数类。
  28737. * @description 通过该类可以设置克吕金插值分析所需的参数。
  28738. * 克吕金(Kriging)法为地统计学上一种空间数据内插处理方法,主要的目的是利用各数据点间变异数(variance)的大小来推求某一未知点与各已知点的权重关系,
  28739. * 再由各数据点的值和其与未知点的权重关系推求未知点的值。Kriging 法最大的特色不仅是提供一个最小估计误差的预测值,并且可明确的指出误差值的大小。
  28740. * 一般而言,许多地质参数,如地形面,本身即具有连续性,故在一段距离内的任两点必有空间上的关系。反之,在一不规则面上的两点若相距甚远,
  28741. * 则在统计意义上可视为互为独立 (stastically indepedent)。这种随距离而改变的空间上连续性,可用半变异图 (semivariogram) 来表现。
  28742. * 因此,若想由已知的散乱点来推求某一未知点的值,则可利用半变异图推求各已知点与未知点的空间关系,即以下四个参数。
  28743. * 然后,由此空间参数推求半变异数,由各数据点间的半变异数可推求未知点与已知点间的权重关系,进而推求出未知点的值。<br>
  28744. *
  28745. * · 块金值(nugget):当采样点间距为0时,理论上半变异函数值为0,但时间上两采样点非常接近时半变异函数值并不为0,即产生了上图所示的块金效应,
  28746. * 对应的半变异函数值为块金值。块金值可能由于测量误差或者空间变异产生。<br>
  28747. *
  28748. * · 基台值(sill):随着采样点间距的不断增大,半变异函数的值趋向一个稳定的常数,该常数成为基台值。到达基台值后,半变异函数的值不再随采样点间距而改变,
  28749. * 即大于此间距的采样点不再具有空间相关性。<br>
  28750. *
  28751. * · 偏基台值:基台值与块金值的差值。<br>
  28752. *
  28753. * · 自相关阈值(range):也称变程,是半变异函数值达到基台值时,采样点的间距。超过自相关阈值的采样点不再具有空间相关性,将不对预测结果产生影响。<br>
  28754. *
  28755. * 由上述可知,半变异函数是克吕金插值的关键,因此选择合适的半变异函数模型非常重要,SuperMap 提供了以下三种半变异函数模型:<br>
  28756. *
  28757. * · 指数型(EXPONENTIAL):适用于空间相关关系随样本间距的增加成指数递减的情况,其空间自相关关系在样本间距的无穷远处完全消失。<br>
  28758. *
  28759. * · 球型(SPHERICAL):适用于空间自相关关系随样本间距的增加而逐渐减少,直到超出一定的距离时空间自相关关系消失的情况。<br>
  28760. *
  28761. * · 高斯型(GAUSSIAN):适用于半变异函数值渐进地逼近基台值的情况。<br>
  28762. *
  28763. * 半变异函数中,有一个关键参数即插值的字段值的期望(平均值),由于对于此参数的不同处理方法而衍生出了不同的 Kriging 方法。SuperMap的差值功能基于以下三种常用 Kriging 算法:<br>
  28764. *
  28765. * 1. 简单克吕金(Simple Kriging):该方法假定用于插值的字段值的期望(平均值)已知的某一常数。<br>
  28766. *
  28767. * 2. 普通克吕金(Kriging):该方法假定用于插值的字段值的期望(平均值)未知且恒定。它利用一定的数学函数,通过对给定的空间点进行拟合来估算单元格的值,<br>
  28768. * 生成格网数据集。它不仅可以生成一个表面,还可以给出预测结果的精度或者确定性的度量。因此,此方法计算精度较高,常用于地学领域。
  28769. *
  28770. * 3. 泛克吕金(Universal Kriging):该方法假定用于插值的字段值的期望(平均值)是未知的变量。在样点数据中存在某种主导趋势且该趋势可以通过某一个确定<br>
  28771. * 的函数或者多项式进行拟合的情况下,适用泛克吕金插值法。
  28772. *
  28773. * 克吕金法的优点是以空间统计学作为其坚实的理论基础,物理含义明确;不但能估计测定参数的空间变异分布,而且还可以估算参数的方差分布。克吕金法的缺点是计算步骤较烦琐,
  28774. * 计算量大,且变异函数有时需要根据经验人为选定。
  28775. * @param {Object} options - 参数。
  28776. * @param {string} options.type - 克吕金插值的类型。
  28777. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 插值分析的范围,用于确定结果栅格数据集的范围。
  28778. * @param {string} options.searchMode - 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。
  28779. * @param {string} options.outputDatasetName - 插值分析结果数据集的名称。
  28780. * @param {string} options.outputDatasourceName - 插值分析结果数据源的名称。
  28781. * @param {string} [options.zValueFieldName] - 存储用于进行插值分析的字段名称,插值分析不支持文本类型的字段。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时,此为必选参数。
  28782. * @param {number} [options.mean] - 【简单克吕金】类型下,插值字段的平均值。
  28783. * @param {number} [options.angle=0] - 克吕金算法中旋转角度值。
  28784. * @param {number} [options.nugget=0] - 克吕金算法中块金效应值。
  28785. * @param {number} [options.range=0] - 克吕金算法中自相关阈值,单位与原数据集单位相同。
  28786. * @param {number} [options.sill=0] - 克吕金算法中基台值。
  28787. * @param {string} [options.variogramMode="SPHERICAL"] - 克吕金插值时的半变函数类型。
  28788. * @param {string} [options.exponent='exp1'] - 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数,可选值为 exp1、exp2。
  28789. * @param {number} [options.expectedCount=12] - 【固定点数查找】方式下,设置待查找的点数;【定长查找】方式下,设置查找的最小点数。
  28790. * @param {number} [options.searchRadius=0] - 【定长查找】方式下,设置参与运算点的查找范围。
  28791. * @param {number} [options.maxPointCountForInterpolation=200] - 【块查找】方式下,设置最多参与插值的点数。
  28792. * @param {number} [options.maxPointCountInNode=50] - 【块查找】方式下,设置单个块内最多参与运算点数。
  28793. * @param {number} [options.zValueScale=1] - 用于进行插值分析值的缩放比率。
  28794. * @param {number} [options.resolution] - 插值结果栅格数据集的分辨率,即一个像元所代表的实地距离,与点数据集单位相同。
  28795. * @param {SuperMap.FilterParameter} [options.filterQueryParameter] - 属性过滤条件。
  28796. * @param {string} [options.pixelFormat] - 指定结果栅格数据集存储的像素格式。
  28797. * @param {string} [options.dataset] - 要用来做插值分析的数据源中数据集的名称。该名称用形如 ”数据集名称@数据源别名” 形式来表示。当插值分析类型(SuperMap.InterpolationAnalystType)为 dataset 时。
  28798. * @param {Array.<SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point>} [options.inputPoints] - 用于做插值分析的离散点集合。当插值分析类型(InterpolationAnalystType)为 geometry 时。
  28799. * @extends {SuperMap.InterpolationAnalystParameters}
  28800. * @example 例如:
  28801. * var myInterpolationKrigingAnalystParameters = new SuperMap.InterpolationKrigingAnalystParameters({
  28802. * dataset:"SamplesP@Interpolation",
  28803. * type: "KRIGING",
  28804. * angle: 0,
  28805. * mean: 5,
  28806. * nugget: 30,
  28807. * range: 50,
  28808. * sill: 300,
  28809. * variogramMode: "EXPONENTIAL",
  28810. * searchMode: "QUADTREE",
  28811. * maxPointCountForInterpolation: 20,
  28812. * maxPointCountInNode: 5,
  28813. * pixelFormat: "BIT16",
  28814. * zValueFieldName: "AVG_TMP",
  28815. * resolution: 30000,
  28816. * filterQueryParameter: {
  28817. * attributeFilter: ""
  28818. * },
  28819. * outputDatasetName: "myKriging"
  28820. * });
  28821. *
  28822. */
  28823. var InterpolationKrigingAnalystParameters = /*#__PURE__*/function (_InterpolationAnalyst) {
  28824. InterpolationKrigingAnalystParameters_inherits(InterpolationKrigingAnalystParameters, _InterpolationAnalyst);
  28825. var _super = InterpolationKrigingAnalystParameters_createSuper(InterpolationKrigingAnalystParameters);
  28826. function InterpolationKrigingAnalystParameters(options) {
  28827. var _this;
  28828. InterpolationKrigingAnalystParameters_classCallCheck(this, InterpolationKrigingAnalystParameters);
  28829. _this = _super.call(this, options);
  28830. /**
  28831. * @member {SuperMap.InterpolationAlgorithmType} SuperMap.InterpolationKrigingAnalystParameters.prototype.type
  28832. * @description 克吕金插值的类型。
  28833. * 具体如下:<br>
  28834. * {KRIGING} 普通克吕金插值法。
  28835. * {SimpleKriging} 简单克吕金插值法。
  28836. * {UniversalKriging} 泛克吕金插值法。
  28837. */
  28838. _this.type = null;
  28839. /**
  28840. * @member {number} SuperMap.InterpolationKrigingAnalystParameters.prototype.mean
  28841. * @description 【简单克吕金】方式下,插值字段的平均值。
  28842. * 即采样点插值字段值总和除以采样点数目。
  28843. */
  28844. _this.mean = null;
  28845. /**
  28846. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.angle=0]
  28847. * @description 克吕金算法中旋转角度值。
  28848. * 此角度值指示了每个查找邻域相对于水平方向逆时针旋转的角度。
  28849. */
  28850. _this.angle = 0;
  28851. /**
  28852. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.nugget=0]
  28853. * @description 克吕金算法中块金效应值。
  28854. */
  28855. _this.nugget = 0;
  28856. /**
  28857. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.range=0]
  28858. * @description 克吕金算法中自相关阈值,单位与原数据集单位相同。
  28859. */
  28860. _this.range = 0;
  28861. /**
  28862. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.sill=0]
  28863. * @description 克吕金算法中基台值。
  28864. */
  28865. _this.sill = 0;
  28866. /**
  28867. * @member {SuperMap.VariogramMode} [SuperMap.InterpolationKrigingAnalystParameters.prototype.variogramMode=SuperMap.VariogramMode.SPHERICAL]
  28868. * @description 克吕金插值时的半变函数类型。
  28869. * 用户所选择的半变函数类型会影响未知点的预测,特别是曲线在原点处的不同形状有重要意义。
  28870. * 曲线在原点处越陡,则较近领域对该预测值的影响就越大,因此输出表面就会越不光滑。
  28871. */
  28872. _this.variogramMode = VariogramMode.SPHERICAL;
  28873. /**
  28874. * @member {SuperMap.Exponent} [SuperMap.InterpolationKrigingAnalystParameters.prototype.exponent=SuperMap.Exponent.EXP1]
  28875. * @description 【泛克吕金】类型下,用于插值的样点数据中趋势面方程的阶数。
  28876. */
  28877. _this.exponent = Exponent.EXP1;
  28878. /**
  28879. * @member {SuperMap.SearchMode} SuperMap.InterpolationKrigingAnalystParameters.prototype.searchMode
  28880. * @description 插值运算时,查找参与运算点的方式,有固定点数查找、定长查找、块查找。必设参数。
  28881. * 简单克吕金和泛克吕金不支持块查找。
  28882. * 具体如下:<br>
  28883. * {KDTREE_FIXED_COUNT} 使用 KDTREE 的固定点数方式查找参与内插分析的点。<br>
  28884. * {KDTREE_FIXED_RADIUS} 使用 KDTREE 的定长方式查找参与内插分析的点。<br>
  28885. * {QUADTREE} 使用 QUADTREE 方式查找参与内插分析的点(块查找)。
  28886. */
  28887. _this.searchMode = null;
  28888. /**
  28889. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.expectedCount=12]
  28890. * @description 【固定点数查找】方式下,设置待查找的点数,即参与差值运算的点数,默认值为12。
  28891. * 【定长查找】方式下,设置查找的最小点数,默认值为12。
  28892. */
  28893. _this.expectedCount = 12;
  28894. /**
  28895. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=200]
  28896. * @description 【块查找】方式下,最多参与插值的点数。
  28897. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  28898. */
  28899. _this.maxPointCountForInterpolation = 200;
  28900. /**
  28901. * @member {number} [SuperMap.InterpolationKrigingAnalystParameters.prototype.maxPointCountForInterpolation=50]
  28902. * @description 【块查找】方式下,设置单个块内最多参与运算点数。
  28903. * 仅用于普通克吕金插值,简单克吕金和泛克吕金不支持块查找。
  28904. */
  28905. _this.maxPointCountInNode = 50;
  28906. if (options) {
  28907. Util.extend(InterpolationKrigingAnalystParameters_assertThisInitialized(_this), options);
  28908. }
  28909. _this.CLASS_NAME = "SuperMap.InterpolationKrigingAnalystParameters";
  28910. return _this;
  28911. }
  28912. /**
  28913. * @function SuperMap.InterpolationKrigingAnalystParameters.prototype.destroy
  28914. * @description 释放资源,将引用资源的属性置空。
  28915. */
  28916. InterpolationKrigingAnalystParameters_createClass(InterpolationKrigingAnalystParameters, [{
  28917. key: "destroy",
  28918. value: function destroy() {
  28919. InterpolationKrigingAnalystParameters_get(InterpolationKrigingAnalystParameters_getPrototypeOf(InterpolationKrigingAnalystParameters.prototype), "destroy", this).call(this);
  28920. var me = this;
  28921. me.type = null;
  28922. me.mean = null;
  28923. me.angle = null;
  28924. me.nugget = null;
  28925. me.range = null;
  28926. me.sill = null;
  28927. me.variogramMode = null;
  28928. me.exponent = null;
  28929. me.searchMode = null;
  28930. me.expectedCount = null;
  28931. me.maxPointCountForInterpolation = null;
  28932. me.maxPointCountInNode = null;
  28933. }
  28934. }]);
  28935. return InterpolationKrigingAnalystParameters;
  28936. }(InterpolationAnalystParameters);
  28937. SuperMap.InterpolationKrigingAnalystParameters = InterpolationKrigingAnalystParameters;
  28938. ;// CONCATENATED MODULE: ./src/common/iServer/InterpolationAnalystService.js
  28939. function InterpolationAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { InterpolationAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { InterpolationAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return InterpolationAnalystService_typeof(obj); }
  28940. function InterpolationAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  28941. 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); } }
  28942. function InterpolationAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) InterpolationAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) InterpolationAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  28943. function InterpolationAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { InterpolationAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return InterpolationAnalystService_get(target, property, receiver || target); }
  28944. function InterpolationAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = InterpolationAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  28945. 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 } }); if (superClass) InterpolationAnalystService_setPrototypeOf(subClass, superClass); }
  28946. function InterpolationAnalystService_setPrototypeOf(o, p) { InterpolationAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return InterpolationAnalystService_setPrototypeOf(o, p); }
  28947. 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); }; }
  28948. function InterpolationAnalystService_possibleConstructorReturn(self, call) { if (call && (InterpolationAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return InterpolationAnalystService_assertThisInitialized(self); }
  28949. function InterpolationAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  28950. function InterpolationAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  28951. function InterpolationAnalystService_getPrototypeOf(o) { InterpolationAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return InterpolationAnalystService_getPrototypeOf(o); }
  28952. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  28953. * This program are made available under the terms of the Apache License, Version 2.0
  28954. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  28955. /**
  28956. * @class SuperMap.InterpolationAnalystService
  28957. * @category iServer SpatialAnalyst InterpolationAnalyst
  28958. * @classdesc 插值分析服务类。
  28959. * 插值分析可以将有限的采样点数据,通过插值算法对采样点周围的数值情况进行预测,可以掌握研究区域内数据的总体分布状况,从而使采样的离散点不仅仅反映其所在位置的数值情况,
  28960. * 还可以反映区域的数值分布。目前SuperMap iServer的插值功能提供从点数据集插值得到栅格数据集的功能,支持以下常用的内插方法,
  28961. * 包括:反距离加权插值、克吕金(Kriging)插值法、样条(径向基函数,Radial Basis Function)插值、点密度插值。
  28962. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  28963. * @param {Object} options - 参数。</br>
  28964. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  28965. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  28966. * @param {Object} [options.headers] - 请求头。
  28967. * @extends {SuperMap.SpatialAnalystBase}
  28968. * @example 例如:
  28969. * (start code)
  28970. * var myTInterpolationAnalystService = new SuperMap.InterpolationAnalystService(url);
  28971. * myTInterpolationAnalystService.events.on({
  28972. * "processCompleted": processCompleted,
  28973. * "processFailed": processFailed
  28974. * }
  28975. * );
  28976. * (end)
  28977. *
  28978. */
  28979. var InterpolationAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  28980. InterpolationAnalystService_inherits(InterpolationAnalystService, _SpatialAnalystBase);
  28981. var _super = InterpolationAnalystService_createSuper(InterpolationAnalystService);
  28982. function InterpolationAnalystService(url, options) {
  28983. var _this;
  28984. InterpolationAnalystService_classCallCheck(this, InterpolationAnalystService);
  28985. _this = _super.call(this, url, options);
  28986. /**
  28987. * @member {string} SuperMap.InterpolationAnalystService.prototype.mode
  28988. * @description 插值分析类型。
  28989. */
  28990. _this.mode = null;
  28991. if (options) {
  28992. Util.extend(InterpolationAnalystService_assertThisInitialized(_this), options);
  28993. }
  28994. return _this;
  28995. }
  28996. /**
  28997. * @function SuperMap.InterpolationAnalystService.prototype.destroy
  28998. * @description 释放资源,将引用资源的属性置空。
  28999. */
  29000. InterpolationAnalystService_createClass(InterpolationAnalystService, [{
  29001. key: "destroy",
  29002. value: function destroy() {
  29003. InterpolationAnalystService_get(InterpolationAnalystService_getPrototypeOf(InterpolationAnalystService.prototype), "destroy", this).call(this);
  29004. this.mode = null;
  29005. this.CLASS_NAME = "SuperMap.InterpolationAnalystService";
  29006. }
  29007. /**
  29008. * @function SuperMap.InterpolationAnalystService.prototype.processAsync
  29009. * @description 负责将客户端的查询参数传递到服务端。
  29010. * @param {SuperMap.InterpolationAnalystParameters} parameter - 插值分析参数类。
  29011. */
  29012. }, {
  29013. key: "processAsync",
  29014. value: function processAsync(parameter) {
  29015. var parameterObject = {};
  29016. var me = this;
  29017. if (parameter instanceof InterpolationDensityAnalystParameters) {
  29018. me.mode = 'Density';
  29019. if (parameter.InterpolationAnalystType === 'geometry') {
  29020. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/density');
  29021. } else {
  29022. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/density');
  29023. }
  29024. } else if (parameter instanceof InterpolationIDWAnalystParameters) {
  29025. me.mode = 'IDW';
  29026. if (parameter.InterpolationAnalystType === 'geometry') {
  29027. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/idw');
  29028. } else {
  29029. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/idw');
  29030. }
  29031. } else if (parameter instanceof InterpolationRBFAnalystParameters) {
  29032. me.mode = 'RBF';
  29033. if (parameter.InterpolationAnalystType === 'geometry') {
  29034. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/rbf');
  29035. } else {
  29036. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/rbf');
  29037. }
  29038. } else if (parameter instanceof InterpolationKrigingAnalystParameters) {
  29039. me.mode = 'Kriging';
  29040. if (parameter.InterpolationAnalystType === 'geometry') {
  29041. me.url = Util.urlPathAppend(me.url, 'geometry/interpolation/kriging');
  29042. } else {
  29043. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/interpolation/kriging');
  29044. }
  29045. }
  29046. InterpolationAnalystParameters.toObject(parameter, parameterObject);
  29047. var jsonParameters = Util.toJSON(parameterObject);
  29048. me.url = Util.urlAppend(me.url, 'returnContent=true');
  29049. me.request({
  29050. method: "POST",
  29051. data: jsonParameters,
  29052. scope: me,
  29053. success: me.serviceProcessCompleted,
  29054. failure: me.serviceProcessFailed
  29055. });
  29056. }
  29057. }]);
  29058. return InterpolationAnalystService;
  29059. }(SpatialAnalystBase);
  29060. SuperMap.InterpolationAnalystService = InterpolationAnalystService;
  29061. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobParameter.js
  29062. function KernelDensityJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29063. 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); } }
  29064. function KernelDensityJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  29065. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29066. * This program are made available under the terms of the Apache License, Version 2.0
  29067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29068. /**
  29069. * @class SuperMap.KernelDensityJobParameter
  29070. * @category iServer ProcessingService DensityAnalyst
  29071. * @classdesc 密度分析任务参数类。
  29072. * @param {Object} options - 参数。
  29073. * @param {string} options.datasetName - 数据集名。
  29074. * @param {string} options.fields - 权重索引。
  29075. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  29076. * @param {number} [options.resolution=80] - 分辨率。
  29077. * @param {number} [options.method=0] - 分析方法。
  29078. * @param {number} [options.meshType=0] - 分析类型。
  29079. * @param {number} [options.radius=300] - 分析的影响半径。
  29080. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  29081. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  29082. */
  29083. var KernelDensityJobParameter = /*#__PURE__*/function () {
  29084. function KernelDensityJobParameter(options) {
  29085. KernelDensityJobParameter_classCallCheck(this, KernelDensityJobParameter);
  29086. if (!options) {
  29087. return;
  29088. }
  29089. /**
  29090. * @member {string} SuperMap.KernelDensityJobParameter.prototype.datasetName
  29091. * @description 数据集名。
  29092. */
  29093. this.datasetName = "";
  29094. /**
  29095. * @member {SuperMap.Bounds|L.Bounds|ol.extent} [SuperMap.KernelDensityJobParameter.prototype.query]
  29096. * @description 分析范围。
  29097. */
  29098. this.query = "";
  29099. /**
  29100. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.resolution=80]
  29101. * @description 网格大小。
  29102. */
  29103. this.resolution = 80;
  29104. /**
  29105. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.method=0]
  29106. * @description 分析方法。
  29107. */
  29108. this.method = 0;
  29109. /**
  29110. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.meshType=0]
  29111. * @description 分析类型。
  29112. */
  29113. this.meshType = 0;
  29114. /**
  29115. * @member {string} SuperMap.KernelDensityJobParameter.prototype.fields
  29116. * @description 权重索引。
  29117. */
  29118. this.fields = "";
  29119. /**
  29120. * @member {number} [SuperMap.KernelDensityJobParameter.prototype.radius=300]
  29121. * @description 分析的影响半径。
  29122. */
  29123. this.radius = 300;
  29124. /**
  29125. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  29126. * @description 网格大小单位。
  29127. */
  29128. this.meshSizeUnit = AnalystSizeUnit.METER;
  29129. /**
  29130. * @member {SuperMap.AnalystSizeUnit} [SuperMap.KernelDensityJobParameter.prototype.radiusUnit=SuperMap.AnalystSizeUnit.METER]
  29131. * @description 搜索半径单位。
  29132. */
  29133. this.radiusUnit = AnalystSizeUnit.METER;
  29134. /**
  29135. * @member {SuperMap.AnalystAreaUnit} [SuperMap.KernelDensityJobParameter.prototype.areaUnit=SuperMap.AnalystAreaUnit.SQUAREMILE]
  29136. * @description 面积单位。
  29137. */
  29138. this.areaUnit = AnalystAreaUnit.SQUAREMILE;
  29139. /**
  29140. * @member {SuperMap.OutputSetting} SuperMap.KernelDensityJobParameter.prototype.output
  29141. * @description 输出参数设置类
  29142. */
  29143. this.output = null;
  29144. /**
  29145. * @member {SuperMap.MappingParameters} [SuperMap.KernelDensityJobParameter.prototype.mappingParameters]
  29146. * @description 分析后结果可视化的参数类。
  29147. */
  29148. this.mappingParameters = null;
  29149. Util.extend(this, options);
  29150. this.CLASS_NAME = "SuperMap.KernelDensityJobParameter";
  29151. }
  29152. /**
  29153. * @function SuperMap.KernelDensityJobParameter.prototype.destroy
  29154. * @description 释放资源,将引用资源的属性置空。
  29155. */
  29156. KernelDensityJobParameter_createClass(KernelDensityJobParameter, [{
  29157. key: "destroy",
  29158. value: function destroy() {
  29159. this.datasetName = null;
  29160. this.query = null;
  29161. this.resolution = null;
  29162. this.method = null;
  29163. this.radius = null;
  29164. this.meshType = null;
  29165. this.fields = null;
  29166. this.meshSizeUnit = null;
  29167. this.radiusUnit = null;
  29168. this.areaUnit = null;
  29169. if (this.output instanceof OutputSetting) {
  29170. this.output.destroy();
  29171. this.output = null;
  29172. }
  29173. if (this.mappingParameters instanceof MappingParameters) {
  29174. this.mappingParameters.destroy();
  29175. this.mappingParameters = null;
  29176. }
  29177. }
  29178. /**
  29179. * @function SuperMap.KernelDensityJobParameter.toObject
  29180. * @param {SuperMap.KernelDensityJobParameter} kernelDensityJobParameter - 密度分析任务参数类。
  29181. * @param {SuperMap.KernelDensityJobParameter} tempObj - 密度分析任务参数对象。
  29182. * @description 将密度分析任务参数对象转换为 JSON 对象。
  29183. * @returns JSON 对象。
  29184. */
  29185. }], [{
  29186. key: "toObject",
  29187. value: function toObject(kernelDensityJobParameter, tempObj) {
  29188. for (var name in kernelDensityJobParameter) {
  29189. if (name === "datasetName") {
  29190. tempObj['input'] = tempObj['input'] || {};
  29191. tempObj['input'][name] = kernelDensityJobParameter[name];
  29192. continue;
  29193. }
  29194. if (name === "output") {
  29195. tempObj['output'] = tempObj['output'] || {};
  29196. tempObj['output'] = kernelDensityJobParameter[name];
  29197. continue;
  29198. }
  29199. tempObj['analyst'] = tempObj['analyst'] || {};
  29200. if (name === 'query' && kernelDensityJobParameter[name]) {
  29201. tempObj['analyst'][name] = kernelDensityJobParameter[name].toBBOX();
  29202. } else {
  29203. tempObj['analyst'][name] = kernelDensityJobParameter[name];
  29204. }
  29205. if (name === 'mappingParameters') {
  29206. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  29207. tempObj['analyst']['mappingParameters'] = kernelDensityJobParameter[name];
  29208. }
  29209. }
  29210. }
  29211. }]);
  29212. return KernelDensityJobParameter;
  29213. }();
  29214. SuperMap.KernelDensityJobParameter = KernelDensityJobParameter;
  29215. ;// CONCATENATED MODULE: ./src/common/iServer/KernelDensityJobsService.js
  29216. function KernelDensityJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { KernelDensityJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { KernelDensityJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return KernelDensityJobsService_typeof(obj); }
  29217. function KernelDensityJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29218. 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); } }
  29219. function KernelDensityJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) KernelDensityJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) KernelDensityJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  29220. function KernelDensityJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { KernelDensityJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return KernelDensityJobsService_get(target, property, receiver || target); }
  29221. function KernelDensityJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = KernelDensityJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  29222. 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 } }); if (superClass) KernelDensityJobsService_setPrototypeOf(subClass, superClass); }
  29223. function KernelDensityJobsService_setPrototypeOf(o, p) { KernelDensityJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return KernelDensityJobsService_setPrototypeOf(o, p); }
  29224. 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); }; }
  29225. function KernelDensityJobsService_possibleConstructorReturn(self, call) { if (call && (KernelDensityJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return KernelDensityJobsService_assertThisInitialized(self); }
  29226. function KernelDensityJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29227. function KernelDensityJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29228. function KernelDensityJobsService_getPrototypeOf(o) { KernelDensityJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return KernelDensityJobsService_getPrototypeOf(o); }
  29229. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29230. * This program are made available under the terms of the Apache License, Version 2.0
  29231. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29232. /**
  29233. * @class SuperMap.KernelDensityJobsService
  29234. * @category iServer ProcessingService DensityAnalyst
  29235. * @classdesc 核密度分析服务类
  29236. * @extends {SuperMap.ProcessingServiceBase}
  29237. * @param {string} url -核密度分析服务地址。
  29238. * @param {Object} options - 交互服务时所需可选参数。
  29239. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29240. * @param {Object} [options.headers] - 请求头。
  29241. */
  29242. var KernelDensityJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  29243. KernelDensityJobsService_inherits(KernelDensityJobsService, _ProcessingServiceBas);
  29244. var _super = KernelDensityJobsService_createSuper(KernelDensityJobsService);
  29245. function KernelDensityJobsService(url, options) {
  29246. var _this;
  29247. KernelDensityJobsService_classCallCheck(this, KernelDensityJobsService);
  29248. _this = _super.call(this, url, options);
  29249. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/density');
  29250. _this.CLASS_NAME = "SuperMap.KernelDensityJobsService";
  29251. return _this;
  29252. }
  29253. /**
  29254. * @function SuperMap.KernelDensityJobsService.prototype.destroy
  29255. * @override
  29256. */
  29257. KernelDensityJobsService_createClass(KernelDensityJobsService, [{
  29258. key: "destroy",
  29259. value: function destroy() {
  29260. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "destroy", this).call(this);
  29261. }
  29262. /**
  29263. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  29264. * @description 获取核密度分析任务
  29265. */
  29266. }, {
  29267. key: "getKernelDensityJobs",
  29268. value: function getKernelDensityJobs() {
  29269. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, this.url);
  29270. }
  29271. /**
  29272. * @function SuperMap.KernelDensityJobsService.prototype.getKernelDensityJobs
  29273. * @description 获取指定id的核密度分析服务
  29274. * @param {string} id - 指定要获取数据的id
  29275. */
  29276. }, {
  29277. key: "getKernelDensityJob",
  29278. value: function getKernelDensityJob(id) {
  29279. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  29280. }
  29281. /**
  29282. * @function SuperMap.KernelDensityJobsService.prototype.addKernelDensityJob
  29283. * @description 新建核密度分析服务
  29284. * @param {SuperMap.KernelDensityJobParameter} params - 创建一个空间分析的请求参数。
  29285. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  29286. */
  29287. }, {
  29288. key: "addKernelDensityJob",
  29289. value: function addKernelDensityJob(params, seconds) {
  29290. KernelDensityJobsService_get(KernelDensityJobsService_getPrototypeOf(KernelDensityJobsService.prototype), "addJob", this).call(this, this.url, params, KernelDensityJobParameter, seconds);
  29291. }
  29292. }]);
  29293. return KernelDensityJobsService;
  29294. }(ProcessingServiceBase);
  29295. SuperMap.KernelDensityJobsService = KernelDensityJobsService;
  29296. ;// CONCATENATED MODULE: ./src/common/iServer/LabelMatrixCell.js
  29297. function LabelMatrixCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29298. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29299. * This program are made available under the terms of the Apache License, Version 2.0
  29300. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29301. /**
  29302. * @class SuperMap.LabelMatrixCell
  29303. * @category iServer Map Theme
  29304. * @classdesc 矩阵标签元素抽象类。
  29305. * @description 该类可以包含 n*n 个矩阵标签元素,矩阵标签元素的类型可以是图片,符号,标签专题图等。
  29306. * 符号类型的矩阵标签元素类、图片类型的矩阵标签元素类和专题图类型的矩阵标签元素类均继承自该类。
  29307. */
  29308. var LabelMatrixCell = function LabelMatrixCell() {
  29309. LabelMatrixCell_classCallCheck(this, LabelMatrixCell);
  29310. this.CLASS_NAME = "LabelMatrixCell";
  29311. };
  29312. SuperMap.LabelMatrixCell = LabelMatrixCell;
  29313. ;// CONCATENATED MODULE: ./src/common/iServer/LabelImageCell.js
  29314. function LabelImageCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelImageCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelImageCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelImageCell_typeof(obj); }
  29315. function LabelImageCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29316. 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); } }
  29317. function LabelImageCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelImageCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelImageCell_defineProperties(Constructor, staticProps); return Constructor; }
  29318. 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 } }); if (superClass) LabelImageCell_setPrototypeOf(subClass, superClass); }
  29319. function LabelImageCell_setPrototypeOf(o, p) { LabelImageCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelImageCell_setPrototypeOf(o, p); }
  29320. 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); }; }
  29321. function LabelImageCell_possibleConstructorReturn(self, call) { if (call && (LabelImageCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelImageCell_assertThisInitialized(self); }
  29322. function LabelImageCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29323. function LabelImageCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29324. function LabelImageCell_getPrototypeOf(o) { LabelImageCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelImageCell_getPrototypeOf(o); }
  29325. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29326. * This program are made available under the terms of the Apache License, Version 2.0
  29327. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29328. /**
  29329. * @class SuperMap.LabelImageCell
  29330. * @category iServer Map Theme
  29331. * @classdesc 图片类型的矩阵标签元素类。
  29332. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  29333. * 矩阵标签专题图是标签专题图(ThemeLabel)的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  29334. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  29335. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  29336. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 是一个二维数组,
  29337. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  29338. * @extends {SuperMap.LabelMatrixCell}
  29339. * @param {Object} options - 参数。
  29340. * @param {number} [options.height=0] - 设置图片的高度,单位为毫米。
  29341. * @param {string} [options.pathField] - 设置矩阵标签元素所使用图片的路径。
  29342. * @param {number} [options.rotation=0.0] - 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  29343. * @param {number} [options.width=0] - 设置图片的宽度,单位为毫米。
  29344. * @param {boolean} [options.sizeFixed=false] - 是否固定图片的大小。
  29345. */
  29346. var LabelImageCell = /*#__PURE__*/function (_LabelMatrixCell) {
  29347. LabelImageCell_inherits(LabelImageCell, _LabelMatrixCell);
  29348. var _super = LabelImageCell_createSuper(LabelImageCell);
  29349. function LabelImageCell(options) {
  29350. var _this;
  29351. LabelImageCell_classCallCheck(this, LabelImageCell);
  29352. _this = _super.call(this, options);
  29353. /**
  29354. * @member {number} SuperMap.LabelImageCell.prototype.height
  29355. * @description 设置图片的高度,单位为毫米。
  29356. */
  29357. _this.height = 0;
  29358. /**
  29359. * @member {string} SuperMap.LabelImageCell.prototype.pathField
  29360. * @description 设置矩阵标签元素所使用的图片路径对应的字段名。
  29361. */
  29362. _this.pathField = null;
  29363. /**
  29364. * @member {number} [SuperMap.LabelImageCell.prototype.rotation=0.0]
  29365. * @description 图片的旋转角度。逆时针方向为正方向,单位为度,精确到0.1度。
  29366. */
  29367. _this.rotation = 0.0;
  29368. /**
  29369. * @member {number} SuperMap.LabelImageCell.prototype.width
  29370. * @description 设置图片的宽度,单位为毫米。
  29371. */
  29372. _this.width = 0;
  29373. /**
  29374. * @member {boolean} [SuperMap.LabelImageCell.prototype.sizeFixed=false]
  29375. * @description 是否固定图片的大小。
  29376. */
  29377. _this.sizeFixed = false;
  29378. /**
  29379. * @member {string} SuperMap.LabelImageCell.prototype.type
  29380. * @description 制作矩阵专题图时是必须的。
  29381. */
  29382. _this.type = "IMAGE";
  29383. if (options) {
  29384. Util.extend(LabelImageCell_assertThisInitialized(_this), options);
  29385. }
  29386. _this.CLASS_NAME = "SuperMap.LabelImageCell";
  29387. return _this;
  29388. }
  29389. /**
  29390. * @function SuperMap.LabelImageCell.prototype.destroy
  29391. * @description 释放资源,将引用资源的属性置空。
  29392. */
  29393. LabelImageCell_createClass(LabelImageCell, [{
  29394. key: "destroy",
  29395. value: function destroy() {
  29396. var me = this;
  29397. me.height = null;
  29398. me.pathField = null;
  29399. me.rotation = null;
  29400. me.width = null;
  29401. me.sizeFixed = null;
  29402. }
  29403. }]);
  29404. return LabelImageCell;
  29405. }(LabelMatrixCell);
  29406. SuperMap.LabelImageCell = LabelImageCell;
  29407. ;// CONCATENATED MODULE: ./src/common/iServer/LabelSymbolCell.js
  29408. function LabelSymbolCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelSymbolCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelSymbolCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelSymbolCell_typeof(obj); }
  29409. function LabelSymbolCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29410. 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); } }
  29411. function LabelSymbolCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelSymbolCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelSymbolCell_defineProperties(Constructor, staticProps); return Constructor; }
  29412. 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 } }); if (superClass) LabelSymbolCell_setPrototypeOf(subClass, superClass); }
  29413. function LabelSymbolCell_setPrototypeOf(o, p) { LabelSymbolCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelSymbolCell_setPrototypeOf(o, p); }
  29414. 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); }; }
  29415. function LabelSymbolCell_possibleConstructorReturn(self, call) { if (call && (LabelSymbolCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelSymbolCell_assertThisInitialized(self); }
  29416. function LabelSymbolCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29417. function LabelSymbolCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29418. function LabelSymbolCell_getPrototypeOf(o) { LabelSymbolCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelSymbolCell_getPrototypeOf(o); }
  29419. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29420. * This program are made available under the terms of the Apache License, Version 2.0
  29421. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29422. /**
  29423. * @class SuperMap.LabelSymbolCell
  29424. * @category iServer Map Theme
  29425. * @classdesc 符号类型的矩阵标签元素类。
  29426. * @description 该类继承自 {@link SuperMap.LabelMatrixCell}类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  29427. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  29428. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  29429. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  29430. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  29431. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  29432. * @extends {SuperMap.LabelMatrixCell}
  29433. * @param {Object} options - 参数。
  29434. * @param {SuperMap.ServerStyle} options.style - 获取或设置符号样式。
  29435. * @param {string} options.symbolIDField - 符号 ID 或符号 ID 所对应的字段名称。
  29436. */
  29437. var LabelSymbolCell = /*#__PURE__*/function (_LabelMatrixCell) {
  29438. LabelSymbolCell_inherits(LabelSymbolCell, _LabelMatrixCell);
  29439. var _super = LabelSymbolCell_createSuper(LabelSymbolCell);
  29440. function LabelSymbolCell(options) {
  29441. var _this;
  29442. LabelSymbolCell_classCallCheck(this, LabelSymbolCell);
  29443. _this = _super.call(this, options);
  29444. /**
  29445. * @member {SuperMap.ServerStyle} SuperMap.LabelSymbolCell.prototype.style
  29446. * @description 获取或设置符号样式—— {@link SuperMap.ServerStyle} 对象,包括符号大小({@link SuperMap.ServerStyle.markerSize})
  29447. * 和符号旋转({@link SuperMap.ServerStyle.markerAngle})角度,其中用于设置符号 ID 的属性({@link SuperMap.ServerStyle.markerSymbolID})在此处不起作用。
  29448. */
  29449. _this.style = new ServerStyle();
  29450. /**
  29451. * @member {string} SuperMap.LabelSymbolCell.prototype.symbolIDField
  29452. * @description 获取或设置符号 ID 或符号 ID 所对应的字段名称。
  29453. */
  29454. _this.symbolIDField = null;
  29455. /**
  29456. * @member {string} SuperMap.LabelSymbolCell.prototype.type
  29457. * @description 制作矩阵专题图时是必须的。
  29458. */
  29459. _this.type = "SYMBOL";
  29460. if (options) {
  29461. Util.extend(LabelSymbolCell_assertThisInitialized(_this), options);
  29462. }
  29463. _this.CLASS_NAME = "SuperMap.LabelSymbolCell";
  29464. return _this;
  29465. }
  29466. /**
  29467. * @function SuperMap.LabelSymbolCell.prototype.destroy
  29468. * @description 释放资源,将引用资源的属性置空。
  29469. */
  29470. LabelSymbolCell_createClass(LabelSymbolCell, [{
  29471. key: "destroy",
  29472. value: function destroy() {
  29473. var me = this;
  29474. if (me.style) {
  29475. me.style.destroy();
  29476. me.style = null;
  29477. }
  29478. me.symbolIDField = null;
  29479. }
  29480. }]);
  29481. return LabelSymbolCell;
  29482. }(LabelMatrixCell);
  29483. SuperMap.LabelSymbolCell = LabelSymbolCell;
  29484. ;// CONCATENATED MODULE: ./src/common/iServer/LabelThemeCell.js
  29485. function LabelThemeCell_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelThemeCell_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelThemeCell_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelThemeCell_typeof(obj); }
  29486. function LabelThemeCell_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29487. 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); } }
  29488. function LabelThemeCell_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeCell_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeCell_defineProperties(Constructor, staticProps); return Constructor; }
  29489. 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 } }); if (superClass) LabelThemeCell_setPrototypeOf(subClass, superClass); }
  29490. function LabelThemeCell_setPrototypeOf(o, p) { LabelThemeCell_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeCell_setPrototypeOf(o, p); }
  29491. 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); }; }
  29492. function LabelThemeCell_possibleConstructorReturn(self, call) { if (call && (LabelThemeCell_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeCell_assertThisInitialized(self); }
  29493. function LabelThemeCell_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29494. function LabelThemeCell_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29495. function LabelThemeCell_getPrototypeOf(o) { LabelThemeCell_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeCell_getPrototypeOf(o); }
  29496. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29497. * This program are made available under the terms of the Apache License, Version 2.0
  29498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29499. /**
  29500. * @class SuperMap.LabelThemeCell
  29501. * @category iServer Map Theme
  29502. * @classdesc 专题图类型的矩阵标签元素类。
  29503. * @description 该类继承自 {@link SuperMap.LabelMatrixCell} 类,主要对矩阵标签中的专题图类型的矩阵标签元素进行设置。
  29504. * 矩阵标签专题图是标签专题图({@link SuperMap.ThemeLabel})的一种,其中矩阵标签中的填充元素又可分为图片类型({@link SuperMap.LabelImageCell})、
  29505. * 符号类型({@link SuperMap.LabelSymbolCell})、专题图类型({@link SuperMap.LabelThemeCell})三种,该类是这三种类型的矩阵标签元素其中的一种,
  29506. * 用于定义符号类型的矩阵标签,如符号 ID 字段名称(符号 ID 与 SuperMap 桌面产品中点、线、面符号的 ID 对应) 、大小等。
  29507. * 用户在实现矩阵标签专题图时只需将定义好的矩阵标签元素赋值予 {@link SuperMap.ThemeLabel.matrixCells} 属性即可。matrixCells 属是一个二维数组,
  29508. * 每一维可以是任意类型的矩阵标签元素组成的数组(也可是单个标签元素组成的数组,即数组中只有一个元素)。
  29509. * @extends {SuperMap.LabelMatrixCell}
  29510. * @param {Object} options -参数。
  29511. * @param {SuperMap.ThemeLabel} options.themeLabel - 使用专题图对象作为矩阵标签的一个元素。
  29512. */
  29513. var LabelThemeCell = /*#__PURE__*/function (_LabelMatrixCell) {
  29514. LabelThemeCell_inherits(LabelThemeCell, _LabelMatrixCell);
  29515. var _super = LabelThemeCell_createSuper(LabelThemeCell);
  29516. function LabelThemeCell(options) {
  29517. var _this;
  29518. LabelThemeCell_classCallCheck(this, LabelThemeCell);
  29519. _this = _super.call(this, options);
  29520. /**
  29521. * @member {SuperMap.ThemeLabel} SuperMap.LabelThemeCell.prototype.themeLabel
  29522. * @description 使用专题图对象作为矩阵标签的一个元素。
  29523. */
  29524. _this.themeLabel = new ThemeLabel();
  29525. /**
  29526. * @member {string} SuperMap.LabelThemeCell.prototype.type
  29527. * @description 制作矩阵专题图时是必须的。
  29528. */
  29529. _this.type = "THEME";
  29530. if (options) {
  29531. Util.extend(LabelThemeCell_assertThisInitialized(_this), options);
  29532. }
  29533. _this.CLASS_NAME = " SuperMap.LabelThemeCell";
  29534. return _this;
  29535. }
  29536. /**
  29537. * @function SuperMap.LabelThemeCell.prototype.destroy
  29538. * @description 释放资源,将引用资源的属性置空。
  29539. */
  29540. LabelThemeCell_createClass(LabelThemeCell, [{
  29541. key: "destroy",
  29542. value: function destroy() {
  29543. var me = this;
  29544. if (me.themeLabel) {
  29545. me.themeLabel.destroy();
  29546. me.themeLabel = null;
  29547. }
  29548. }
  29549. }]);
  29550. return LabelThemeCell;
  29551. }(LabelMatrixCell);
  29552. SuperMap.LabelThemeCell = LabelThemeCell;
  29553. ;// CONCATENATED MODULE: ./src/common/iServer/LayerStatus.js
  29554. function LayerStatus_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29555. 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); } }
  29556. function LayerStatus_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerStatus_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerStatus_defineProperties(Constructor, staticProps); return Constructor; }
  29557. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29558. * This program are made available under the terms of the Apache License, Version 2.0
  29559. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29560. /**
  29561. * @class SuperMap.LayerStatus
  29562. * @category iServer Map Theme
  29563. * @classdesc 子图层显示参数类。
  29564. * @description 该类存储了各个子图层的名字和是否可见的状态。
  29565. * @param {Object} options - 参数。
  29566. * @param {string} options.layerName - 获取或设置图层名称。
  29567. * @param {boolean} [options.isVisible=true] - 获取或设置图层是否可见,true 表示可见。
  29568. * @param {string} [options.displayFilter] - 图层显示 SQL 过滤条件。
  29569. */
  29570. var LayerStatus = /*#__PURE__*/function () {
  29571. function LayerStatus(options) {
  29572. LayerStatus_classCallCheck(this, LayerStatus);
  29573. /**
  29574. * @member {string} SuperMap.LayerStatus.prototype.layerName
  29575. * @description 获取或设置图层名称。
  29576. */
  29577. this.layerName = null;
  29578. /**
  29579. * @member {boolean} SuperMap.LayerStatus.prototype.isVisible
  29580. * @description 获取或设置图层是否可见,true 表示可见。
  29581. */
  29582. this.isVisible = null;
  29583. /**
  29584. * @member {string} [SuperMap.LayerStatus.prototype.displayFilter]
  29585. * @description 图层显示 SQL 过滤条件,如 layerStatus.displayFilter = "smid < 10",表示仅显示 smid 值小于 10 的对象。
  29586. */
  29587. this.displayFilter = null;
  29588. /**
  29589. * @member {Object} [SuperMap.LayerStatus.prototype.fieldValuesDisplayFilter]
  29590. * @property {Array.<number>} values - 要过滤的值。
  29591. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  29592. * @property {string} fieldValuesDisplayMode - 目前有两个 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  29593. */
  29594. this.fieldValuesDisplayFilter = null;
  29595. if (options) {
  29596. Util.extend(this, options);
  29597. }
  29598. this.CLASS_NAME = "SuperMap.LayerStatus";
  29599. }
  29600. /**
  29601. * @function SuperMap.LayerStatus.prototype.destroy
  29602. * @description 释放资源,将引用资源的属性置空。
  29603. */
  29604. LayerStatus_createClass(LayerStatus, [{
  29605. key: "destroy",
  29606. value: function destroy() {
  29607. var me = this;
  29608. me.layerName = null;
  29609. me.isVisible = null;
  29610. me.displayFilter = null;
  29611. }
  29612. /**
  29613. * @function SuperMap.LayerStatus.prototype.toJSON
  29614. * @description 生成对应的 JSON。
  29615. * @returns {Object} 对应的 JSON。
  29616. */
  29617. }, {
  29618. key: "toJSON",
  29619. value: function toJSON() {
  29620. var json = '{';
  29621. json += '"type":"UGC",';
  29622. var v = [];
  29623. if (this.layerName) {
  29624. v.push('"name":"' + this.layerName + '"');
  29625. v.push('"visible":' + this.isVisible);
  29626. }
  29627. if (this.displayFilter) {
  29628. v.push('"displayFilter":"' + this.displayFilter + '"');
  29629. }
  29630. if (this.minScale || this.minScale == 0) {
  29631. v.push('"minScale":' + this.minScale);
  29632. }
  29633. if (this.maxScale || this.maxScale == 0) {
  29634. v.push('"maxScale":' + this.maxScale);
  29635. }
  29636. if (this.fieldValuesDisplayFilter) {
  29637. v.push('"fieldValuesDisplayFilter":' + Util.toJSON(this.fieldValuesDisplayFilter));
  29638. }
  29639. json += v;
  29640. json += '}';
  29641. return json;
  29642. }
  29643. }]);
  29644. return LayerStatus;
  29645. }();
  29646. SuperMap.LayerStatus = LayerStatus;
  29647. ;// CONCATENATED MODULE: ./src/common/iServer/MapService.js
  29648. function MapService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapService_typeof = function _typeof(obj) { return typeof obj; }; } else { MapService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapService_typeof(obj); }
  29649. function MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29650. 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); } }
  29651. function MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapService_defineProperties(Constructor, staticProps); return Constructor; }
  29652. function MapService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return MapService_get(target, property, receiver || target); }
  29653. function MapService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapService_getPrototypeOf(object); if (object === null) break; } return object; }
  29654. 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 } }); if (superClass) MapService_setPrototypeOf(subClass, superClass); }
  29655. function MapService_setPrototypeOf(o, p) { MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapService_setPrototypeOf(o, p); }
  29656. 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); }; }
  29657. function MapService_possibleConstructorReturn(self, call) { if (call && (MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return MapService_assertThisInitialized(self); }
  29658. function MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29659. function MapService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29660. function MapService_getPrototypeOf(o) { MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapService_getPrototypeOf(o); }
  29661. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29662. * This program are made available under the terms of the Apache License, Version 2.0
  29663. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29664. /**
  29665. * @class SuperMap.MapService
  29666. * @category iServer Map
  29667. * @classdesc 地图信息服务类。
  29668. * @extends {SuperMap.CommonServiceBase}
  29669. * @example
  29670. * var myMapService = new SuperMap.MapService(url, {
  29671. * eventListeners:{
  29672. * "processCompleted": MapServiceCompleted,
  29673. * "processFailed": MapServiceFailed
  29674. * }
  29675. * });
  29676. *
  29677. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  29678. * @param {Object} options - 参数。
  29679. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  29680. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  29681. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  29682. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29683. * @param {Object} [options.headers] - 请求头。
  29684. */
  29685. var MapService_MapService = /*#__PURE__*/function (_CommonServiceBase) {
  29686. MapService_inherits(MapService, _CommonServiceBase);
  29687. var _super = MapService_createSuper(MapService);
  29688. function MapService(url, options) {
  29689. var _this;
  29690. MapService_classCallCheck(this, MapService);
  29691. _this = _super.call(this, url, options);
  29692. /**
  29693. * @member {string} SuperMap.MapService.prototype.projection
  29694. * @description 根据投影参数获取地图状态信息。如"EPSG:4326"
  29695. */
  29696. _this.projection = null;
  29697. _this.CLASS_NAME = "SuperMap.MapService";
  29698. if (options) {
  29699. Util.extend(MapService_assertThisInitialized(_this), options);
  29700. }
  29701. var me = MapService_assertThisInitialized(_this);
  29702. if (me.projection) {
  29703. var arr = me.projection.split(":");
  29704. if (arr instanceof Array) {
  29705. if (arr.length === 2) {
  29706. me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[1], "\"}"))));
  29707. }
  29708. if (arr.length === 1) {
  29709. me.url = Util.urlAppend(me.url, "prjCoordSys=".concat(encodeURIComponent("{\"epsgCode\":\"".concat(arr[0], "\"}"))));
  29710. }
  29711. }
  29712. }
  29713. return _this;
  29714. }
  29715. /**
  29716. * @function destroy
  29717. * @description 释放资源,将引用的资源属性置空。
  29718. */
  29719. MapService_createClass(MapService, [{
  29720. key: "destroy",
  29721. value: function destroy() {
  29722. MapService_get(MapService_getPrototypeOf(MapService.prototype), "destroy", this).call(this);
  29723. var me = this;
  29724. if (me.events) {
  29725. me.events.un(me.eventListeners);
  29726. me.events.listeners = null;
  29727. me.events.destroy();
  29728. me.events = null;
  29729. me.eventListeners = null;
  29730. }
  29731. }
  29732. /**
  29733. * @function SuperMap.MapService.prototype.processAsync
  29734. * @description 负责将客户端的设置的参数传递到服务端,与服务端完成异步通讯。
  29735. */
  29736. }, {
  29737. key: "processAsync",
  29738. value: function processAsync() {
  29739. var me = this;
  29740. me.request({
  29741. method: "GET",
  29742. scope: me,
  29743. success: me.serviceProcessCompleted,
  29744. failure: me.serviceProcessFailed
  29745. });
  29746. }
  29747. /*
  29748. * Method: getMapStatusCompleted
  29749. * 获取地图状态完成,执行此方法。
  29750. *
  29751. * Parameters:
  29752. * {Object} result - 服务器返回的结果对象。
  29753. */
  29754. }, {
  29755. key: "serviceProcessCompleted",
  29756. value: function serviceProcessCompleted(result) {
  29757. var me = this;
  29758. result = Util.transformResult(result);
  29759. var codeStatus = result.code >= 200 && result.code < 300 || result.code == 0 || result.code === 304;
  29760. var isCodeValid = result.code && codeStatus;
  29761. if (!result.code || isCodeValid) {
  29762. me.events && me.events.triggerEvent("processCompleted", {
  29763. result: result
  29764. });
  29765. } else {
  29766. ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
  29767. me.events.triggerEvent("processFailed", {
  29768. error: result
  29769. });
  29770. }
  29771. }
  29772. }]);
  29773. return MapService;
  29774. }(CommonServiceBase);
  29775. SuperMap.MapService = MapService_MapService;
  29776. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisParameters.js
  29777. function MathExpressionAnalysisParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29778. 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); } }
  29779. function MathExpressionAnalysisParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29780. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29781. * This program are made available under the terms of the Apache License, Version 2.0
  29782. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29783. /**
  29784. * @class SuperMap.MathExpressionAnalysisParameters
  29785. * @category iServer SpatialAnalyst GridMathAnalyst
  29786. * @classdesc 栅格代数运算参数类。
  29787. * @param {Object} options - 参数。
  29788. * @param {string} options.dataset - 要用来做栅格代数运算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:BaseMap_P@Jingjin。
  29789. * @param {string} options.resultGridName - 指定结果数据集名称。
  29790. * @param {string} options.expression - 指定的栅格运算表达式。如:[DatasourceAlias1.Raster1]*2-10。
  29791. * @param {string} options.targetDatasource - 指定存储结果数据集的数据源。
  29792. * @param {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [options.extractRegion] - 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  29793. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  29794. * @param {boolean} [options.isZip=false] - 是否对结果数据集进行压缩处理。
  29795. * @param {boolean} [options.ignoreNoValue=false] - 是否忽略无值栅格数据。true 表示忽略无值数据,即无值栅格不参与运算。
  29796. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  29797. */
  29798. var MathExpressionAnalysisParameters = /*#__PURE__*/function () {
  29799. function MathExpressionAnalysisParameters(options) {
  29800. MathExpressionAnalysisParameters_classCallCheck(this, MathExpressionAnalysisParameters);
  29801. if (!options) {
  29802. return;
  29803. }
  29804. /**
  29805. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.dataset
  29806. * @description 要用来做栅格代数运算数据源中数据集的名称。
  29807. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  29808. *
  29809. */
  29810. this.dataset = null;
  29811. /**
  29812. * @member {(SuperMap.Geometry.Polygon|L.Polygon|ol.geom.Polygon)} [SuperMap.MathExpressionAnalysisParameters.prototype.extractRegion]
  29813. * @description 栅格代数运算的范围,指定数据集中参与栅格代数运算的区域。
  29814. * 如果缺省,则计算全部区域,如果参与运算的数据集范围不一致,将使用所有数据集的范围的交集作为计算区域 。
  29815. */
  29816. this.extractRegion = null;
  29817. /**
  29818. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.expression
  29819. * @description 指定的栅格运算表达式。如:"[DatasourceAlias1.Raster1]*2-10"。
  29820. */
  29821. this.expression = null;
  29822. /**
  29823. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.isZip=false]
  29824. * @description 是否对结果数据集进行压缩处理。
  29825. */
  29826. this.isZip = false;
  29827. /**
  29828. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.ignoreNoValue=false]
  29829. * @description 是否忽略无值栅格数据。
  29830. */
  29831. this.ignoreNoValue = false;
  29832. /**
  29833. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.targetDatasource
  29834. * @description 指定存储结果数据集的数据源。
  29835. */
  29836. this.targetDatasource = null;
  29837. /**
  29838. * @member {string} SuperMap.MathExpressionAnalysisParameters.prototype.resultGridName
  29839. * @description 指定结果数据集名称。
  29840. */
  29841. this.resultGridName = null;
  29842. /**
  29843. * @member {boolean} [SuperMap.MathExpressionAnalysisParameters.prototype.deleteExistResultDataset=false]
  29844. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  29845. */
  29846. this.deleteExistResultDataset = false;
  29847. Util.extend(this, options);
  29848. this.CLASS_NAME = "SuperMap.MathExpressionAnalysisParameters";
  29849. }
  29850. /**
  29851. * @function SuperMap.MathExpressionAnalysisParameters.prototype.destroy
  29852. * @description 释放资源,将引用资源的属性置空。
  29853. */
  29854. MathExpressionAnalysisParameters_createClass(MathExpressionAnalysisParameters, [{
  29855. key: "destroy",
  29856. value: function destroy() {
  29857. var me = this;
  29858. me.dataset = null;
  29859. me.bounds = null;
  29860. me.expression = null;
  29861. me.isZip = true;
  29862. me.ignoreNoValue = true;
  29863. me.targetDatasource = null;
  29864. me.resultGridName = null;
  29865. me.deleteExistResultDataset = null;
  29866. }
  29867. /**
  29868. * @function SuperMap.MathExpressionAnalysisParameters.toObject
  29869. * @param {Object} mathExpressionAnalysisParameters - 栅格代数运算参数。
  29870. * @param {Object} tempObj - 目标对象。
  29871. * @description 生成栅格代数运算对象。
  29872. */
  29873. }], [{
  29874. key: "toObject",
  29875. value: function toObject(mathExpressionAnalysisParameters, tempObj) {
  29876. for (var name in mathExpressionAnalysisParameters) {
  29877. if (name !== "dataset") {
  29878. tempObj[name] = mathExpressionAnalysisParameters[name];
  29879. }
  29880. if (name === "extractRegion") {
  29881. if (mathExpressionAnalysisParameters[name]) {
  29882. var bs = mathExpressionAnalysisParameters[name].components[0].components;
  29883. var region = {},
  29884. points = [],
  29885. type = "REGION";
  29886. var len = bs.length;
  29887. for (var i = 0; i < len - 1; i++) {
  29888. var poi = {};
  29889. poi["x"] = bs[i].x;
  29890. poi["y"] = bs[i].y;
  29891. points.push(poi);
  29892. }
  29893. region["points"] = points;
  29894. region["type"] = type;
  29895. tempObj[name] = region;
  29896. }
  29897. }
  29898. }
  29899. }
  29900. }]);
  29901. return MathExpressionAnalysisParameters;
  29902. }();
  29903. SuperMap.MathExpressionAnalysisParameters = MathExpressionAnalysisParameters;
  29904. ;// CONCATENATED MODULE: ./src/common/iServer/MathExpressionAnalysisService.js
  29905. function MathExpressionAnalysisService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MathExpressionAnalysisService_typeof = function _typeof(obj) { return typeof obj; }; } else { MathExpressionAnalysisService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MathExpressionAnalysisService_typeof(obj); }
  29906. function MathExpressionAnalysisService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29907. 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); } }
  29908. function MathExpressionAnalysisService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MathExpressionAnalysisService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MathExpressionAnalysisService_defineProperties(Constructor, staticProps); return Constructor; }
  29909. function MathExpressionAnalysisService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MathExpressionAnalysisService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return MathExpressionAnalysisService_get(target, property, receiver || target); }
  29910. function MathExpressionAnalysisService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MathExpressionAnalysisService_getPrototypeOf(object); if (object === null) break; } return object; }
  29911. 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 } }); if (superClass) MathExpressionAnalysisService_setPrototypeOf(subClass, superClass); }
  29912. function MathExpressionAnalysisService_setPrototypeOf(o, p) { MathExpressionAnalysisService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MathExpressionAnalysisService_setPrototypeOf(o, p); }
  29913. 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); }; }
  29914. function MathExpressionAnalysisService_possibleConstructorReturn(self, call) { if (call && (MathExpressionAnalysisService_typeof(call) === "object" || typeof call === "function")) { return call; } return MathExpressionAnalysisService_assertThisInitialized(self); }
  29915. function MathExpressionAnalysisService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  29916. function MathExpressionAnalysisService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  29917. function MathExpressionAnalysisService_getPrototypeOf(o) { MathExpressionAnalysisService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MathExpressionAnalysisService_getPrototypeOf(o); }
  29918. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29919. * This program are made available under the terms of the Apache License, Version 2.0
  29920. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29921. /**
  29922. * @class SuperMap.MathExpressionAnalysisService
  29923. * @category iServer SpatialAnalyst GridMathAnalyst
  29924. * @classdesc 栅格代数运算服务类。
  29925. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  29926. * @param {Object} options - 参数。</br>
  29927. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  29928. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  29929. * @param {Object} [options.headers] - 请求头。
  29930. * @extends {SuperMap.SpatialAnalystBase}
  29931. * @example 例如:
  29932. * (start code)
  29933. * var myMathExpressionAnalysisService = new SuperMap.MathExpressionAnalysisService(url);
  29934. * myMathExpressionAnalysisService.on({
  29935. * "processCompleted": processCompleted,
  29936. * "processFailed": processFailed
  29937. * }
  29938. * );
  29939. * (end)
  29940. *
  29941. */
  29942. var MathExpressionAnalysisService = /*#__PURE__*/function (_SpatialAnalystBase) {
  29943. MathExpressionAnalysisService_inherits(MathExpressionAnalysisService, _SpatialAnalystBase);
  29944. var _super = MathExpressionAnalysisService_createSuper(MathExpressionAnalysisService);
  29945. function MathExpressionAnalysisService(url, options) {
  29946. var _this;
  29947. MathExpressionAnalysisService_classCallCheck(this, MathExpressionAnalysisService);
  29948. _this = _super.call(this, url, options);
  29949. _this.CLASS_NAME = "SuperMap.MathExpressionAnalysisService";
  29950. return _this;
  29951. }
  29952. /**
  29953. * @override
  29954. */
  29955. MathExpressionAnalysisService_createClass(MathExpressionAnalysisService, [{
  29956. key: "destroy",
  29957. value: function destroy() {
  29958. MathExpressionAnalysisService_get(MathExpressionAnalysisService_getPrototypeOf(MathExpressionAnalysisService.prototype), "destroy", this).call(this);
  29959. }
  29960. /**
  29961. * @function SuperMap.MathExpressionAnalysisService.prototype.processAsync
  29962. * @description 负责将客户端的查询参数传递到服务端。
  29963. * @param {SuperMap.MathExpressionAnalysisParameters} parameter - 栅格代数运算参数类。
  29964. */
  29965. }, {
  29966. key: "processAsync",
  29967. value: function processAsync(parameter) {
  29968. var me = this;
  29969. var parameterObject = {};
  29970. if (parameter instanceof MathExpressionAnalysisParameters) {
  29971. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/mathanalyst');
  29972. }
  29973. MathExpressionAnalysisParameters.toObject(parameter, parameterObject);
  29974. var jsonParameters = Util.toJSON(parameterObject);
  29975. me.url = Util.urlAppend(me.url, 'returnContent=true');
  29976. me.request({
  29977. method: "POST",
  29978. data: jsonParameters,
  29979. scope: me,
  29980. success: me.serviceProcessCompleted,
  29981. failure: me.serviceProcessFailed
  29982. });
  29983. }
  29984. }]);
  29985. return MathExpressionAnalysisService;
  29986. }(SpatialAnalystBase);
  29987. SuperMap.MathExpressionAnalysisService = MathExpressionAnalysisService;
  29988. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureParameters.js
  29989. function MeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  29990. 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); } }
  29991. function MeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  29992. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  29993. * This program are made available under the terms of the Apache License, Version 2.0
  29994. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  29995. /**
  29996. * @class SuperMap.MeasureParameters
  29997. * @category iServer Map Measure
  29998. * @classdesc 量算参数类。
  29999. * @param {Object} geometry - 要量算的几何对象。
  30000. * @param {Object} options - 参数。
  30001. * @param {SuperMap.Unit} [options.unit=SuperMap.Unit.METER] - 量算单位。
  30002. * @param {string} [options.prjCoordSys] - 用来指定该量算操作所使用的投影。
  30003. * @param {string} [options.distanceMode="Geodesic"] - 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30004. */
  30005. var MeasureParameters = /*#__PURE__*/function () {
  30006. function MeasureParameters(geometry, options) {
  30007. MeasureParameters_classCallCheck(this, MeasureParameters);
  30008. if (!geometry) {
  30009. return;
  30010. }
  30011. /**
  30012. * @member {Object} SuperMap.MeasureParameters.prototype.geometry
  30013. * @description 要量算的几何对象。<br>
  30014. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  30015. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  30016. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  30017. */
  30018. this.geometry = geometry;
  30019. /**
  30020. * @member {SuperMap.Unit} [SuperMap.MeasureParameters.prototype.unit=SuperMap.Unit.METER]
  30021. * @description 量算单位。即量算结果以米为单位。
  30022. */
  30023. this.unit = Unit.METER;
  30024. /**
  30025. * @member {string} [SuperMap.MeasureParameters.prototype.prjCoordSys]
  30026. * @description 用来指定该量算操作所使用的投影。
  30027. */
  30028. this.prjCoordSys = null;
  30029. /**
  30030. * @member {string} [SuperMap.MeasureParameters.prototype.distanceMode="Geodesic"]
  30031. * @description 用来指定量算的方式为按球面长度 'Geodesic' 或者平面长度 'Planar' 来计算。
  30032. * @example
  30033. * var param = new SuperMap.MeasureParameters(getmetry,{distanceMode:'Planar'});
  30034. */
  30035. this.distanceMode = null;
  30036. if (options) {
  30037. Util.extend(this, options);
  30038. }
  30039. this.CLASS_NAME = "SuperMap.MeasureParameters";
  30040. }
  30041. /**
  30042. * @function SuperMap.MeasureParameters.prototype.destroy
  30043. * @description 释放资源,将引用资源的属性置空。
  30044. */
  30045. MeasureParameters_createClass(MeasureParameters, [{
  30046. key: "destroy",
  30047. value: function destroy() {
  30048. var me = this;
  30049. me.geometry = null;
  30050. me.unit = null;
  30051. me.prjCoordSys = null;
  30052. }
  30053. }]);
  30054. return MeasureParameters;
  30055. }();
  30056. SuperMap.MeasureParameters = MeasureParameters;
  30057. ;// CONCATENATED MODULE: ./src/common/iServer/MeasureService.js
  30058. function MeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { MeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MeasureService_typeof(obj); }
  30059. function MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30060. 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); } }
  30061. function MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  30062. function MeasureService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MeasureService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return MeasureService_get(target, property, receiver || target); }
  30063. function MeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  30064. 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 } }); if (superClass) MeasureService_setPrototypeOf(subClass, superClass); }
  30065. function MeasureService_setPrototypeOf(o, p) { MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MeasureService_setPrototypeOf(o, p); }
  30066. 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); }; }
  30067. function MeasureService_possibleConstructorReturn(self, call) { if (call && (MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return MeasureService_assertThisInitialized(self); }
  30068. function MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30069. function MeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30070. function MeasureService_getPrototypeOf(o) { MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MeasureService_getPrototypeOf(o); }
  30071. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30072. * This program are made available under the terms of the Apache License, Version 2.0
  30073. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30074. /**
  30075. * @class SuperMap.MeasureService
  30076. * @category iServer Map Measure
  30077. * @classdesc 量算服务类。
  30078. * 该类负责将量算参数传递到服务端,并获取服务端返回的量算结果。
  30079. * @extends {SuperMap.CommonServiceBase}
  30080. * @example
  30081. * var myMeasuerService = new SuperMap.MeasureService(url, {
  30082. * measureMode: SuperMap.MeasureMode.DISTANCE,
  30083. * eventListeners:{
  30084. * "processCompleted": measureCompleted
  30085. * }
  30086. * });
  30087. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  30088. * @param {Object} options - 参数。
  30089. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30090. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30091. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30092. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30093. * @param {Object} [options.headers] - 请求头。
  30094. * @param {MeasureMode} options.measureMode - 量算模式,包括距离量算模式和面积量算模式。
  30095. */
  30096. var MeasureService_MeasureService = /*#__PURE__*/function (_CommonServiceBase) {
  30097. MeasureService_inherits(MeasureService, _CommonServiceBase);
  30098. var _super = MeasureService_createSuper(MeasureService);
  30099. function MeasureService(url, options) {
  30100. var _this;
  30101. MeasureService_classCallCheck(this, MeasureService);
  30102. _this = _super.call(this, url, options);
  30103. /**
  30104. * @member {SuperMap.MeasureMode} [SuperMap.MeasureService.prototype.measureMode=MeasureMode.DISTANCE]
  30105. * @description 量算模式,包括距离量算模式和面积量算模式。
  30106. */
  30107. _this.measureMode = MeasureMode.DISTANCE;
  30108. if (options) {
  30109. Util.extend(MeasureService_assertThisInitialized(_this), options);
  30110. }
  30111. _this.CLASS_NAME = "SuperMap.MeasureService";
  30112. return _this;
  30113. }
  30114. /**
  30115. * @override
  30116. */
  30117. MeasureService_createClass(MeasureService, [{
  30118. key: "destroy",
  30119. value: function destroy() {
  30120. MeasureService_get(MeasureService_getPrototypeOf(MeasureService.prototype), "destroy", this).call(this);
  30121. var me = this;
  30122. me.measureMode = null;
  30123. }
  30124. /**
  30125. * @function SuperMap.MeasureService.prototype.processAsync
  30126. * @description 负责将客户端的量算参数传递到服务端。
  30127. * @param {SuperMap.MeasureParameters} params - 量算参数。
  30128. */
  30129. }, {
  30130. key: "processAsync",
  30131. value: function processAsync(params) {
  30132. if (!(params instanceof MeasureParameters)) {
  30133. return;
  30134. }
  30135. var me = this,
  30136. geometry = params.geometry,
  30137. pointsCount = 0,
  30138. point2ds = null;
  30139. if (!geometry) {
  30140. return;
  30141. }
  30142. me.url = Util.urlPathAppend(me.url, me.measureMode === MeasureMode.AREA ? 'area' : 'distance');
  30143. var serverGeometry = ServerGeometry.fromGeometry(geometry);
  30144. if (!serverGeometry) {
  30145. return;
  30146. }
  30147. pointsCount = serverGeometry.parts[0];
  30148. point2ds = serverGeometry.points.splice(0, pointsCount);
  30149. var prjCoordSysTemp, prjCodeTemp, paramsTemp;
  30150. if (params.prjCoordSys) {
  30151. if (MeasureService_typeof(params.prjCoordSys) === "object") {
  30152. prjCodeTemp = params.prjCoordSys.projCode;
  30153. prjCoordSysTemp = '{"epsgCode"' + prjCodeTemp.substring(prjCodeTemp.indexOf(":"), prjCodeTemp.length) + "}";
  30154. } else if (typeof params.prjCoordSys === "string") {
  30155. prjCoordSysTemp = '{"epsgCode"' + params.prjCoordSys.substring(params.prjCoordSys.indexOf(":"), params.prjCoordSys.length) + "}";
  30156. }
  30157. paramsTemp = {
  30158. "point2Ds": Util.toJSON(point2ds),
  30159. "unit": params.unit,
  30160. "prjCoordSys": prjCoordSysTemp
  30161. };
  30162. } else {
  30163. paramsTemp = {
  30164. "point2Ds": Util.toJSON(point2ds),
  30165. "unit": params.unit
  30166. };
  30167. }
  30168. me.request({
  30169. method: "GET",
  30170. params: paramsTemp,
  30171. scope: me,
  30172. success: me.serviceProcessCompleted,
  30173. failure: me.serviceProcessFailed
  30174. });
  30175. }
  30176. }]);
  30177. return MeasureService;
  30178. }(CommonServiceBase);
  30179. SuperMap.MeasureService = MeasureService_MeasureService;
  30180. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayAnalystService.js
  30181. function OverlayAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OverlayAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { OverlayAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OverlayAnalystService_typeof(obj); }
  30182. function OverlayAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30183. 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); } }
  30184. function OverlayAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  30185. function OverlayAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return OverlayAnalystService_get(target, property, receiver || target); }
  30186. function OverlayAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  30187. 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 } }); if (superClass) OverlayAnalystService_setPrototypeOf(subClass, superClass); }
  30188. function OverlayAnalystService_setPrototypeOf(o, p) { OverlayAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayAnalystService_setPrototypeOf(o, p); }
  30189. 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); }; }
  30190. function OverlayAnalystService_possibleConstructorReturn(self, call) { if (call && (OverlayAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayAnalystService_assertThisInitialized(self); }
  30191. function OverlayAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30192. function OverlayAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30193. function OverlayAnalystService_getPrototypeOf(o) { OverlayAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayAnalystService_getPrototypeOf(o); }
  30194. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30195. * This program are made available under the terms of the Apache License, Version 2.0
  30196. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30197. /**
  30198. * @class SuperMap.OverlayAnalystService
  30199. * @category iServer SpatialAnalyst OverlayAnalyst
  30200. * @classdesc 叠加分析服务类。
  30201. * 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  30202. * 叠加分析结果通过该类支持的事件的监听函数参数获取
  30203. * @param {string} url - 服务的访问地址。如http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  30204. * @param {Object} options - 参数。</br>
  30205. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30206. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30207. * @param {Object} [options.headers] - 请求头。
  30208. * @extends {SuperMap.CommonServiceBase}
  30209. * @example 例如:
  30210. * (start code)
  30211. * var myOverlayAnalystService = new SuperMap.OverlayAnalystService(url, {
  30212. * eventListeners: {
  30213. * "processCompleted": OverlayCompleted,
  30214. * "processFailed": OverlayFailed
  30215. * }
  30216. * });
  30217. * (end)
  30218. */
  30219. var OverlayAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  30220. OverlayAnalystService_inherits(OverlayAnalystService, _SpatialAnalystBase);
  30221. var _super = OverlayAnalystService_createSuper(OverlayAnalystService);
  30222. function OverlayAnalystService(url, options) {
  30223. var _this;
  30224. OverlayAnalystService_classCallCheck(this, OverlayAnalystService);
  30225. _this = _super.call(this, url, options);
  30226. /**
  30227. * @member {string} SuperMap.OverlayAnalystService.prototype.mode
  30228. * @description 叠加分析类型
  30229. */
  30230. _this.mode = null;
  30231. if (options) {
  30232. Util.extend(OverlayAnalystService_assertThisInitialized(_this), options);
  30233. }
  30234. _this.CLASS_NAME = "SuperMap.OverlayAnalystService";
  30235. return _this;
  30236. }
  30237. /**
  30238. * @override
  30239. */
  30240. OverlayAnalystService_createClass(OverlayAnalystService, [{
  30241. key: "destroy",
  30242. value: function destroy() {
  30243. OverlayAnalystService_get(OverlayAnalystService_getPrototypeOf(OverlayAnalystService.prototype), "destroy", this).call(this);
  30244. this.mode = null;
  30245. }
  30246. /**
  30247. * @function SuperMap.OverlayAnalystService.prototype.processAsync
  30248. * @description 负责将客户端的查询参数传递到服务端。
  30249. * @param {SuperMap.OverlayAnalystParameters} parameter - 叠加分析参数类。
  30250. */
  30251. }, {
  30252. key: "processAsync",
  30253. value: function processAsync(parameter) {
  30254. var parameterObject = {};
  30255. var me = this;
  30256. if (parameter instanceof DatasetOverlayAnalystParameters) {
  30257. me.mode = "datasets";
  30258. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.sourceDataset + '/overlay');
  30259. DatasetOverlayAnalystParameters.toObject(parameter, parameterObject);
  30260. } else if (parameter instanceof GeometryOverlayAnalystParameters) {
  30261. me.mode = "geometry"; //支持传入多个几何要素进行叠加分析
  30262. if (parameter.operateGeometries && parameter.sourceGeometries) {
  30263. me.url = Util.urlPathAppend(me.url, 'geometry/overlay/batch');
  30264. me.url = Util.urlAppend(me.url, 'ignoreAnalystParam=true');
  30265. } else {
  30266. me.url = Util.urlPathAppend(me.url, 'geometry/overlay');
  30267. }
  30268. GeometryOverlayAnalystParameters.toObject(parameter, parameterObject);
  30269. }
  30270. me.url = Util.urlAppend(me.url, 'returnContent=true');
  30271. var jsonParameters = Util.toJSON(parameterObject);
  30272. me.request({
  30273. method: "POST",
  30274. data: jsonParameters,
  30275. scope: me,
  30276. success: me.serviceProcessCompleted,
  30277. failure: me.serviceProcessFailed
  30278. });
  30279. }
  30280. }]);
  30281. return OverlayAnalystService;
  30282. }(SpatialAnalystBase);
  30283. SuperMap.OverlayAnalystService = OverlayAnalystService;
  30284. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobParameter.js
  30285. function OverlayGeoJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30286. 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); } }
  30287. function OverlayGeoJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  30288. /* Copyright© 2000 - 2021 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 SuperMap.OverlayGeoJobParameter
  30293. * @category iServer ProcessingService OverlayAnalyst
  30294. * @classdesc 叠加分析任务参数类。
  30295. * @param {Object} options - 参数。
  30296. * @param {string} options.datasetName - 数据集名。
  30297. * @param {string} options.datasetOverlay - 叠加对象所在的数据集名称。
  30298. * @param {string} options.srcFields - 输入数据需要保留的字段。
  30299. * @param {string} [options.overlayFields] - 叠加数据需要保留的字段。对分析模式为 clip、update、erase 时,此参数无效。
  30300. * @param {string} [options.mode] - 叠加分析模式。
  30301. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  30302. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  30303. */
  30304. var OverlayGeoJobParameter = /*#__PURE__*/function () {
  30305. function OverlayGeoJobParameter(options) {
  30306. OverlayGeoJobParameter_classCallCheck(this, OverlayGeoJobParameter);
  30307. if (!options) {
  30308. return;
  30309. }
  30310. /**
  30311. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetName
  30312. * @description 数据集名。
  30313. */
  30314. this.datasetName = "";
  30315. /**
  30316. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.datasetOverlay
  30317. * @description 叠加对象所在的数据集名称。
  30318. */
  30319. this.datasetOverlay = "";
  30320. /**
  30321. * @member {string} [SuperMap.OverlayGeoJobParameter.prototype.mode]
  30322. * @description 叠加分析模式。
  30323. */
  30324. this.mode = "";
  30325. /**
  30326. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.srcFields
  30327. * @description 输入数据需要保留的字段。
  30328. */
  30329. this.srcFields = "";
  30330. /**
  30331. * @member {string} SuperMap.OverlayGeoJobParameter.prototype.overlayFields
  30332. * @description 叠加数据需要保留的字段,对分析模式为 clip、update、erase 时,此参数无效。
  30333. */
  30334. this.overlayFields = "";
  30335. /**
  30336. * @member {SuperMap.OutputSetting} [SuperMap.OverlayGeoJobParameter.prototype.output]
  30337. * @description 输出参数设置类。
  30338. */
  30339. this.output = null;
  30340. /**
  30341. * @member {SuperMap.MappingParameters} [SuperMap.OverlayGeoJobParameter.prototype.mappingParameters]
  30342. * @description 分析后结果可视化的参数类。
  30343. */
  30344. this.mappingParameters = null;
  30345. Util.extend(this, options);
  30346. this.CLASS_NAME = "SuperMap.OverlayGeoJobParameter";
  30347. }
  30348. /**
  30349. * @function SuperMap.OverlayGeoJobParameter.destroy
  30350. * @override
  30351. */
  30352. OverlayGeoJobParameter_createClass(OverlayGeoJobParameter, [{
  30353. key: "destroy",
  30354. value: function destroy() {
  30355. this.datasetName = null;
  30356. this.datasetOverlay = null;
  30357. this.mode = null;
  30358. this.srcFields = null;
  30359. this.overlayFields = null;
  30360. if (this.output instanceof OutputSetting) {
  30361. this.output.destroy();
  30362. this.output = null;
  30363. }
  30364. if (this.mappingParameters instanceof MappingParameters) {
  30365. this.mappingParameters.destroy();
  30366. this.mappingParameters = null;
  30367. }
  30368. }
  30369. /**
  30370. * @function SuperMap.OverlayGeoJobParameter.toObject
  30371. * @param {Object} OverlayGeoJobParameter - 点聚合分析任务参数。
  30372. * @param {Object} tempObj - 目标对象。
  30373. * @description 生成点聚合分析任务对象。
  30374. */
  30375. }], [{
  30376. key: "toObject",
  30377. value: function toObject(OverlayGeoJobParameter, tempObj) {
  30378. for (var name in OverlayGeoJobParameter) {
  30379. if (name == "datasetName") {
  30380. tempObj['input'] = tempObj['input'] || {};
  30381. tempObj['input'][name] = OverlayGeoJobParameter[name];
  30382. continue;
  30383. }
  30384. if (name === "output") {
  30385. tempObj['output'] = tempObj['output'] || {};
  30386. tempObj['output'] = OverlayGeoJobParameter[name];
  30387. continue;
  30388. }
  30389. tempObj['analyst'] = tempObj['analyst'] || {};
  30390. tempObj['analyst'][name] = OverlayGeoJobParameter[name];
  30391. if (name === 'mappingParameters') {
  30392. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  30393. tempObj['analyst']['mappingParameters'] = OverlayGeoJobParameter[name];
  30394. }
  30395. }
  30396. }
  30397. }]);
  30398. return OverlayGeoJobParameter;
  30399. }();
  30400. SuperMap.OverlayGeoJobParameter = OverlayGeoJobParameter;
  30401. ;// CONCATENATED MODULE: ./src/common/iServer/OverlayGeoJobsService.js
  30402. function OverlayGeoJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OverlayGeoJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { OverlayGeoJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OverlayGeoJobsService_typeof(obj); }
  30403. function OverlayGeoJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30404. 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); } }
  30405. function OverlayGeoJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) OverlayGeoJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) OverlayGeoJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  30406. function OverlayGeoJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { OverlayGeoJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return OverlayGeoJobsService_get(target, property, receiver || target); }
  30407. function OverlayGeoJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = OverlayGeoJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  30408. 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 } }); if (superClass) OverlayGeoJobsService_setPrototypeOf(subClass, superClass); }
  30409. function OverlayGeoJobsService_setPrototypeOf(o, p) { OverlayGeoJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OverlayGeoJobsService_setPrototypeOf(o, p); }
  30410. 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); }; }
  30411. function OverlayGeoJobsService_possibleConstructorReturn(self, call) { if (call && (OverlayGeoJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return OverlayGeoJobsService_assertThisInitialized(self); }
  30412. function OverlayGeoJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30413. function OverlayGeoJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30414. function OverlayGeoJobsService_getPrototypeOf(o) { OverlayGeoJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OverlayGeoJobsService_getPrototypeOf(o); }
  30415. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30416. * This program are made available under the terms of the Apache License, Version 2.0
  30417. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30418. /**
  30419. * @class SuperMap.OverlayGeoJobsService
  30420. * @category iServer ProcessingService OverlayAnalyst
  30421. * @classdesc 叠加分析任务类。
  30422. * @param {string} url - 叠加分析任务地址。
  30423. * @param {Object} options - 参数。
  30424. * @param {SuperMap.Events} options.events - 处理所有事件的对象。
  30425. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30426. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  30427. * @param {number} options.index - 服务访问地址在数组中的位置。
  30428. * @param {number} options.length - 服务访问地址数组长度。
  30429. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30430. * @param {Object} [options.headers] - 请求头。
  30431. */
  30432. var OverlayGeoJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  30433. OverlayGeoJobsService_inherits(OverlayGeoJobsService, _ProcessingServiceBas);
  30434. var _super = OverlayGeoJobsService_createSuper(OverlayGeoJobsService);
  30435. function OverlayGeoJobsService(url, options) {
  30436. var _this;
  30437. OverlayGeoJobsService_classCallCheck(this, OverlayGeoJobsService);
  30438. _this = _super.call(this, url, options);
  30439. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/overlay');
  30440. _this.CLASS_NAME = 'SuperMap.OverlayGeoJobsService';
  30441. return _this;
  30442. }
  30443. /**
  30444. * @override
  30445. */
  30446. OverlayGeoJobsService_createClass(OverlayGeoJobsService, [{
  30447. key: "destroy",
  30448. value: function destroy() {
  30449. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "destroy", this).call(this);
  30450. }
  30451. /**
  30452. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJobs
  30453. * @description 获取叠加分析任务
  30454. */
  30455. }, {
  30456. key: "getOverlayGeoJobs",
  30457. value: function getOverlayGeoJobs() {
  30458. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, this.url);
  30459. }
  30460. /**
  30461. * @function SuperMap.OverlayGeoJobsService.prototype.getOverlayGeoJob
  30462. * @description 获取指定id的叠加分析任务
  30463. * @param {string} id - 指定要获取数据的id
  30464. */
  30465. }, {
  30466. key: "getOverlayGeoJob",
  30467. value: function getOverlayGeoJob(id) {
  30468. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  30469. }
  30470. /**
  30471. * @function SuperMap.OverlayGeoJobsService.prototype.addOverlayGeoJob
  30472. * @description 新建点叠加析服务
  30473. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个叠加分析的请求参数。
  30474. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  30475. */
  30476. }, {
  30477. key: "addOverlayGeoJob",
  30478. value: function addOverlayGeoJob(params, seconds) {
  30479. OverlayGeoJobsService_get(OverlayGeoJobsService_getPrototypeOf(OverlayGeoJobsService.prototype), "addJob", this).call(this, this.url, params, OverlayGeoJobParameter, seconds);
  30480. }
  30481. }]);
  30482. return OverlayGeoJobsService;
  30483. }(ProcessingServiceBase);
  30484. SuperMap.OverlayGeoJobsService = OverlayGeoJobsService;
  30485. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsParameters.js
  30486. function QueryByBoundsParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByBoundsParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByBoundsParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByBoundsParameters_typeof(obj); }
  30487. function QueryByBoundsParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30488. 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); } }
  30489. function QueryByBoundsParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsParameters_defineProperties(Constructor, staticProps); return Constructor; }
  30490. function QueryByBoundsParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByBoundsParameters_get(target, property, receiver || target); }
  30491. function QueryByBoundsParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  30492. 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 } }); if (superClass) QueryByBoundsParameters_setPrototypeOf(subClass, superClass); }
  30493. function QueryByBoundsParameters_setPrototypeOf(o, p) { QueryByBoundsParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsParameters_setPrototypeOf(o, p); }
  30494. 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); }; }
  30495. function QueryByBoundsParameters_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsParameters_assertThisInitialized(self); }
  30496. function QueryByBoundsParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30497. function QueryByBoundsParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30498. function QueryByBoundsParameters_getPrototypeOf(o) { QueryByBoundsParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsParameters_getPrototypeOf(o); }
  30499. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30500. * This program are made available under the terms of the Apache License, Version 2.0
  30501. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30502. /**
  30503. * @class SuperMap.QueryByBoundsParameters
  30504. * @category iServer Map QueryResults
  30505. * @classdesc Bounds 查询参数类。该类用于设置 Bounds 查询的相关参数。
  30506. * @extends {SuperMap.QueryParameters}
  30507. * @param {Object} options - 参数。
  30508. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} options.bounds - 指定的查询范围。
  30509. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  30510. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  30511. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  30512. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  30513. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  30514. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  30515. * @param {number} [options.startRecord=0] - 查询起始记录号。
  30516. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  30517. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  30518. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  30519. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  30520. */
  30521. var QueryByBoundsParameters = /*#__PURE__*/function (_QueryParameters) {
  30522. QueryByBoundsParameters_inherits(QueryByBoundsParameters, _QueryParameters);
  30523. var _super = QueryByBoundsParameters_createSuper(QueryByBoundsParameters);
  30524. function QueryByBoundsParameters(options) {
  30525. var _this;
  30526. QueryByBoundsParameters_classCallCheck(this, QueryByBoundsParameters);
  30527. if (!options) {
  30528. return QueryByBoundsParameters_possibleConstructorReturn(_this);
  30529. }
  30530. _this = _super.call(this, options);
  30531. /**
  30532. * @member {boolean} [SuperMap.QueryByBoundsParameters.prototype.returnContent=true]
  30533. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  30534. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  30535. * 为 false,则返回的是查询结果资源的 URI。
  30536. */
  30537. _this.returnContent = true;
  30538. /**
  30539. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.QueryByBoundsParameters.prototype.bounds
  30540. * @description 指定的查询范围。
  30541. */
  30542. _this.bounds = null;
  30543. Util.extend(QueryByBoundsParameters_assertThisInitialized(_this), options);
  30544. _this.CLASS_NAME = "SuperMap.QueryByBoundsParameters";
  30545. return _this;
  30546. }
  30547. /**
  30548. * @function SuperMap.QueryByBoundsParameters.prototype.destroy
  30549. * @description 释放资源,将引用资源的属性置空。
  30550. */
  30551. QueryByBoundsParameters_createClass(QueryByBoundsParameters, [{
  30552. key: "destroy",
  30553. value: function destroy() {
  30554. QueryByBoundsParameters_get(QueryByBoundsParameters_getPrototypeOf(QueryByBoundsParameters.prototype), "destroy", this).call(this);
  30555. var me = this;
  30556. me.returnContent = null;
  30557. if (me.bounds) {
  30558. me.bounds = null;
  30559. }
  30560. }
  30561. }]);
  30562. return QueryByBoundsParameters;
  30563. }(QueryParameters);
  30564. SuperMap.QueryByBoundsParameters = QueryByBoundsParameters;
  30565. ;// CONCATENATED MODULE: ./src/common/iServer/QueryService.js
  30566. function QueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryService_typeof(obj); }
  30567. function QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30568. 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); } }
  30569. function QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  30570. function QueryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryService_get = Reflect.get; } else { QueryService_get = function _get(target, property, receiver) { var base = QueryService_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return QueryService_get(target, property, receiver || target); }
  30571. function QueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  30572. 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 } }); if (superClass) QueryService_setPrototypeOf(subClass, superClass); }
  30573. function QueryService_setPrototypeOf(o, p) { QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryService_setPrototypeOf(o, p); }
  30574. 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); }; }
  30575. function QueryService_possibleConstructorReturn(self, call) { if (call && (QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryService_assertThisInitialized(self); }
  30576. function QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30577. function QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30578. function QueryService_getPrototypeOf(o) { QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryService_getPrototypeOf(o); }
  30579. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30580. * This program are made available under the terms of the Apache License, Version 2.0
  30581. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30582. /**
  30583. * @class SuperMap.QueryService
  30584. * @category iServer Map QueryResults
  30585. * @classdesc 查询服务基类。
  30586. * @extends {SuperMap.CommonServiceBase}
  30587. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  30588. * @param {Object} options - 参数。
  30589. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  30590. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30591. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30592. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30593. * @param {Object} [options.headers] - 请求头。
  30594. * @example
  30595. * var myService = new SuperMap.QueryService(url, {
  30596. * eventListeners: {
  30597. * "processCompleted": queryCompleted,
  30598. * "processFailed": queryError
  30599. * }
  30600. * };
  30601. */
  30602. var QueryService = /*#__PURE__*/function (_CommonServiceBase) {
  30603. QueryService_inherits(QueryService, _CommonServiceBase);
  30604. var _super = QueryService_createSuper(QueryService);
  30605. /**
  30606. * @function SuperMap.QueryService.prototype.constructor
  30607. * @description 查询服务基类构造函数。
  30608. * @param {string} url - 服务地址。请求地图查询服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  30609. * @param {Object} options -参数。
  30610. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  30611. */
  30612. function QueryService(url, options) {
  30613. var _this;
  30614. QueryService_classCallCheck(this, QueryService);
  30615. _this = _super.call(this, url, options);
  30616. /**
  30617. * @member {boolean} SuperMap.QueryService.prototype.returnContent
  30618. * @description 是否立即返回新创建资源的表述还是返回新资源的URI。
  30619. */
  30620. _this.returnContent = false;
  30621. /**
  30622. * @member {string} SuperMap.QueryService.prototype.format
  30623. * @description 查询结果返回格式,目前支持iServerJSON 和GeoJSON两种格式。参数格式为"ISERVER","GEOJSON"。
  30624. */
  30625. _this.format = DataFormat.GEOJSON;
  30626. _this.returnFeatureWithFieldCaption = false;
  30627. if (options) {
  30628. Util.extend(QueryService_assertThisInitialized(_this), options);
  30629. }
  30630. _this.CLASS_NAME = "SuperMap.QueryService";
  30631. if (!_this.url) {
  30632. return QueryService_possibleConstructorReturn(_this);
  30633. }
  30634. if (options && options.format) {
  30635. _this.format = options.format.toUpperCase();
  30636. }
  30637. _this.url = Util.urlPathAppend(_this.url, 'queryResults');
  30638. return _this;
  30639. }
  30640. /**
  30641. * @function SuperMap.QueryService.prototype.destroy
  30642. * @description 释放资源,将引用资源的属性置空。
  30643. */
  30644. QueryService_createClass(QueryService, [{
  30645. key: "destroy",
  30646. value: function destroy() {
  30647. QueryService_get(QueryService_getPrototypeOf(QueryService.prototype), "destroy", this).call(this);
  30648. var me = this;
  30649. me.returnContent = null;
  30650. me.format = null;
  30651. }
  30652. /**
  30653. * @function SuperMap.QueryService.prototype.processAsync
  30654. * @description 负责将客户端的查询参数传递到服务端。
  30655. * @param {SuperMap.QueryParameters} params - 查询参数。
  30656. */
  30657. }, {
  30658. key: "processAsync",
  30659. value: function processAsync(params) {
  30660. if (!(params instanceof QueryParameters)) {
  30661. return;
  30662. }
  30663. var me = this,
  30664. returnCustomResult = null,
  30665. jsonParameters = null;
  30666. me.returnContent = params.returnContent;
  30667. jsonParameters = me.getJsonParameters(params);
  30668. if (me.returnContent) {
  30669. me.url = Util.urlAppend(me.url, 'returnContent=' + me.returnContent);
  30670. } else {
  30671. //仅供三维使用 获取高亮图片的bounds
  30672. returnCustomResult = params.returnCustomResult;
  30673. if (returnCustomResult) {
  30674. me.url = Util.urlAppend(me.url, 'returnCustomResult=' + returnCustomResult);
  30675. }
  30676. }
  30677. me.returnFeatureWithFieldCaption = params.returnFeatureWithFieldCaption;
  30678. me.request({
  30679. method: "POST",
  30680. data: jsonParameters,
  30681. scope: me,
  30682. success: me.serviceProcessCompleted,
  30683. failure: me.serviceProcessFailed
  30684. });
  30685. }
  30686. /**
  30687. * @function SuperMap.QueryService.prototype.serviceProcessCompleted
  30688. * @description 查询完成,执行此方法。
  30689. * @param {Object} result - 服务器返回的结果对象。
  30690. */
  30691. }, {
  30692. key: "serviceProcessCompleted",
  30693. value: function serviceProcessCompleted(result) {
  30694. var me = this;
  30695. result = Util.transformResult(result);
  30696. var geoJSONFormat = new GeoJSON();
  30697. if (result && result.recordsets) {
  30698. for (var i = 0, recordsets = result.recordsets, len = recordsets.length; i < len; i++) {
  30699. if (recordsets[i].features) {
  30700. if (me.returnFeatureWithFieldCaption === true) {
  30701. recordsets[i].features.map(function (feature) {
  30702. feature.fieldNames = recordsets[i].fieldCaptions;
  30703. return feature;
  30704. });
  30705. }
  30706. if (me.format === DataFormat.GEOJSON) {
  30707. recordsets[i].features = geoJSONFormat.toGeoJSON(recordsets[i].features);
  30708. }
  30709. }
  30710. }
  30711. }
  30712. me.events.triggerEvent("processCompleted", {
  30713. result: result
  30714. });
  30715. }
  30716. /**
  30717. * @function SuperMap.QueryService.prototype.getQueryParameters
  30718. * @description 将 JSON 对象表示的查询参数转化为 QueryParameters 对象。
  30719. * @param {Object} params - JSON 字符串表示的查询参数。
  30720. * @returns {SuperMap.QueryParameters} 返回转化后的 QueryParameters 对象。
  30721. */
  30722. }, {
  30723. key: "getQueryParameters",
  30724. value: function getQueryParameters(params) {
  30725. return new QueryParameters({
  30726. customParams: params.customParams,
  30727. expectCount: params.expectCount,
  30728. networkType: params.networkType,
  30729. queryOption: params.queryOption,
  30730. queryParams: params.queryParams,
  30731. startRecord: params.startRecord,
  30732. prjCoordSys: params.prjCoordSys,
  30733. holdTime: params.holdTime
  30734. });
  30735. }
  30736. }]);
  30737. return QueryService;
  30738. }(CommonServiceBase);
  30739. SuperMap.QueryService = QueryService;
  30740. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByBoundsService.js
  30741. function QueryByBoundsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByBoundsService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByBoundsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByBoundsService_typeof(obj); }
  30742. function QueryByBoundsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30743. 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); } }
  30744. function QueryByBoundsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByBoundsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByBoundsService_defineProperties(Constructor, staticProps); return Constructor; }
  30745. function QueryByBoundsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByBoundsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByBoundsService_get(target, property, receiver || target); }
  30746. function QueryByBoundsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByBoundsService_getPrototypeOf(object); if (object === null) break; } return object; }
  30747. 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 } }); if (superClass) QueryByBoundsService_setPrototypeOf(subClass, superClass); }
  30748. function QueryByBoundsService_setPrototypeOf(o, p) { QueryByBoundsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByBoundsService_setPrototypeOf(o, p); }
  30749. 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); }; }
  30750. function QueryByBoundsService_possibleConstructorReturn(self, call) { if (call && (QueryByBoundsService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByBoundsService_assertThisInitialized(self); }
  30751. function QueryByBoundsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30752. function QueryByBoundsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30753. function QueryByBoundsService_getPrototypeOf(o) { QueryByBoundsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByBoundsService_getPrototypeOf(o); }
  30754. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30755. * This program are made available under the terms of the Apache License, Version 2.0
  30756. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30757. /**
  30758. * @class SuperMap.QueryByBoundsService
  30759. * @category iServer Map QueryResults
  30760. * @classdesc Bounds 查询服务类。
  30761. * @augments {SuperMap.QueryService}
  30762. * @example
  30763. * (start end)
  30764. * var myQueryByBoundsService = new SuperMap.QueryByBoundsService(url, {
  30765. * eventListeners: {
  30766. * "processCompleted": queryCompleted,
  30767. * "processFailed": queryError
  30768. * }
  30769. * });
  30770. * function queryCompleted(object){//todo};
  30771. * function queryError(object){//todo};
  30772. * (end)
  30773. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  30774. * @param {Object} options - 参数。<br>
  30775. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。<br>
  30776. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30777. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30778. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30779. * @param {Object} [options.headers] - 请求头。
  30780. */
  30781. var QueryByBoundsService = /*#__PURE__*/function (_QueryService) {
  30782. QueryByBoundsService_inherits(QueryByBoundsService, _QueryService);
  30783. var _super = QueryByBoundsService_createSuper(QueryByBoundsService);
  30784. function QueryByBoundsService(url, options) {
  30785. var _this;
  30786. QueryByBoundsService_classCallCheck(this, QueryByBoundsService);
  30787. _this = _super.call(this, url, options);
  30788. _this.CLASS_NAME = "SuperMap.QueryByBoundsService";
  30789. return _this;
  30790. }
  30791. /**
  30792. * @override
  30793. */
  30794. QueryByBoundsService_createClass(QueryByBoundsService, [{
  30795. key: "destroy",
  30796. value: function destroy() {
  30797. QueryByBoundsService_get(QueryByBoundsService_getPrototypeOf(QueryByBoundsService.prototype), "destroy", this).call(this);
  30798. }
  30799. /**
  30800. * @function SuperMap.QueryByBoundsService.prototype.getJsonParameters
  30801. * @description 将查询参数转化为 JSON 字符串。
  30802. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds 等)。
  30803. * @param {SuperMap.QueryByBoundsParameters} params - Bounds 查询参数。
  30804. * @returns {Object} 转化后的 JSON 字符串。
  30805. */
  30806. }, {
  30807. key: "getJsonParameters",
  30808. value: function getJsonParameters(params) {
  30809. if (!(params instanceof QueryByBoundsParameters)) {
  30810. return null;
  30811. }
  30812. var me = this,
  30813. jsonParameters = "",
  30814. qp = null,
  30815. bounds = params.bounds;
  30816. qp = me.getQueryParameters(params);
  30817. jsonParameters += "'queryMode':'BoundsQuery','queryParameters':";
  30818. jsonParameters += Util.toJSON(qp);
  30819. jsonParameters += ",'bounds': {'rightTop':{'y':" + bounds.top + ",'x':" + bounds.right + "},'leftBottom':{'y':" + bounds.bottom + ",'x':" + bounds.left + "}}";
  30820. jsonParameters = "{" + jsonParameters + "}";
  30821. return jsonParameters;
  30822. }
  30823. }]);
  30824. return QueryByBoundsService;
  30825. }(QueryService);
  30826. SuperMap.QueryByBoundsService = QueryByBoundsService;
  30827. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceParameters.js
  30828. function QueryByDistanceParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByDistanceParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByDistanceParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByDistanceParameters_typeof(obj); }
  30829. function QueryByDistanceParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30830. 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); } }
  30831. function QueryByDistanceParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceParameters_defineProperties(Constructor, staticProps); return Constructor; }
  30832. function QueryByDistanceParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByDistanceParameters_get(target, property, receiver || target); }
  30833. function QueryByDistanceParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  30834. 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 } }); if (superClass) QueryByDistanceParameters_setPrototypeOf(subClass, superClass); }
  30835. function QueryByDistanceParameters_setPrototypeOf(o, p) { QueryByDistanceParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceParameters_setPrototypeOf(o, p); }
  30836. 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); }; }
  30837. function QueryByDistanceParameters_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceParameters_assertThisInitialized(self); }
  30838. function QueryByDistanceParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30839. function QueryByDistanceParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30840. function QueryByDistanceParameters_getPrototypeOf(o) { QueryByDistanceParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceParameters_getPrototypeOf(o); }
  30841. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30842. * This program are made available under the terms of the Apache License, Version 2.0
  30843. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30844. /**
  30845. * @class SuperMap.QueryByDistanceParameters
  30846. * @category iServer Map QueryResults
  30847. * @classdesc Distance 查询参数类。
  30848. * 该类用于设置 Distance 查询的相关参数。
  30849. * @extends {SuperMap.QueryParameters}
  30850. * @param {Object} options - 参数。
  30851. * @param {Object} options.geometry - 用于查询的几何对象。
  30852. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  30853. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  30854. * @param {Object} [options.prjCoordSys] -自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  30855. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  30856. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  30857. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.QueryOption.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  30858. * @param {number} [options.startRecord=0] - 查询起始记录号。
  30859. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  30860. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  30861. * @param {number} [options.distance=0] - 查询距离。
  30862. * @param {boolean} [options.isNearest=false] - 是否为最近距离查询。
  30863. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  30864. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  30865. */
  30866. var QueryByDistanceParameters = /*#__PURE__*/function (_QueryParameters) {
  30867. QueryByDistanceParameters_inherits(QueryByDistanceParameters, _QueryParameters);
  30868. var _super = QueryByDistanceParameters_createSuper(QueryByDistanceParameters);
  30869. function QueryByDistanceParameters(options) {
  30870. var _this;
  30871. QueryByDistanceParameters_classCallCheck(this, QueryByDistanceParameters);
  30872. if (!options) {
  30873. return QueryByDistanceParameters_possibleConstructorReturn(_this);
  30874. }
  30875. _this = _super.call(this, options);
  30876. /**
  30877. * @member {number} [SuperMap.QueryByDistanceParameters.prototype.distance=0]
  30878. * @description 查询距离,单位与所查询图层对应的数据集单位相同。
  30879. * 当查找最近地物时,该属性无效。
  30880. */
  30881. _this.distance = 0;
  30882. /**
  30883. * @member SuperMap.QueryByDistanceParameters.prototype.geometry
  30884. * @description 用于查询的地理对象。<br>
  30885. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  30886. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  30887. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  30888. */
  30889. _this.geometry = null;
  30890. /**
  30891. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.isNearest=false]
  30892. * @description 是否为最近距离查询。<br>
  30893. * 建议该属性与 expectCount(继承自 {@link SuperMap.QueryParameters})属性联合使用。
  30894. * 当该属性为 true 时,即表示查找最近地物,如果查询结果数大于期望返回的结果记录数(expectCount),
  30895. * 则查找结果为查询总记录中距离中心最近的 expectCount 个地物。
  30896. * 当该属性为不为 true 时,如果查询结果数大于期望返回的结果记录数(expectCount),
  30897. * 则查找结果为从查询总记录中随机抽取的 expectCount 个地物。
  30898. * 目前查询结果不支持按远近距离排序。
  30899. */
  30900. _this.isNearest = null;
  30901. /**
  30902. * @member {boolean} [SuperMap.QueryByDistanceParameters.prototype.returnContent=true]
  30903. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  30904. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  30905. * 为 false,则返回的是查询结果资源的 URI。
  30906. */
  30907. _this.returnContent = true;
  30908. Util.extend(QueryByDistanceParameters_assertThisInitialized(_this), options);
  30909. _this.CLASS_NAME = "SuperMap.QueryByDistanceParameters";
  30910. return _this;
  30911. }
  30912. /**
  30913. * @function SuperMap.QueryByDistanceParameters.prototype.destroy
  30914. * @description 释放资源,将引用资源的属性置空。
  30915. */
  30916. QueryByDistanceParameters_createClass(QueryByDistanceParameters, [{
  30917. key: "destroy",
  30918. value: function destroy() {
  30919. QueryByDistanceParameters_get(QueryByDistanceParameters_getPrototypeOf(QueryByDistanceParameters.prototype), "destroy", this).call(this);
  30920. var me = this;
  30921. me.returnContent = null;
  30922. me.distance = null;
  30923. me.isNearest = null;
  30924. if (me.geometry) {
  30925. me.geometry.destroy();
  30926. me.geometry = null;
  30927. }
  30928. }
  30929. }]);
  30930. return QueryByDistanceParameters;
  30931. }(QueryParameters);
  30932. SuperMap.QueryByDistanceParameters = QueryByDistanceParameters;
  30933. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByDistanceService.js
  30934. function QueryByDistanceService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByDistanceService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByDistanceService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByDistanceService_typeof(obj); }
  30935. function QueryByDistanceService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  30936. 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); } }
  30937. function QueryByDistanceService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByDistanceService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByDistanceService_defineProperties(Constructor, staticProps); return Constructor; }
  30938. function QueryByDistanceService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByDistanceService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByDistanceService_get(target, property, receiver || target); }
  30939. function QueryByDistanceService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByDistanceService_getPrototypeOf(object); if (object === null) break; } return object; }
  30940. 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 } }); if (superClass) QueryByDistanceService_setPrototypeOf(subClass, superClass); }
  30941. function QueryByDistanceService_setPrototypeOf(o, p) { QueryByDistanceService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByDistanceService_setPrototypeOf(o, p); }
  30942. 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); }; }
  30943. function QueryByDistanceService_possibleConstructorReturn(self, call) { if (call && (QueryByDistanceService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByDistanceService_assertThisInitialized(self); }
  30944. function QueryByDistanceService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  30945. function QueryByDistanceService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  30946. function QueryByDistanceService_getPrototypeOf(o) { QueryByDistanceService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByDistanceService_getPrototypeOf(o); }
  30947. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  30948. * This program are made available under the terms of the Apache License, Version 2.0
  30949. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  30950. /**
  30951. * @class SuperMap.QueryByDistanceService
  30952. * @category iServer Map QueryResults
  30953. * @classdesc Distance查询服务类。
  30954. * @extends {SuperMap.QueryService}
  30955. * @example
  30956. * var myQueryByDistService = new SuperMap.QueryByDistanceService(url, {
  30957. * eventListeners: {
  30958. * "processCompleted": queryCompleted,
  30959. * "processFailed": queryError
  30960. * }
  30961. * });
  30962. * function queryCompleted(object){//todo};
  30963. * function queryError(object){//todo};
  30964. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  30965. * @param {Object} options - 参数。
  30966. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  30967. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  30968. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  30969. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  30970. * @param {Object} [options.headers] - 请求头。
  30971. */
  30972. var QueryByDistanceService = /*#__PURE__*/function (_QueryService) {
  30973. QueryByDistanceService_inherits(QueryByDistanceService, _QueryService);
  30974. var _super = QueryByDistanceService_createSuper(QueryByDistanceService);
  30975. function QueryByDistanceService(url, options) {
  30976. var _this;
  30977. QueryByDistanceService_classCallCheck(this, QueryByDistanceService);
  30978. _this = _super.call(this, url, options);
  30979. _this.CLASS_NAME = "SuperMap.QueryByDistanceService";
  30980. return _this;
  30981. }
  30982. /**
  30983. * @override
  30984. */
  30985. QueryByDistanceService_createClass(QueryByDistanceService, [{
  30986. key: "destroy",
  30987. value: function destroy() {
  30988. QueryByDistanceService_get(QueryByDistanceService_getPrototypeOf(QueryByDistanceService.prototype), "destroy", this).call(this);
  30989. }
  30990. /**
  30991. * @function SuperMap.QueryByDistanceService.prototype.getJsonParameters
  30992. * @description 将查询参数转化为 JSON 字符串。
  30993. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  30994. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询参数类。
  30995. * @returns {Object} 转化后的 JSON 字符串。
  30996. */
  30997. }, {
  30998. key: "getJsonParameters",
  30999. value: function getJsonParameters(params) {
  31000. if (!(params instanceof QueryByDistanceParameters)) {
  31001. return;
  31002. }
  31003. var me = this,
  31004. jsonParameters = "",
  31005. qp = me.getQueryParameters(params);
  31006. var sg = ServerGeometry.fromGeometry(params.geometry);
  31007. jsonParameters += params.isNearest ? "'queryMode':'FindNearest','queryParameters':" : "'queryMode':'DistanceQuery','queryParameters':";
  31008. jsonParameters += Util.toJSON(qp);
  31009. jsonParameters += ",'geometry':" + Util.toJSON(sg) + ",'distance':" + params.distance;
  31010. jsonParameters = "{" + jsonParameters + "}";
  31011. return jsonParameters;
  31012. }
  31013. }]);
  31014. return QueryByDistanceService;
  31015. }(QueryService);
  31016. SuperMap.QueryByDistanceService = QueryByDistanceService;
  31017. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryParameters.js
  31018. function QueryByGeometryParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByGeometryParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByGeometryParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByGeometryParameters_typeof(obj); }
  31019. function QueryByGeometryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31020. 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); } }
  31021. function QueryByGeometryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31022. function QueryByGeometryParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByGeometryParameters_get(target, property, receiver || target); }
  31023. function QueryByGeometryParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31024. 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 } }); if (superClass) QueryByGeometryParameters_setPrototypeOf(subClass, superClass); }
  31025. function QueryByGeometryParameters_setPrototypeOf(o, p) { QueryByGeometryParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryParameters_setPrototypeOf(o, p); }
  31026. 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); }; }
  31027. function QueryByGeometryParameters_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryParameters_assertThisInitialized(self); }
  31028. function QueryByGeometryParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31029. function QueryByGeometryParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31030. function QueryByGeometryParameters_getPrototypeOf(o) { QueryByGeometryParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryParameters_getPrototypeOf(o); }
  31031. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31032. * This program are made available under the terms of the Apache License, Version 2.0
  31033. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31034. /**
  31035. * @class SuperMap.QueryByGeometryParameters
  31036. * @category iServer Map QueryResults
  31037. * @classdesc Geometry 查询参数类。
  31038. * 该类用于设置 Geometry查询的相关参数。
  31039. * @extends {SuperMap.QueryParameters}
  31040. * @param {Object} options - 参数。
  31041. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  31042. * @param {Object} options.geometry - 用于查询的几何对象。
  31043. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  31044. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  31045. * @param {Object} [options.prjCoordSys] -自定义参数,供SuperMap Online提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  31046. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  31047. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  31048. * @param {boolean} [options.returnCustomResult=false] -仅供三维使用。
  31049. * @param {number} [options.startRecord=0] - 查询起始记录号。
  31050. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  31051. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31052. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  31053. * @param {SuperMap.SpatialQueryMode} [spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT] - 空间查询模式。
  31054. */
  31055. var QueryByGeometryParameters = /*#__PURE__*/function (_QueryParameters) {
  31056. QueryByGeometryParameters_inherits(QueryByGeometryParameters, _QueryParameters);
  31057. var _super = QueryByGeometryParameters_createSuper(QueryByGeometryParameters);
  31058. function QueryByGeometryParameters(options) {
  31059. var _this;
  31060. QueryByGeometryParameters_classCallCheck(this, QueryByGeometryParameters);
  31061. if (!options) {
  31062. return QueryByGeometryParameters_possibleConstructorReturn(_this);
  31063. }
  31064. _this = _super.call(this, options);
  31065. /**
  31066. * @member {boolean} [SuperMap.QueryByGeometryParameters.prototype.returnContent=true]
  31067. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。<br>
  31068. * 如果为 true,则直接返回新创建资源,即查询结果的表述。<br>
  31069. * 为 false,则返回的是查询结果资源的 URI。
  31070. */
  31071. _this.returnContent = true;
  31072. /**
  31073. * @member {Object} SuperMap.QueryByGeometryParameters.prototype.geometry
  31074. * @description 用于查询的几何对象。<br>
  31075. * 点类型可以是:{@link SuperMap.Geometry.Point}|{@link L.Marker}|{@link L.CircleMarker}|{@link L.Circle}|{@link L.GeoJSON}|{@link ol.geom.Point}|{@link ol.format.GeoJSON}。<br>
  31076. * 线类型可以是:{@link SuperMap.Geometry.LineString}|{@link SuperMap.Geometry.LinearRing}|{@link L.Polyline}|{@link L.GeoJSON}|{@link ol.geom.LineString}|{@link ol.format.GeoJSON}。<br>
  31077. * 面类型可以是:{@link SuperMap.Geometry.Polygon}|{@link L.Polygon}|{@link L.GeoJSON}|{@link ol.geom.Polygon}|{@link ol.format.GeoJSON}。
  31078. */
  31079. _this.geometry = null;
  31080. /**
  31081. * @member {SuperMap.SpatialQueryMode} [SuperMap.QueryByGeometryParameters.prototype.spatialQueryMode=SuperMap.SpatialQueryMode.INTERSECT]
  31082. * @description 空间查询模式。
  31083. */
  31084. _this.spatialQueryMode = SpatialQueryMode.INTERSECT;
  31085. Util.extend(QueryByGeometryParameters_assertThisInitialized(_this), options);
  31086. _this.CLASS_NAME = "SuperMap.QueryByGeometryParameters";
  31087. return _this;
  31088. }
  31089. /**
  31090. * @function SuperMap.QueryByGeometryParameters.prototype.destroy
  31091. * @description 释放资源,将引用资源的属性置空。
  31092. */
  31093. QueryByGeometryParameters_createClass(QueryByGeometryParameters, [{
  31094. key: "destroy",
  31095. value: function destroy() {
  31096. QueryByGeometryParameters_get(QueryByGeometryParameters_getPrototypeOf(QueryByGeometryParameters.prototype), "destroy", this).call(this);
  31097. var me = this;
  31098. me.returnContent = null;
  31099. me.geometry = null;
  31100. me.spatialQueryMode = null;
  31101. }
  31102. }]);
  31103. return QueryByGeometryParameters;
  31104. }(QueryParameters);
  31105. SuperMap.QueryByGeometryParameters = QueryByGeometryParameters;
  31106. ;// CONCATENATED MODULE: ./src/common/iServer/QueryByGeometryService.js
  31107. function QueryByGeometryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryByGeometryService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryByGeometryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryByGeometryService_typeof(obj); }
  31108. function QueryByGeometryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31109. 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); } }
  31110. function QueryByGeometryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryByGeometryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryByGeometryService_defineProperties(Constructor, staticProps); return Constructor; }
  31111. function QueryByGeometryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryByGeometryService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryByGeometryService_get(target, property, receiver || target); }
  31112. function QueryByGeometryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryByGeometryService_getPrototypeOf(object); if (object === null) break; } return object; }
  31113. 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 } }); if (superClass) QueryByGeometryService_setPrototypeOf(subClass, superClass); }
  31114. function QueryByGeometryService_setPrototypeOf(o, p) { QueryByGeometryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryByGeometryService_setPrototypeOf(o, p); }
  31115. 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); }; }
  31116. function QueryByGeometryService_possibleConstructorReturn(self, call) { if (call && (QueryByGeometryService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryByGeometryService_assertThisInitialized(self); }
  31117. function QueryByGeometryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31118. function QueryByGeometryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31119. function QueryByGeometryService_getPrototypeOf(o) { QueryByGeometryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryByGeometryService_getPrototypeOf(o); }
  31120. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31121. * This program are made available under the terms of the Apache License, Version 2.0
  31122. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31123. /**
  31124. * @class SuperMap.QueryByGeometryService
  31125. * @category iServer Map QueryResults
  31126. * @classdesc Geometry查询服务类。
  31127. * @extends {SuperMap.QueryService}
  31128. * @example
  31129. * var myQueryByGeometryService = new SuperMap.QueryByGeometryService(url, {
  31130. * eventListeners: {
  31131. * "processCompleted": queryCompleted,
  31132. * "processFailed": queryError
  31133. * }
  31134. * });
  31135. * function queryCompleted(object){//todo};
  31136. * function queryError(object){//todo};
  31137. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31138. * @param {Object} options - 参数。
  31139. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  31140. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31141. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31142. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31143. * @param {Object} [options.headers] - 请求头。
  31144. */
  31145. var QueryByGeometryService = /*#__PURE__*/function (_QueryService) {
  31146. QueryByGeometryService_inherits(QueryByGeometryService, _QueryService);
  31147. var _super = QueryByGeometryService_createSuper(QueryByGeometryService);
  31148. /**
  31149. * @function SuperMap.QueryByGeometryService.prototype.constructor
  31150. * @description Geometry 查询服务类构造函数。
  31151. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31152. * @param {Object} options - 参数。
  31153. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31154. */
  31155. function QueryByGeometryService(url, options) {
  31156. var _this;
  31157. QueryByGeometryService_classCallCheck(this, QueryByGeometryService);
  31158. _this = _super.call(this, url, options);
  31159. _this.CLASS_NAME = "SuperMap.QueryByGeometryService";
  31160. return _this;
  31161. }
  31162. /**
  31163. * @override
  31164. */
  31165. QueryByGeometryService_createClass(QueryByGeometryService, [{
  31166. key: "destroy",
  31167. value: function destroy() {
  31168. QueryByGeometryService_get(QueryByGeometryService_getPrototypeOf(QueryByGeometryService.prototype), "destroy", this).call(this);
  31169. }
  31170. /**
  31171. * @function SuperMap.QueryByGeometryService.prototype.getJsonParameters
  31172. * @description 将查询参数转化为 JSON 字符串。
  31173. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  31174. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询参数类。
  31175. * @returns {Object} 转化后的 JSON 字符串。
  31176. */
  31177. }, {
  31178. key: "getJsonParameters",
  31179. value: function getJsonParameters(params) {
  31180. if (!(params instanceof QueryByGeometryParameters)) {
  31181. return;
  31182. }
  31183. var me = this,
  31184. jsonParameters = "",
  31185. qp = null,
  31186. geometry = params.geometry,
  31187. sg = ServerGeometry.fromGeometry(geometry);
  31188. qp = me.getQueryParameters(params);
  31189. jsonParameters += "'queryMode':'SpatialQuery','queryParameters':";
  31190. jsonParameters += Util.toJSON(qp) + ",'geometry':" + Util.toJSON(sg) + ",'spatialQueryMode':" + Util.toJSON(params.spatialQueryMode);
  31191. jsonParameters = "{" + jsonParameters + "}";
  31192. return jsonParameters;
  31193. }
  31194. }]);
  31195. return QueryByGeometryService;
  31196. }(QueryService);
  31197. SuperMap.QueryByGeometryService = QueryByGeometryService;
  31198. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLParameters.js
  31199. function QueryBySQLParameters_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryBySQLParameters_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryBySQLParameters_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryBySQLParameters_typeof(obj); }
  31200. function QueryBySQLParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31201. 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); } }
  31202. function QueryBySQLParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31203. function QueryBySQLParameters_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLParameters_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryBySQLParameters_get(target, property, receiver || target); }
  31204. function QueryBySQLParameters_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLParameters_getPrototypeOf(object); if (object === null) break; } return object; }
  31205. 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 } }); if (superClass) QueryBySQLParameters_setPrototypeOf(subClass, superClass); }
  31206. function QueryBySQLParameters_setPrototypeOf(o, p) { QueryBySQLParameters_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLParameters_setPrototypeOf(o, p); }
  31207. 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); }; }
  31208. function QueryBySQLParameters_possibleConstructorReturn(self, call) { if (call && (QueryBySQLParameters_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLParameters_assertThisInitialized(self); }
  31209. function QueryBySQLParameters_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31210. function QueryBySQLParameters_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31211. function QueryBySQLParameters_getPrototypeOf(o) { QueryBySQLParameters_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLParameters_getPrototypeOf(o); }
  31212. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31213. * This program are made available under the terms of the Apache License, Version 2.0
  31214. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31215. /**
  31216. * @class SuperMap.QueryBySQLParameters
  31217. * @category iServer Map QueryResults
  31218. * @classdesc SQL 查询参数类。
  31219. * 该类用于设置 SQL 查询的相关参数。
  31220. * @extends {SuperMap.QueryParameters}
  31221. * @param {Object} options - 参数。
  31222. * @param {Array.<SuperMap.FilterParameter>} options.queryParams - 查询过滤条件参数数组。
  31223. * @param {string} [options.customParams] - 自定义参数,供扩展使用。
  31224. * @param {Object} [options.prjCoordSys] - 自定义参数,供 SuperMap Online 提供的动态投影查询扩展使用。如 {"epsgCode":3857}。
  31225. * @param {number} [options.expectCount=100000] - 期望返回结果记录个数。
  31226. * @param {SuperMap.GeometryType} [options.networkType=SuperMap.GeometryType.LINE] - 网络数据集对应的查询类型。
  31227. * @param {SuperMap.QueryOption} [options.queryOption=SuperMap.ATTRIBUTEANDGEOMETRY] - 查询结果类型枚举类。
  31228. * @param {number} [options.startRecord=0] - 查询起始记录号。
  31229. * @param {number} [options.holdTime=10] - 资源在服务端保存的时间,单位为分钟。
  31230. * @param {boolean} [options.returnCustomResult=false] - 仅供三维使用。
  31231. * @param {boolean} [options.returnContent=true] - 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31232. * @param {boolean} [options.returnFeatureWithFieldCaption = false] - 返回的查询结果要素字段标识是否为字段别名。为 false 时,返回的是字段名;为 true 时,返回的是字段别名。
  31233. */
  31234. var QueryBySQLParameters = /*#__PURE__*/function (_QueryParameters) {
  31235. QueryBySQLParameters_inherits(QueryBySQLParameters, _QueryParameters);
  31236. var _super = QueryBySQLParameters_createSuper(QueryBySQLParameters);
  31237. function QueryBySQLParameters(options) {
  31238. var _this;
  31239. QueryBySQLParameters_classCallCheck(this, QueryBySQLParameters);
  31240. if (!options) {
  31241. return QueryBySQLParameters_possibleConstructorReturn(_this);
  31242. }
  31243. _this = _super.call(this, options);
  31244. /**
  31245. * @member {boolean} [SuperMap.QueryBySQLParameters.prototype.returnContent=true]
  31246. * @description 是否立即返回新创建资源的表述还是返回新资源的 URI。
  31247. * 如果为 true,则直接返回新创建资源,即查询结果的表述。
  31248. * 为 false,则返回的是查询结果资源的 URI。
  31249. */
  31250. _this.returnContent = true;
  31251. Util.extend(QueryBySQLParameters_assertThisInitialized(_this), options);
  31252. _this.CLASS_NAME = "SuperMap.QueryBySQLParameters";
  31253. return _this;
  31254. }
  31255. /**
  31256. * @function SuperMap.QueryBySQLParameters.prototype.destroy
  31257. * @description 释放资源,将引用资源的属性置空。
  31258. */
  31259. QueryBySQLParameters_createClass(QueryBySQLParameters, [{
  31260. key: "destroy",
  31261. value: function destroy() {
  31262. QueryBySQLParameters_get(QueryBySQLParameters_getPrototypeOf(QueryBySQLParameters.prototype), "destroy", this).call(this);
  31263. var me = this;
  31264. me.returnContent = null;
  31265. }
  31266. }]);
  31267. return QueryBySQLParameters;
  31268. }(QueryParameters);
  31269. SuperMap.QueryBySQLParameters = QueryBySQLParameters;
  31270. ;// CONCATENATED MODULE: ./src/common/iServer/QueryBySQLService.js
  31271. function QueryBySQLService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { QueryBySQLService_typeof = function _typeof(obj) { return typeof obj; }; } else { QueryBySQLService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return QueryBySQLService_typeof(obj); }
  31272. function QueryBySQLService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31273. 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); } }
  31274. function QueryBySQLService_createClass(Constructor, protoProps, staticProps) { if (protoProps) QueryBySQLService_defineProperties(Constructor.prototype, protoProps); if (staticProps) QueryBySQLService_defineProperties(Constructor, staticProps); return Constructor; }
  31275. function QueryBySQLService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { QueryBySQLService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return QueryBySQLService_get(target, property, receiver || target); }
  31276. function QueryBySQLService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = QueryBySQLService_getPrototypeOf(object); if (object === null) break; } return object; }
  31277. 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 } }); if (superClass) QueryBySQLService_setPrototypeOf(subClass, superClass); }
  31278. function QueryBySQLService_setPrototypeOf(o, p) { QueryBySQLService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return QueryBySQLService_setPrototypeOf(o, p); }
  31279. 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); }; }
  31280. function QueryBySQLService_possibleConstructorReturn(self, call) { if (call && (QueryBySQLService_typeof(call) === "object" || typeof call === "function")) { return call; } return QueryBySQLService_assertThisInitialized(self); }
  31281. function QueryBySQLService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31282. function QueryBySQLService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31283. function QueryBySQLService_getPrototypeOf(o) { QueryBySQLService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return QueryBySQLService_getPrototypeOf(o); }
  31284. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31285. * This program are made available under the terms of the Apache License, Version 2.0
  31286. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31287. /**
  31288. * @class SuperMap.QueryBySQLService
  31289. * @category iServer Map QueryResults
  31290. * @classdesc SQL 查询服务类。在一个或多个指定的图层上查询符合 SQL 条件的空间地物信息。
  31291. * @extends {SuperMap.QueryService}
  31292. * @example
  31293. * var queryParam = new SuperMap.FilterParameter({
  31294. * name: "Countries@World.1",
  31295. * attributeFilter: "Pop_1994>1000000000 and SmArea>900"
  31296. * });
  31297. * var queryBySQLParams = new SuperMap.QueryBySQLParameters({
  31298. * queryParams: [queryParam]
  31299. * });
  31300. * var myQueryBySQLService = new SuperMap.QueryBySQLService(url, {eventListeners: {
  31301. * "processCompleted": queryCompleted,
  31302. * "processFailed": queryError
  31303. * }
  31304. * });
  31305. * queryBySQLService.processAsync(queryBySQLParams);
  31306. * function queryCompleted(object){//todo};
  31307. * function queryError(object){//todo};
  31308. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31309. * @param {Object} options - 参数。
  31310. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  31311. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  31312. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  31313. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31314. * @param {Object} [options.headers] - 请求头。
  31315. */
  31316. var QueryBySQLService = /*#__PURE__*/function (_QueryService) {
  31317. QueryBySQLService_inherits(QueryBySQLService, _QueryService);
  31318. var _super = QueryBySQLService_createSuper(QueryBySQLService);
  31319. /**
  31320. * @function SuperMap.QueryBySQLService.prototype.constructor
  31321. * @description SQL 查询服务类构造函数。
  31322. * @param {string} url - 服务的访问地址。如访问World Map服务,只需将url设为: http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 即可。
  31323. * @param {Object} options - 参数。
  31324. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31325. */
  31326. function QueryBySQLService(url, options) {
  31327. var _this;
  31328. QueryBySQLService_classCallCheck(this, QueryBySQLService);
  31329. _this = _super.call(this, url, options);
  31330. _this.CLASS_NAME = "SuperMap.QueryBySQLService";
  31331. return _this;
  31332. }
  31333. /**
  31334. * @override
  31335. */
  31336. QueryBySQLService_createClass(QueryBySQLService, [{
  31337. key: "destroy",
  31338. value: function destroy() {
  31339. QueryBySQLService_get(QueryBySQLService_getPrototypeOf(QueryBySQLService.prototype), "destroy", this).call(this);
  31340. }
  31341. /**
  31342. * @function SuperMap.QueryBySQLService.prototype.getJsonParameters
  31343. * @description 将查询参数转化为 JSON 字符串。
  31344. * 在本类中重写此方法,可以实现不同种类的查询(sql, geometry, distance, bounds等)。
  31345. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询参数类。
  31346. * @returns {Object} 转化后的 JSON 字符串。
  31347. */
  31348. }, {
  31349. key: "getJsonParameters",
  31350. value: function getJsonParameters(params) {
  31351. if (!(params instanceof QueryBySQLParameters)) {
  31352. return;
  31353. }
  31354. var me = this,
  31355. jsonParameters = "",
  31356. qp = null;
  31357. qp = me.getQueryParameters(params);
  31358. jsonParameters += "'queryMode':'SqlQuery','queryParameters':";
  31359. jsonParameters += Util.toJSON(qp);
  31360. jsonParameters = "{" + jsonParameters + "}";
  31361. return jsonParameters;
  31362. }
  31363. }]);
  31364. return QueryBySQLService;
  31365. }(QueryService);
  31366. SuperMap.QueryBySQLService = QueryBySQLService;
  31367. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureParameters.js
  31368. function RouteCalculateMeasureParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31369. 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); } }
  31370. function RouteCalculateMeasureParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31371. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31372. * This program are made available under the terms of the Apache License, Version 2.0
  31373. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31374. /**
  31375. * @class SuperMap.RouteCalculateMeasureParameters
  31376. * @category iServer SpatialAnalyst RouteCalculateMeasure
  31377. * @classdesc 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  31378. * @param {Object} options - 参数。
  31379. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  31380. * @param {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} options.point - 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  31381. * @param {float} [options.tolerance] - 容限值。
  31382. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。
  31383. */
  31384. var RouteCalculateMeasureParameters = /*#__PURE__*/function () {
  31385. function RouteCalculateMeasureParameters(options) {
  31386. RouteCalculateMeasureParameters_classCallCheck(this, RouteCalculateMeasureParameters);
  31387. if (!options) {
  31388. return this;
  31389. }
  31390. /**
  31391. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteCalculateMeasureParameters.prototype.sourceRoute
  31392. * @description 路由对象。该对象可以是用户自己生成或在数据源中查询得到的符合标准的路由对象。
  31393. */
  31394. this.sourceRoute = null;
  31395. /**
  31396. * @member {(SuperMap.Geometry.Point|L.LatLng|L.Point|ol.geom.Point)} SuperMap.RouteCalculateMeasureParameters.prototype.point
  31397. * @description 二维地理坐标点对象,包含 x,y 坐标值属性的对象。
  31398. */
  31399. this.point = null;
  31400. /**
  31401. * @member {float} [SuperMap.RouteCalculateMeasureParameters.prototype.tolerance]
  31402. * @description 容限值。
  31403. */
  31404. this.tolerance = null;
  31405. /**
  31406. * @member {boolean} [SuperMap.RouteCalculateMeasureParameters.prototype.isIgnoreGap=false]
  31407. * @description 是否忽略子对象之间的距离。
  31408. */
  31409. this.isIgnoreGap = false;
  31410. Util.extend(this, options);
  31411. this.CLASS_NAME = "SuperMap.RouteCalculateMeasureParameters";
  31412. }
  31413. /**
  31414. * @function SuperMap.RouteCalculateMeasureParameters.prototype.destroy
  31415. * @description 释放资源,将引用资源的属性置空。
  31416. */
  31417. RouteCalculateMeasureParameters_createClass(RouteCalculateMeasureParameters, [{
  31418. key: "destroy",
  31419. value: function destroy() {
  31420. var me = this;
  31421. me.sourceRoute = null;
  31422. me.point = null;
  31423. if (me.tolerance) {
  31424. me.tolerance = null;
  31425. }
  31426. if (me.isIgnoreGap) {
  31427. me.isIgnoreGap = false;
  31428. }
  31429. }
  31430. }]);
  31431. return RouteCalculateMeasureParameters;
  31432. }();
  31433. SuperMap.RouteCalculateMeasureParameters = RouteCalculateMeasureParameters;
  31434. ;// CONCATENATED MODULE: ./src/common/iServer/RouteCalculateMeasureService.js
  31435. function RouteCalculateMeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RouteCalculateMeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { RouteCalculateMeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RouteCalculateMeasureService_typeof(obj); }
  31436. function RouteCalculateMeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31437. 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); } }
  31438. function RouteCalculateMeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteCalculateMeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteCalculateMeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  31439. function RouteCalculateMeasureService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RouteCalculateMeasureService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return RouteCalculateMeasureService_get(target, property, receiver || target); }
  31440. function RouteCalculateMeasureService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteCalculateMeasureService_getPrototypeOf(object); if (object === null) break; } return object; }
  31441. 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 } }); if (superClass) RouteCalculateMeasureService_setPrototypeOf(subClass, superClass); }
  31442. function RouteCalculateMeasureService_setPrototypeOf(o, p) { RouteCalculateMeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteCalculateMeasureService_setPrototypeOf(o, p); }
  31443. 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); }; }
  31444. function RouteCalculateMeasureService_possibleConstructorReturn(self, call) { if (call && (RouteCalculateMeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteCalculateMeasureService_assertThisInitialized(self); }
  31445. function RouteCalculateMeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31446. function RouteCalculateMeasureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31447. function RouteCalculateMeasureService_getPrototypeOf(o) { RouteCalculateMeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteCalculateMeasureService_getPrototypeOf(o); }
  31448. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31449. * This program are made available under the terms of the Apache License, Version 2.0
  31450. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31451. /**
  31452. * @class SuperMap.RouteCalculateMeasureService
  31453. * @category iServer SpatialAnalyst RouteCalculateMeasure
  31454. * @classdesc 基于路由对象计算指定点 M 值操作的服务类。
  31455. * 该类负责将客户设置的计算指定点的 M 值参数传递给服务端,并接收服务端返回的
  31456. * 指定点的 M 值。通过该类支持的事件的监听函数参数获取。
  31457. * @extends {SuperMap.SpatialAnalystBase}
  31458. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  31459. * @param {Object} options - 参数。
  31460. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31461. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31462. * @param {Object} [options.headers] - 请求头。
  31463. * @example 实例化该类如下例所示:
  31464. * (start code)
  31465. * var parameters = new SuperMap.RouteCalculateMeasureParameters({
  31466. * "sourceRoute":{
  31467. * "type":"LINEM",
  31468. * "parts":[4],
  31469. * "points":[
  31470. * {
  31471. * "measure":0,
  31472. * "y":-6674.466867067764,
  31473. * "x":3817.3527876130133
  31474. * },
  31475. * {
  31476. * "measure":199.57954019411724,
  31477. * "y":-6670.830929417594,
  31478. * "x":3617.806369901496
  31479. * },
  31480. * {
  31481. * "measure":609.3656478634477,
  31482. * "y":-6877.837541432356,
  31483. * "x":3264.1498746678444
  31484. * },
  31485. * {
  31486. * "measure":936.0174126282958,
  31487. * "y":-7038.687780615184,
  31488. * "x":2979.846206068903
  31489. * }
  31490. * ]
  31491. * },
  31492. * "tolerance":1,
  31493. * "point":{
  31494. * "x":3330.7754269417,
  31495. * "y":-6838.8394457216
  31496. * },
  31497. * "isIgnoreGap":false
  31498. * });
  31499. *
  31500. * var routeCalculateMeasureService = new SuperMap.RouteCalculateMeasureService(spatialAnalystURL, {
  31501. * eventListeners:{
  31502. * processCompleted:calculateCompleted,
  31503. * processFailed:calculateFailded
  31504. * }
  31505. * );
  31506. * routeCalculateMeasureService.processAsync(parameters);
  31507. *
  31508. * //执行
  31509. * function calculateCompleted(){todo}
  31510. * function calculateFailded(){todo}
  31511. * (end)
  31512. *
  31513. */
  31514. var RouteCalculateMeasureService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31515. RouteCalculateMeasureService_inherits(RouteCalculateMeasureService, _SpatialAnalystBase);
  31516. var _super = RouteCalculateMeasureService_createSuper(RouteCalculateMeasureService);
  31517. function RouteCalculateMeasureService(url, options) {
  31518. var _this;
  31519. RouteCalculateMeasureService_classCallCheck(this, RouteCalculateMeasureService);
  31520. _this = _super.call(this, url, options);
  31521. _this.CLASS_NAME = "SuperMap.RouteCalculateMeasureService";
  31522. return _this;
  31523. }
  31524. /**
  31525. * @override
  31526. */
  31527. RouteCalculateMeasureService_createClass(RouteCalculateMeasureService, [{
  31528. key: "destroy",
  31529. value: function destroy() {
  31530. RouteCalculateMeasureService_get(RouteCalculateMeasureService_getPrototypeOf(RouteCalculateMeasureService.prototype), "destroy", this).call(this);
  31531. }
  31532. /**
  31533. * @function SuperMap.RouteCalculateMeasureService.prototype.processAsync
  31534. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  31535. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  31536. */
  31537. }, {
  31538. key: "processAsync",
  31539. value: function processAsync(params) {
  31540. if (!(params instanceof RouteCalculateMeasureParameters)) {
  31541. return;
  31542. }
  31543. var me = this,
  31544. jsonParameters;
  31545. jsonParameters = me.getJsonParameters(params);
  31546. me.request({
  31547. method: "POST",
  31548. data: jsonParameters,
  31549. scope: me,
  31550. success: me.serviceProcessCompleted,
  31551. failure: me.serviceProcessFailed
  31552. });
  31553. }
  31554. /**
  31555. * @function SuperMap.RouteCalculateMeasureService.prototype.getJsonParameters
  31556. * @description 将参数转化为 JSON 字符串。
  31557. * @param {SuperMap.RouteCalculateMeasureParameters} params - 基于路由对象计算指定点 M 值操作的参数类。
  31558. * @returns {Object} 转化后的 JSON 字符串。
  31559. */
  31560. }, {
  31561. key: "getJsonParameters",
  31562. value: function getJsonParameters(params) {
  31563. var jsonParameters,
  31564. jsonStr = "geometry/calculatemeasure",
  31565. me = this;
  31566. me.url = Util.urlPathAppend(me.url, jsonStr);
  31567. me.url = Util.urlAppend(me.url, 'returnContent=true');
  31568. jsonParameters = Util.toJSON(params);
  31569. return jsonParameters;
  31570. }
  31571. }]);
  31572. return RouteCalculateMeasureService;
  31573. }(SpatialAnalystBase);
  31574. SuperMap.RouteCalculateMeasureService = RouteCalculateMeasureService;
  31575. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorParameters.js
  31576. function RouteLocatorParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31577. 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); } }
  31578. function RouteLocatorParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31579. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31580. * This program are made available under the terms of the Apache License, Version 2.0
  31581. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31582. /**
  31583. * @class SuperMap.RouteLocatorParameters
  31584. * @category iServer SpatialAnalyst RouteLocator
  31585. * @classdesc 路由对象定位空间对象的参数类。
  31586. * 参数有两种方式,分别为 Geometry 和 Dataset 两种,前者需要指定 sourceRoute 对象作为参数,后者需要 dataset,routeIDField,routeID 三个参数
  31587. * 如果用户两种参数均设置,优先选择 Dataset 方式。
  31588. * @param {Object} options - 参数。
  31589. * @param {(SuperMap.Route|L.Polyline|ol.geom.LineString)} options.sourceRoute - 路由对象。
  31590. * @param {float} options.measure - 定位点的 M 值。只当路由对象定位点时有意义。
  31591. * @param {string} [options.type] - 类型:点 or 线。
  31592. * @param {float} [options.offset=0] - 定位点偏移量。只当路由对象定位点时有意义。
  31593. * @param {boolean} [options.isIgnoreGap=false] - 是否忽略子对象之间的距离。即不忽略子对象之间的距离。
  31594. * @param {float} [options.startMeasure] - 定位线的起始 M 值。只当路由对象定位线时有意义。
  31595. * @param {float} [options.endMeasure] - 定位线的终止 M 值。只当路由对象定位线时有意义。
  31596. */
  31597. var RouteLocatorParameters = /*#__PURE__*/function () {
  31598. function RouteLocatorParameters(options) {
  31599. RouteLocatorParameters_classCallCheck(this, RouteLocatorParameters);
  31600. if (!options) {
  31601. return this;
  31602. }
  31603. /**
  31604. * @member {(SuperMap.Route|L.Polyline|ol.geom.LineString)} SuperMap.RouteLocatorParameters.prototype.sourceRoute
  31605. * @description 路由对象。
  31606. */
  31607. this.sourceRoute = null;
  31608. /**
  31609. * @member {string} SuperMap.RouteLocatorParameters.prototype.dataset
  31610. * @description 要用来做缓冲区分析的数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示。
  31611. */
  31612. this.dataset = null;
  31613. /**
  31614. * @member {string} SuperMap.RouteLocatorParameters.prototype.routeIDField
  31615. * @description 路由对象所在的字段名称。
  31616. *
  31617. */
  31618. this.routeIDField = null;
  31619. /**
  31620. * @member {number} SuperMap.RouteLocatorParameters.prototype.routeID
  31621. * @description 路由对象标识。
  31622. *
  31623. */
  31624. this.routeID = null;
  31625. /**
  31626. * @member {string} [SuperMap.RouteLocatorParameters.prototype.type]
  31627. * @description 类型:点 or 线。
  31628. * 可选值为:
  31629. * LINE :根据起始 M 值及终止 M 值定位线对象。
  31630. * POINT : 根据 M 值定位点对象。
  31631. */
  31632. this.type = null;
  31633. /**
  31634. * @member {float} SuperMap.RouteLocatorParameters.prototype.measure
  31635. * @description 定位点的 M 值。只当路由对象定位点时有意义。
  31636. */
  31637. this.measure = null;
  31638. /**
  31639. * @member {float} [SuperMap.RouteLocatorParameters.prototype.offset=0]
  31640. * @description 定位点偏移量。只当路由对象定位点时有意义。
  31641. */
  31642. this.offset = 0;
  31643. /**
  31644. * @member {boolean} [SuperMap.RouteLocatorParameters.prototype.isIgnoreGap=false]
  31645. * @description 是否忽略子对象之间的距离。
  31646. */
  31647. this.isIgnoreGap = false;
  31648. /**
  31649. * @member {float} [SuperMap.RouteLocatorParameters.prototype.startMeasure]
  31650. * @description 定位线的起始 M 值。只当路由对象定位线时有意义。
  31651. */
  31652. this.startMeasure = null;
  31653. /**
  31654. * @member {float} [SuperMap.RouteLocatorParameters.prototype.endMeasure]
  31655. * @description 定位线的终止 M 值。只当路由对象定位线时有意义。
  31656. */
  31657. this.endMeasure = null;
  31658. var routeFromClient = options.sourceRoute;
  31659. var routeHandle = {};
  31660. if (routeFromClient && routeFromClient instanceof Geometry && routeFromClient.components) {
  31661. routeHandle.type = routeFromClient.type;
  31662. routeHandle.parts = routeFromClient.parts;
  31663. var parts = [];
  31664. for (var i = 0, len = routeFromClient.components.length; i < len; i++) {
  31665. parts = parts.concat(routeFromClient.components[i].components);
  31666. }
  31667. routeHandle.points = parts;
  31668. options.sourceRoute = routeHandle;
  31669. }
  31670. Util.extend(this, options);
  31671. this.CLASS_NAME = "SuperMap.RouteLocatorParameters";
  31672. }
  31673. /**
  31674. * @function SuperMap.RouteLocatorParameters.prototype.destroy
  31675. * @description 释放资源,将引用资源的属性置空。
  31676. */
  31677. RouteLocatorParameters_createClass(RouteLocatorParameters, [{
  31678. key: "destroy",
  31679. value: function destroy() {
  31680. var me = this;
  31681. me.sourceRoute = null;
  31682. me.type = null;
  31683. me.measure = null;
  31684. me.offset = 0;
  31685. me.isIgnoreGap = false;
  31686. me.startMeasure = null;
  31687. me.endMeasure = null;
  31688. me.dataset = null;
  31689. me.routeID = null;
  31690. me.routeIDField = null;
  31691. }
  31692. }]);
  31693. return RouteLocatorParameters;
  31694. }();
  31695. SuperMap.RouteLocatorParameters = RouteLocatorParameters;
  31696. ;// CONCATENATED MODULE: ./src/common/iServer/RouteLocatorService.js
  31697. function RouteLocatorService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RouteLocatorService_typeof = function _typeof(obj) { return typeof obj; }; } else { RouteLocatorService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RouteLocatorService_typeof(obj); }
  31698. function RouteLocatorService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31699. 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); } }
  31700. function RouteLocatorService_createClass(Constructor, protoProps, staticProps) { if (protoProps) RouteLocatorService_defineProperties(Constructor.prototype, protoProps); if (staticProps) RouteLocatorService_defineProperties(Constructor, staticProps); return Constructor; }
  31701. function RouteLocatorService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RouteLocatorService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return RouteLocatorService_get(target, property, receiver || target); }
  31702. function RouteLocatorService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RouteLocatorService_getPrototypeOf(object); if (object === null) break; } return object; }
  31703. 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 } }); if (superClass) RouteLocatorService_setPrototypeOf(subClass, superClass); }
  31704. function RouteLocatorService_setPrototypeOf(o, p) { RouteLocatorService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RouteLocatorService_setPrototypeOf(o, p); }
  31705. 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); }; }
  31706. function RouteLocatorService_possibleConstructorReturn(self, call) { if (call && (RouteLocatorService_typeof(call) === "object" || typeof call === "function")) { return call; } return RouteLocatorService_assertThisInitialized(self); }
  31707. function RouteLocatorService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  31708. function RouteLocatorService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  31709. function RouteLocatorService_getPrototypeOf(o) { RouteLocatorService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RouteLocatorService_getPrototypeOf(o); }
  31710. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31711. * This program are made available under the terms of the Apache License, Version 2.0
  31712. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31713. /**
  31714. * @class SuperMap.RouteLocatorService
  31715. * @category iServer SpatialAnalyst RouteLocator
  31716. * @classdesc 路由对象定位空间对象的服务类。
  31717. * @extends {SuperMap.SpatialAnalystBase}
  31718. * @param {string} url -服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  31719. * @param {Object} options - 参数。</br>
  31720. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  31721. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  31722. * @param {Object} [options.headers] - 请求头。
  31723. * @example 实例化该类如下例所示:
  31724. * (start code)
  31725. * var routeLocatorParameters_point = new SuperMap.RouteLocatorParameters({
  31726. * "sourceRoute":{
  31727. * "type":"LINEM",
  31728. * "parts":[4],
  31729. * "points":[
  31730. * {
  31731. * "measure":0,
  31732. * "y":-6674.466867067764,
  31733. * "x":3817.3527876130133
  31734. * },
  31735. * {
  31736. * "measure":199.57954019411724,
  31737. * "y":-6670.830929417594,
  31738. * "x":3617.806369901496
  31739. * },
  31740. * {
  31741. * "measure":609.3656478634477,
  31742. * "y":-6877.837541432356,
  31743. * "x":3264.1498746678444
  31744. * },
  31745. * {
  31746. * "measure":936.0174126282958,
  31747. * "y":-7038.687780615184,
  31748. * "x":2979.846206068903
  31749. * }
  31750. * ]
  31751. * },
  31752. * "type":"POINT",
  31753. * "measure":10,
  31754. * "offset":3,
  31755. * "isIgnoreGap":true
  31756. * });
  31757. * var routeLocatorService = new SuperMap.RouteLocatorService(spatialAnalystURL, {
  31758. * eventListeners:{
  31759. * processCompleted:routeLocatorCompleted,
  31760. * processFailed:routeLocatorFailded
  31761. * }
  31762. * );
  31763. * routeLocatorService.processAsync(routeLocatorParameters_point);
  31764. *
  31765. * //执行
  31766. * function routeLocatorCompleted(){todo}
  31767. * function routeLocatorFailded(){todo}
  31768. * (end)
  31769. *
  31770. */
  31771. var RouteLocatorService = /*#__PURE__*/function (_SpatialAnalystBase) {
  31772. RouteLocatorService_inherits(RouteLocatorService, _SpatialAnalystBase);
  31773. var _super = RouteLocatorService_createSuper(RouteLocatorService);
  31774. function RouteLocatorService(url, options) {
  31775. var _this;
  31776. RouteLocatorService_classCallCheck(this, RouteLocatorService);
  31777. _this = _super.call(this, url, options);
  31778. _this.CLASS_NAME = "SuperMap.RouteLocatorService";
  31779. return _this;
  31780. }
  31781. /**
  31782. * @override
  31783. */
  31784. RouteLocatorService_createClass(RouteLocatorService, [{
  31785. key: "destroy",
  31786. value: function destroy() {
  31787. RouteLocatorService_get(RouteLocatorService_getPrototypeOf(RouteLocatorService.prototype), "destroy", this).call(this);
  31788. }
  31789. /**
  31790. * @function SuperMap.RouteLocatorService.prototype.processAsync
  31791. * @description 负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
  31792. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  31793. */
  31794. }, {
  31795. key: "processAsync",
  31796. value: function processAsync(params) {
  31797. if (!(params instanceof RouteLocatorParameters)) {
  31798. return;
  31799. }
  31800. var me = this,
  31801. jsonParameters;
  31802. jsonParameters = me.getJsonParameters(params);
  31803. me.request({
  31804. method: "POST",
  31805. data: jsonParameters,
  31806. scope: me,
  31807. success: me.serviceProcessCompleted,
  31808. failure: me.serviceProcessFailed
  31809. });
  31810. }
  31811. /**
  31812. * @function SuperMap.RouteLocatorService.prototype.processAsync
  31813. * @description 将参数转化为 JSON 字符串。
  31814. * @param {SuperMap.RouteLocatorParameters} params - 路由对象定位空间对象的参数类。
  31815. * @returns {Object} 转化后的JSON字符串。
  31816. */
  31817. }, {
  31818. key: "getJsonParameters",
  31819. value: function getJsonParameters(params) {
  31820. var jsonParameters,
  31821. jsonStr = "geometry/routelocator",
  31822. me = this;
  31823. if (params.dataset) {
  31824. jsonStr = "datasets/" + params.dataset + "/linearreferencing/routelocator";
  31825. params.sourceRoute = null;
  31826. }
  31827. me.url = Util.urlPathAppend(me.url, jsonStr);
  31828. me.url = Util.urlAppend(me.url, 'returnContent=true');
  31829. jsonParameters = Util.toJSON(params);
  31830. return jsonParameters;
  31831. }
  31832. }]);
  31833. return RouteLocatorService;
  31834. }(SpatialAnalystBase);
  31835. SuperMap.RouteLocatorService = RouteLocatorService;
  31836. ;// CONCATENATED MODULE: ./src/common/iServer/ServerFeature.js
  31837. function ServerFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31838. 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); } }
  31839. function ServerFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ServerFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ServerFeature_defineProperties(Constructor, staticProps); return Constructor; }
  31840. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31841. * This program are made available under the terms of the Apache License, Version 2.0
  31842. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31843. /**
  31844. * @class SuperMap.ServerFeature
  31845. * @category iServer
  31846. * @classdesc 服务端矢量要素类。该类描述了服务端返回的矢量要素的相关信息,包括字段和几何信息。
  31847. * @param {Object} options - 参数。
  31848. * @param {SuperMap.ServerGeometry} geometry - 矢量要素的几何信息。
  31849. * @param {Array.<string>} [options.fieldNames] - 矢量要素的属性字段名集合。
  31850. * @param {Array.<string>} [options.fieldValues] - 矢量要素的属性字段值集合。
  31851. */
  31852. var ServerFeature = /*#__PURE__*/function () {
  31853. function ServerFeature(options) {
  31854. ServerFeature_classCallCheck(this, ServerFeature);
  31855. /**
  31856. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldNames]
  31857. * @description 矢量要素的属性字段名集合。
  31858. */
  31859. this.fieldNames = null;
  31860. /**
  31861. * @member {Array.<string>} [SuperMap.ServerFeature.prototype.fieldValues]
  31862. * @description 矢量要素的属性字段值集合。
  31863. */
  31864. this.fieldValues = null;
  31865. /**
  31866. * @member {SuperMap.ServerGeometry} SuperMap.ServerFeature.prototype.geometry
  31867. * @description 矢量要素的几何信息。
  31868. */
  31869. this.geometry = null;
  31870. if (options) {
  31871. Util.extend(this, options);
  31872. }
  31873. this.CLASS_NAME = "SuperMap.ServerFeature";
  31874. }
  31875. /**
  31876. * @function SuperMap.ServerFeature.prototype.destroy
  31877. * @description 释放资源,将引用资源的属性置空。
  31878. */
  31879. ServerFeature_createClass(ServerFeature, [{
  31880. key: "destroy",
  31881. value: function destroy() {
  31882. var me = this;
  31883. me.fieldNames = null;
  31884. me.fieldValues = null;
  31885. if (me.geometry) {
  31886. me.geometry.destroy();
  31887. me.geometry = null;
  31888. }
  31889. }
  31890. /**
  31891. * @function SuperMap.ServerFeature.prototype.toFeature
  31892. * @description 将服务端矢量要素 ServerFeature 转换为客户端矢量要素 Feature。
  31893. * @returns {SuperMap.Vector} 转换后的客户端矢量要素。
  31894. */
  31895. }, {
  31896. key: "toFeature",
  31897. value: function toFeature() {
  31898. var names,
  31899. values,
  31900. geo,
  31901. attr = {},
  31902. me = this,
  31903. feature;
  31904. names = me.fieldNames;
  31905. values = me.fieldValues;
  31906. for (var i in names) {
  31907. attr[names[i]] = values[i];
  31908. }
  31909. if (me.geometry) {
  31910. geo = me.geometry.toGeometry();
  31911. }
  31912. feature = new Vector(geo, attr);
  31913. if (me.geometry && me.geometry.id) {
  31914. feature.fid = me.geometry.id;
  31915. }
  31916. return feature;
  31917. }
  31918. /**
  31919. * @function SuperMap.ServerFeature.prototype.fromJson
  31920. * @description 将 JSON 对象表示服务端矢量要素转换为 ServerFeature。
  31921. * @param {Object} jsonObject - 要转换的 JSON 对象。
  31922. * @returns {SuperMap.ServerFeature} 转化后的 ServerFeature 对象。
  31923. */
  31924. }], [{
  31925. key: "fromJson",
  31926. value: function fromJson(jsonObject) {
  31927. var geo = null;
  31928. if (!jsonObject) {
  31929. return;
  31930. }
  31931. geo = jsonObject.geometry;
  31932. if (geo) {
  31933. geo = ServerGeometry.fromJson(geo);
  31934. }
  31935. return new ServerFeature({
  31936. fieldNames: jsonObject.fieldNames,
  31937. fieldValues: jsonObject.fieldValues,
  31938. geometry: geo
  31939. });
  31940. }
  31941. }]);
  31942. return ServerFeature;
  31943. }();
  31944. SuperMap.ServerFeature = ServerFeature;
  31945. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoParameters.js
  31946. function SetLayerInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  31947. 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); } }
  31948. function SetLayerInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  31949. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  31950. * This program are made available under the terms of the Apache License, Version 2.0
  31951. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  31952. /**
  31953. * @class SuperMap.SetLayerInfoParameters
  31954. * @category iServer Map TempLayersSet
  31955. * @classdesc 设置图层信息参数类.
  31956. * @param {Object} options - 参数。
  31957. * @param {string} options.resourceID - 临时图层的资源 ID。
  31958. * @param {string} options.tempLayerName - 临时图层下的子图层名。
  31959. * @param {string} options.layerInfo - 要更新的图层信息。
  31960. */
  31961. var SetLayerInfoParameters = /*#__PURE__*/function () {
  31962. function SetLayerInfoParameters(options) {
  31963. SetLayerInfoParameters_classCallCheck(this, SetLayerInfoParameters);
  31964. options = options || {};
  31965. /**
  31966. * @member {string} SuperMap.SetLayerInfoParameters.prototype.resourceID
  31967. * @description 临时图层的资源 ID。
  31968. */
  31969. this.resourceID = null;
  31970. /**
  31971. * @member {string} SuperMap.SetLayerInfoParameters.prototype.tempLayerName
  31972. * @description 临时图层下子图层(或者其子图层)名,如:Countries@World.3@@World。
  31973. */
  31974. this.tempLayerName = null;
  31975. /**
  31976. * @member {Object} SuperMap.SetLayerInfoParameters.prototype.layerInfo
  31977. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  31978. */
  31979. this.layerInfo = null;
  31980. Util.extend(this, options);
  31981. this.CLASS_NAME = "SuperMap.SetLayerInfoParameters";
  31982. }
  31983. /**
  31984. * @function SuperMap.SetLayerInfoParameters.prototype.destroy
  31985. * @description 释放资源,将引用资源的属性置空。
  31986. */
  31987. SetLayerInfoParameters_createClass(SetLayerInfoParameters, [{
  31988. key: "destroy",
  31989. value: function destroy() {
  31990. var me = this;
  31991. me.resourceID = null;
  31992. me.tempLayerName = null;
  31993. me.layerInfo = null;
  31994. }
  31995. }]);
  31996. return SetLayerInfoParameters;
  31997. }();
  31998. SuperMap.SetLayerInfoParameters = SetLayerInfoParameters;
  31999. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerInfoService.js
  32000. function SetLayerInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayerInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayerInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayerInfoService_typeof(obj); }
  32001. function SetLayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32002. 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); } }
  32003. function SetLayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  32004. function SetLayerInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerInfoService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SetLayerInfoService_get(target, property, receiver || target); }
  32005. function SetLayerInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  32006. 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 } }); if (superClass) SetLayerInfoService_setPrototypeOf(subClass, superClass); }
  32007. function SetLayerInfoService_setPrototypeOf(o, p) { SetLayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerInfoService_setPrototypeOf(o, p); }
  32008. 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); }; }
  32009. function SetLayerInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerInfoService_assertThisInitialized(self); }
  32010. function SetLayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32011. function SetLayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32012. function SetLayerInfoService_getPrototypeOf(o) { SetLayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerInfoService_getPrototypeOf(o); }
  32013. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32014. * This program are made available under the terms of the Apache License, Version 2.0
  32015. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32016. /**
  32017. * @class SuperMap.SetLayerInfoService
  32018. * @category iServer Map TempLayersSet
  32019. * @classdesc 设置图层信息服务类。可以实现临时图层中子图层的修改
  32020. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  32021. * @extends {SuperMap.CommonServiceBase}
  32022. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  32023. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World";
  32024. * @param {Object} options - 参数。
  32025. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32026. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32027. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32028. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32029. * @param {Object} [options.headers] - 请求头。
  32030. */
  32031. var SetLayerInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  32032. SetLayerInfoService_inherits(SetLayerInfoService, _CommonServiceBase);
  32033. var _super = SetLayerInfoService_createSuper(SetLayerInfoService);
  32034. function SetLayerInfoService(url, options) {
  32035. var _this;
  32036. SetLayerInfoService_classCallCheck(this, SetLayerInfoService);
  32037. _this = _super.call(this, url, options);
  32038. if (options) {
  32039. Util.extend(SetLayerInfoService_assertThisInitialized(_this), options);
  32040. }
  32041. _this.CLASS_NAME = "SuperMap.SetLayerInfoService";
  32042. return _this;
  32043. }
  32044. /**
  32045. * @override
  32046. */
  32047. SetLayerInfoService_createClass(SetLayerInfoService, [{
  32048. key: "destroy",
  32049. value: function destroy() {
  32050. SetLayerInfoService_get(SetLayerInfoService_getPrototypeOf(SetLayerInfoService.prototype), "destroy", this).call(this);
  32051. Util.reset(this);
  32052. }
  32053. /**
  32054. * @function SuperMap.SetLayerInfoService.prototype.processAsync
  32055. * @description 负责将客户端的更新参数传递到服务端。
  32056. * @param {Object} params - 修改后的图层资源信息。
  32057. * 该参数可以使用获取图层信息服务<{@link SuperMap.GetLayersInfoService}>返回图层信息,解析结果result.subLayers.layers[i],然后对其属性进行修改来获取。
  32058. */
  32059. }, {
  32060. key: "processAsync",
  32061. value: function processAsync(params) {
  32062. if (!params) {
  32063. return;
  32064. }
  32065. var me = this;
  32066. var jsonParamsStr = Util.toJSON(params);
  32067. me.request({
  32068. method: "PUT",
  32069. data: jsonParamsStr,
  32070. scope: me,
  32071. success: me.serviceProcessCompleted,
  32072. failure: me.serviceProcessFailed
  32073. });
  32074. }
  32075. }]);
  32076. return SetLayerInfoService;
  32077. }(CommonServiceBase);
  32078. SuperMap.SetLayerInfoService = SetLayerInfoService;
  32079. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoParameters.js
  32080. function SetLayersInfoParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32081. 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); } }
  32082. function SetLayersInfoParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32083. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32084. * This program are made available under the terms of the Apache License, Version 2.0
  32085. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32086. /**
  32087. * @class SuperMap.SetLayersInfoParameters
  32088. * @category iServer Map TempLayersSet
  32089. * @classdesc 设置图层信息参数类。
  32090. * @param {Object} options - 参数。
  32091. * @param {boolean} [options.isTempLayers=false] - 是否是临时图层。
  32092. * @param {string} options.resourceID - 临时图层资源 ID。
  32093. * @param {string} options.layersInfo - 要更新的图层信息。
  32094. */
  32095. var SetLayersInfoParameters = /*#__PURE__*/function () {
  32096. function SetLayersInfoParameters(options) {
  32097. SetLayersInfoParameters_classCallCheck(this, SetLayersInfoParameters);
  32098. options = options || {};
  32099. /**
  32100. * @member {boolean} [SuperMap.SetLayersInfoParameters.prototype.isTempLayers=false]
  32101. * @description 是否是临时图层。
  32102. */
  32103. this.isTempLayers = null;
  32104. /**
  32105. * @member {string} SuperMap.SetLayersInfoParameters.prototype.resourceID
  32106. * @description 临时图层资源 ID,
  32107. */
  32108. this.resourceID = null;
  32109. /**
  32110. * @member {Object} SuperMap.SetLayersInfoParameters.prototype.layersInfo
  32111. * @description 要更新的图层信息(包含修改和未修改的所有字段)。该参数可以通过图层信息服务获取,然后对返回值中 subLayers.layers[i] 图层信息属性进行修改。
  32112. */
  32113. this.layersInfo = null;
  32114. Util.extend(this, options);
  32115. this.CLASS_NAME = "SuperMap.SetLayersInfoParameters";
  32116. }
  32117. /**
  32118. * @function SuperMap.SetLayersInfoParameters.prototype.destroy
  32119. * @description 释放资源,将引用资源的属性置空。
  32120. */
  32121. SetLayersInfoParameters_createClass(SetLayersInfoParameters, [{
  32122. key: "destroy",
  32123. value: function destroy() {
  32124. var me = this;
  32125. me.isTempLayers = null;
  32126. me.resourceID = null;
  32127. me.layersInfo = null;
  32128. }
  32129. }]);
  32130. return SetLayersInfoParameters;
  32131. }();
  32132. SuperMap.SetLayersInfoParameters = SetLayersInfoParameters;
  32133. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayersInfoService.js
  32134. function SetLayersInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayersInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayersInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayersInfoService_typeof(obj); }
  32135. function SetLayersInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32136. 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); } }
  32137. function SetLayersInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayersInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayersInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  32138. function SetLayersInfoService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayersInfoService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SetLayersInfoService_get(target, property, receiver || target); }
  32139. function SetLayersInfoService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayersInfoService_getPrototypeOf(object); if (object === null) break; } return object; }
  32140. 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 } }); if (superClass) SetLayersInfoService_setPrototypeOf(subClass, superClass); }
  32141. function SetLayersInfoService_setPrototypeOf(o, p) { SetLayersInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayersInfoService_setPrototypeOf(o, p); }
  32142. 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); }; }
  32143. function SetLayersInfoService_possibleConstructorReturn(self, call) { if (call && (SetLayersInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayersInfoService_assertThisInitialized(self); }
  32144. function SetLayersInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32145. function SetLayersInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32146. function SetLayersInfoService_getPrototypeOf(o) { SetLayersInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayersInfoService_getPrototypeOf(o); }
  32147. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32148. * This program are made available under the terms of the Apache License, Version 2.0
  32149. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32150. /**
  32151. * @class SuperMap.SetLayersInfoService
  32152. * @category iServer Map TempLayersSet
  32153. * @classdesc 设置图层信息服务类。可以实现创建新的临时图层和对现有临时图层的修改,
  32154. * 当 isTempLayers 为 false的时候执行创建临时图层。当 isTempLayers 为 ture 并且临时图层资源 resourceID 被设置有效时执行对临时图层的编辑。
  32155. * 该类负责将图层设置参数传递到服务端,并获取服务端返回的结果信息。
  32156. * @extends {SuperMap.CommonServiceBase}
  32157. * @param url - {string} 与客户端交互的地图服务地址。请求地图服务,URL 应为:
  32158. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  32159. * @param {Object} options - 参数。
  32160. * @param {string} options.resourceID - 图层资源ID,临时图层的资源ID标记。
  32161. * @param {boolean} options.isTempLayers - 当前url对应的图层是否是临时图层。
  32162. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32163. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32164. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32165. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32166. * @param {Object} [options.headers] - 请求头。
  32167. */
  32168. var SetLayersInfoService = /*#__PURE__*/function (_CommonServiceBase) {
  32169. SetLayersInfoService_inherits(SetLayersInfoService, _CommonServiceBase);
  32170. var _super = SetLayersInfoService_createSuper(SetLayersInfoService);
  32171. function SetLayersInfoService(url, options) {
  32172. var _this;
  32173. SetLayersInfoService_classCallCheck(this, SetLayersInfoService);
  32174. _this = _super.call(this, url, options);
  32175. /**
  32176. * @member {string} SuperMap.SetLayersInfoService.prototype.resourceID
  32177. * @description 图层资源ID,临时图层的资源ID标记。
  32178. */
  32179. _this.resourceID = null;
  32180. /**
  32181. * @function {boolean} SuperMap.SetLayersInfoService.prototype.isTempLayers
  32182. * @description 当前url对应的图层是否是临时图层。
  32183. */
  32184. _this.isTempLayers = false;
  32185. if (options) {
  32186. SuperMap.Util.extend(SetLayersInfoService_assertThisInitialized(_this), options);
  32187. }
  32188. _this.CLASS_NAME = "SuperMap.SetLayersInfoService";
  32189. return _this;
  32190. }
  32191. /**
  32192. * @override
  32193. */
  32194. SetLayersInfoService_createClass(SetLayersInfoService, [{
  32195. key: "destroy",
  32196. value: function destroy() {
  32197. SetLayersInfoService_get(SetLayersInfoService_getPrototypeOf(SetLayersInfoService.prototype), "destroy", this).call(this);
  32198. Util.reset(this);
  32199. }
  32200. /**
  32201. * @function SuperMap.SetLayersInfoService.prototype.processAsync
  32202. * @description 负责将客户端的更新参数传递到服务端。
  32203. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务 <{@link SuperMap.GetLayersInfoService}>返回图层信息,然后对其属性进行修改来获取。
  32204. */
  32205. }, {
  32206. key: "processAsync",
  32207. value: function processAsync(params) {
  32208. if (!params) {
  32209. return;
  32210. }
  32211. var jsonParams,
  32212. subLayers = [],
  32213. me = this,
  32214. method = ""; //创建临时图层和设置修改临时图层信息对应不同的资源URL
  32215. if (me.isTempLayers) {
  32216. me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + me.resourceID);
  32217. method = "PUT";
  32218. } else {
  32219. me.url = Util.urlPathAppend(me.url, "tempLayersSet");
  32220. method = "POST";
  32221. }
  32222. if (!params.subLayers) {
  32223. params.subLayers = {
  32224. layers: []
  32225. };
  32226. }
  32227. if (!params.subLayers.layers) {
  32228. params.subLayers.layers = [];
  32229. }
  32230. var layers = params.subLayers.layers,
  32231. len = layers.length;
  32232. for (var i in layers) {
  32233. if (layers[i].ugcLayerType === "GRID") {
  32234. var colorDictionary = {};
  32235. var colorDics = layers[i].colorDictionarys;
  32236. for (var j in colorDics) {
  32237. var key = colorDics[j].elevation;
  32238. colorDictionary[key] = colorDics[j].color;
  32239. }
  32240. }
  32241. layers[i].colorDictionary = colorDictionary;
  32242. delete layers[i].colorDictionarys;
  32243. }
  32244. for (var _i = 0; _i < len; _i++) {
  32245. if (layers[_i].toJsonObject) {
  32246. //将图层信息转换成服务端能识别的简单json对象
  32247. subLayers.push(layers[_i].toJsonObject());
  32248. } else {
  32249. subLayers.push(layers[_i]);
  32250. }
  32251. }
  32252. jsonParams = Util.extend(jsonParams, params);
  32253. jsonParams.subLayers = {
  32254. "layers": subLayers
  32255. };
  32256. jsonParams.object = null;
  32257. var jsonParamsStr = Util.toJSON([jsonParams]);
  32258. me.request({
  32259. method: method,
  32260. data: jsonParamsStr,
  32261. scope: me,
  32262. success: me.serviceProcessCompleted,
  32263. failure: me.serviceProcessFailed
  32264. });
  32265. }
  32266. }]);
  32267. return SetLayersInfoService;
  32268. }(CommonServiceBase);
  32269. SuperMap.SetLayersInfoService = SetLayersInfoService;
  32270. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusParameters.js
  32271. function SetLayerStatusParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32272. 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); } }
  32273. function SetLayerStatusParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32274. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32275. * This program are made available under the terms of the Apache License, Version 2.0
  32276. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32277. /**
  32278. * @class SuperMap.SetLayerStatusParameters
  32279. * @category iServer Map TempLayersSet
  32280. * @classdesc 子图层显示控制参数类,该类存储了各子图层是否可见的状态。
  32281. * 注意在 SuperMap iClient 系列产品中所说的图层与 SuperMap Deskpro 的地图对应,子图层与 SuperMap Deskpro 的图层对应。
  32282. * @param {Object} options - 参数。
  32283. * @param {Array.<SuperMap.LayerStatus>} options.layerStatusList - 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,
  32284. * 集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  32285. * @param {number} [options.holdTime=15] - 获取或设置资源在服务端保存的时间。
  32286. * @param {string} [options.resourceID] - 获取或设置资源服务 ID。
  32287. */
  32288. var SetLayerStatusParameters = /*#__PURE__*/function () {
  32289. function SetLayerStatusParameters(options) {
  32290. SetLayerStatusParameters_classCallCheck(this, SetLayerStatusParameters);
  32291. /**
  32292. * @member {Array.<SuperMap.LayerStatus>} SuperMap.SetLayerStatusParameters.prototype.layerStatusList
  32293. * @description 获取或设置图层可见状态({@link SuperMap.LayerStatus})集合,集合中的每个 {@link SuperMap.LayerStatus} 对象代表一个子图层的可视状态。
  32294. */
  32295. this.layerStatusList = [];
  32296. /**
  32297. * @member {number} [SuperMap.SetLayerStatusParameters.prototype.holdTime=15]
  32298. * @description 获取或设置资源在服务端保存的时间。单位为分钟。
  32299. */
  32300. this.holdTime = 15;
  32301. /**
  32302. * @member {string} SuperMap.SetLayerStatusParameters.prototype.resourceID
  32303. * @description 获取或设置资源服务ID。如果设置该参数则会在指定的 TempLayer 进行图层的显示控制;
  32304. * 如果不设置该参数,则会首先创建一个 TempLayer ,然后在新创建的 TempLayer 进行图层的显示控制。
  32305. */
  32306. this.resourceID = null;
  32307. if (options) {
  32308. Util.extend(this, options);
  32309. }
  32310. }
  32311. /**
  32312. * @function SuperMap.SetLayerStatusParameters.prototype.destroy
  32313. * @description 释放资源,将引用资源的属性置空。
  32314. */
  32315. SetLayerStatusParameters_createClass(SetLayerStatusParameters, [{
  32316. key: "destroy",
  32317. value: function destroy() {
  32318. var me = this;
  32319. me.layerStatusList = null;
  32320. me.holdTime = null;
  32321. me.resourceID = null;
  32322. }
  32323. /**
  32324. * @function SuperMap.SetLayerStatusParameters.prototype.toJSON
  32325. * @description 生成 JSON。
  32326. * @returns {Object} 对应的 JSON 对象。
  32327. */
  32328. }, {
  32329. key: "toJSON",
  32330. value: function toJSON() {
  32331. var json = '{';
  32332. json += '"layers":[';
  32333. var v = [];
  32334. for (var i = 0, len = this.layerStatusList.length; i < len; i++) {
  32335. v.push(this.layerStatusList[i].toJSON());
  32336. }
  32337. json += v;
  32338. json += ']';
  32339. json += '}';
  32340. return json;
  32341. }
  32342. }]);
  32343. return SetLayerStatusParameters;
  32344. }();
  32345. SuperMap.SetLayerStatusParameters = SetLayerStatusParameters;
  32346. ;// CONCATENATED MODULE: ./src/common/iServer/SetLayerStatusService.js
  32347. function SetLayerStatusService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SetLayerStatusService_typeof = function _typeof(obj) { return typeof obj; }; } else { SetLayerStatusService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SetLayerStatusService_typeof(obj); }
  32348. function SetLayerStatusService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32349. 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); } }
  32350. function SetLayerStatusService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SetLayerStatusService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SetLayerStatusService_defineProperties(Constructor, staticProps); return Constructor; }
  32351. function SetLayerStatusService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SetLayerStatusService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SetLayerStatusService_get(target, property, receiver || target); }
  32352. function SetLayerStatusService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SetLayerStatusService_getPrototypeOf(object); if (object === null) break; } return object; }
  32353. 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 } }); if (superClass) SetLayerStatusService_setPrototypeOf(subClass, superClass); }
  32354. function SetLayerStatusService_setPrototypeOf(o, p) { SetLayerStatusService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SetLayerStatusService_setPrototypeOf(o, p); }
  32355. 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); }; }
  32356. function SetLayerStatusService_possibleConstructorReturn(self, call) { if (call && (SetLayerStatusService_typeof(call) === "object" || typeof call === "function")) { return call; } return SetLayerStatusService_assertThisInitialized(self); }
  32357. function SetLayerStatusService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32358. function SetLayerStatusService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32359. function SetLayerStatusService_getPrototypeOf(o) { SetLayerStatusService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SetLayerStatusService_getPrototypeOf(o); }
  32360. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32361. * This program are made available under the terms of the Apache License, Version 2.0
  32362. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32363. /**
  32364. * @class SuperMap.SetLayerStatusService
  32365. * @category iServer Map TempLayersSet
  32366. * @classdesc 子图层显示控制服务类。该类负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  32367. * 用户获取服务端返回的各子图层显示状态有两种方式:
  32368. * 一种是通过监听 SetLayerEvent.PROCESS_COMPLETE 事件;
  32369. * 一种是使用 AsyncResponder 类实现异步处理。
  32370. * @extends {SuperMap.CommonServiceBase}
  32371. * @param {string} url - 地图服务访问地址。请求地图服务,URL 应为:
  32372. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名};
  32373. * @param {Object} options - 参数。
  32374. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  32375. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  32376. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  32377. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32378. * @param {Object} [options.headers] - 请求头。
  32379. */
  32380. var SetLayerStatusService = /*#__PURE__*/function (_CommonServiceBase) {
  32381. SetLayerStatusService_inherits(SetLayerStatusService, _CommonServiceBase);
  32382. var _super = SetLayerStatusService_createSuper(SetLayerStatusService);
  32383. function SetLayerStatusService(url, options) {
  32384. var _this;
  32385. SetLayerStatusService_classCallCheck(this, SetLayerStatusService);
  32386. _this = _super.call(this, url, options);
  32387. _this.lastparams = null;
  32388. _this.mapUrl = url;
  32389. if (options) {
  32390. Util.extend(SetLayerStatusService_assertThisInitialized(_this), options);
  32391. }
  32392. _this.CLASS_NAME = "SuperMap.SetLayerStatusService";
  32393. return _this;
  32394. }
  32395. /**
  32396. * @override
  32397. */
  32398. SetLayerStatusService_createClass(SetLayerStatusService, [{
  32399. key: "destroy",
  32400. value: function destroy() {
  32401. SetLayerStatusService_get(SetLayerStatusService_getPrototypeOf(SetLayerStatusService.prototype), "destroy", this).call(this);
  32402. Util.reset(this);
  32403. }
  32404. /**
  32405. * @function SuperMap.SetLayerStatusService.prototype.processAsync
  32406. * @description 负责将客户端的更新参数传递到服务端。
  32407. * @param {Object} params - 修改后的图层资源信息。该参数可以使用获取图层信息服务{@link SuperMap.SetLayerStatusParameters}
  32408. * 返回图层信息,然后对其属性进行修改来获取。
  32409. */
  32410. }, {
  32411. key: "processAsync",
  32412. value: function processAsync(params) {
  32413. if (!(params instanceof SetLayerStatusParameters)) {
  32414. return;
  32415. }
  32416. var me = this,
  32417. method = "POST";
  32418. me.url = me.mapUrl;
  32419. if (params.resourceID == null) {
  32420. me.url = Util.urlPathAppend(me.url, 'tempLayersSet');
  32421. me.lastparams = params;
  32422. me.request({
  32423. method: method,
  32424. scope: me,
  32425. success: me.createTempLayerComplete,
  32426. failure: me.serviceProcessFailed
  32427. });
  32428. } else {
  32429. me.url = Util.urlPathAppend(me.url, "tempLayersSet/" + params.resourceID);
  32430. me.url = Util.urlAppend(me.url, "elementRemain=true&reference=" + params.resourceID + "&holdTime=" + params.holdTime.toString());
  32431. var jsonParameters = '[{';
  32432. jsonParameters += '"type":"UGC",';
  32433. if (params.layerStatusList != null && params.layerStatusList.length > 0) {
  32434. jsonParameters += '"subLayers":' + params.toJSON();
  32435. }
  32436. jsonParameters += ',"visible":' + true + ',';
  32437. jsonParameters += '"name":"' + this.getMapName(this.mapUrl) + '"';
  32438. jsonParameters += '}]';
  32439. me.request({
  32440. method: "PUT",
  32441. data: jsonParameters,
  32442. scope: me,
  32443. success: me.serviceProcessCompleted,
  32444. failure: me.serviceProcessFailed
  32445. });
  32446. }
  32447. }
  32448. /**
  32449. * @function SuperMap.SetLayerStatusService.prototype.createTempLayerComplete
  32450. * @description 设置完成,执行此方法。
  32451. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  32452. */
  32453. }, {
  32454. key: "createTempLayerComplete",
  32455. value: function createTempLayerComplete(result) {
  32456. var me = this;
  32457. result = Util.transformResult(result);
  32458. if (result.succeed) {
  32459. me.lastparams.resourceID = result.newResourceID;
  32460. }
  32461. me.processAsync(me.lastparams);
  32462. }
  32463. /**
  32464. * @function SuperMap.SetLayerStatusService.prototype.getMapName
  32465. * @description 获取地图名称。
  32466. * @param {Object} url - 服务地址。
  32467. */
  32468. }, {
  32469. key: "getMapName",
  32470. value: function getMapName(url) {
  32471. var mapUrl = url;
  32472. if (mapUrl.charAt(mapUrl.length - 1) === "/") {
  32473. mapUrl = mapUrl.substr(0, mapUrl.length - 1);
  32474. }
  32475. var index = mapUrl.lastIndexOf("/");
  32476. var mapName = mapUrl.substring(index + 1, mapUrl.length);
  32477. return mapName;
  32478. }
  32479. /**
  32480. * @function SuperMap.SetLayerStatusService.prototype.setLayerCompleted
  32481. * @description 设置完成,执行此方法。
  32482. * @param {Object} result - 服务器返回的结果对象,记录设置操作是否成功。
  32483. */
  32484. }, {
  32485. key: "serviceProcessCompleted",
  32486. value: function serviceProcessCompleted(result) {
  32487. var me = this;
  32488. result = Util.transformResult(result);
  32489. if (result != null && me.lastparams != null) {
  32490. result.newResourceID = me.lastparams.resourceID;
  32491. }
  32492. me.events.triggerEvent("processCompleted", {
  32493. result: result
  32494. });
  32495. }
  32496. }]);
  32497. return SetLayerStatusService;
  32498. }(CommonServiceBase);
  32499. SuperMap.SetLayerStatusService = SetLayerStatusService;
  32500. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsParameter.js
  32501. function SingleObjectQueryJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32502. 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); } }
  32503. function SingleObjectQueryJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  32504. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32505. * This program are made available under the terms of the Apache License, Version 2.0
  32506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32507. /**
  32508. * @class SuperMap.SingleObjectQueryJobsParameter
  32509. * @category iServer ProcessingService Query
  32510. * @classdesc 单对象空间查询分析任务参数类。
  32511. * @param {Object} options - 参数。
  32512. * @param {string} options.datasetName - 数据集名。
  32513. * @param {string} options.datasetQuery - 查询对象所在的数据集名称。
  32514. * @param {SuperMap.SpatialQueryMode} [options.mode=SuperMap.SpatialQueryMode.CONTAIN] - 空间查询模式。
  32515. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  32516. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  32517. */
  32518. var SingleObjectQueryJobsParameter = /*#__PURE__*/function () {
  32519. function SingleObjectQueryJobsParameter(options) {
  32520. SingleObjectQueryJobsParameter_classCallCheck(this, SingleObjectQueryJobsParameter);
  32521. if (!options) {
  32522. return;
  32523. }
  32524. /**
  32525. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetName
  32526. * @description 数据集名。
  32527. */
  32528. this.datasetName = "";
  32529. /**
  32530. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.datasetQuery
  32531. * @description 查询对象所在的数据集名称。
  32532. */
  32533. this.datasetQuery = "";
  32534. /**
  32535. * @member {string} SuperMap.SingleObjectQueryJobsParameter.prototype.geometryQuery
  32536. * @description 查询对象所在的几何对象。
  32537. */
  32538. this.geometryQuery = "";
  32539. /**
  32540. * @member {SuperMap.SpatialQueryMode} [SuperMap.SingleObjectQueryJobsParameter.prototype.mode=SuperMap.SpatialQueryMode.CONTAIN]
  32541. * @description 空间查询模式 。
  32542. */
  32543. this.mode = SpatialQueryMode.CONTAIN;
  32544. /**
  32545. * @member {SuperMap.OutputSetting} [SuperMap.SingleObjectQueryJobsParameter.prototype.output]
  32546. * @description 输出参数设置类。
  32547. */
  32548. this.output = null;
  32549. /**
  32550. * @member {SuperMap.MappingParameters} [SuperMap.SingleObjectQueryJobsParameter.prototype.mappingParameters]
  32551. * @description 分析后结果可视化的参数类。
  32552. */
  32553. this.mappingParameters = null;
  32554. Util.extend(this, options);
  32555. this.CLASS_NAME = "SuperMap.SingleObjectQueryJobsParameter";
  32556. }
  32557. /**
  32558. * @function SuperMap.SingleObjectQueryJobsParameter.prototype.destroy
  32559. * @description 释放资源,将引用资源的属性置空。
  32560. */
  32561. SingleObjectQueryJobsParameter_createClass(SingleObjectQueryJobsParameter, [{
  32562. key: "destroy",
  32563. value: function destroy() {
  32564. this.datasetName = null;
  32565. this.datasetQuery = null;
  32566. this.geometryQuery = null;
  32567. this.mode = null;
  32568. if (this.output instanceof OutputSetting) {
  32569. this.output.destroy();
  32570. this.output = null;
  32571. }
  32572. if (this.mappingParameters instanceof MappingParameters) {
  32573. this.mappingParameters.destroy();
  32574. this.mappingParameters = null;
  32575. }
  32576. }
  32577. /**
  32578. * @function SuperMap.SingleObjectQueryJobsParameter.toObject
  32579. * @param {Object} singleObjectQueryJobsParameter - 单对象空间查询分析任务参数。
  32580. * @param {Object} tempObj - 目标对象。
  32581. * @description 生成单对象空间查询分析任务对象。
  32582. */
  32583. }], [{
  32584. key: "toObject",
  32585. value: function toObject(singleObjectQueryJobsParameter, tempObj) {
  32586. for (var name in singleObjectQueryJobsParameter) {
  32587. if (name === "datasetName") {
  32588. tempObj['input'] = tempObj['input'] || {};
  32589. tempObj['input'][name] = singleObjectQueryJobsParameter[name];
  32590. continue;
  32591. }
  32592. if (name === "output") {
  32593. tempObj['output'] = tempObj['output'] || {};
  32594. tempObj['output'] = singleObjectQueryJobsParameter[name];
  32595. continue;
  32596. }
  32597. tempObj['analyst'] = tempObj['analyst'] || {};
  32598. tempObj['analyst'][name] = singleObjectQueryJobsParameter[name];
  32599. if (name === 'mappingParameters') {
  32600. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  32601. tempObj['analyst']['mappingParameters'] = singleObjectQueryJobsParameter[name];
  32602. }
  32603. }
  32604. }
  32605. }]);
  32606. return SingleObjectQueryJobsParameter;
  32607. }();
  32608. SuperMap.SingleObjectQueryJobsParameter = SingleObjectQueryJobsParameter;
  32609. ;// CONCATENATED MODULE: ./src/common/iServer/SingleObjectQueryJobsService.js
  32610. function SingleObjectQueryJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SingleObjectQueryJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SingleObjectQueryJobsService_typeof(obj); }
  32611. function SingleObjectQueryJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32612. 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); } }
  32613. function SingleObjectQueryJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SingleObjectQueryJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SingleObjectQueryJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  32614. function SingleObjectQueryJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SingleObjectQueryJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SingleObjectQueryJobsService_get(target, property, receiver || target); }
  32615. function SingleObjectQueryJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SingleObjectQueryJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  32616. 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 } }); if (superClass) SingleObjectQueryJobsService_setPrototypeOf(subClass, superClass); }
  32617. function SingleObjectQueryJobsService_setPrototypeOf(o, p) { SingleObjectQueryJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SingleObjectQueryJobsService_setPrototypeOf(o, p); }
  32618. 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); }; }
  32619. function SingleObjectQueryJobsService_possibleConstructorReturn(self, call) { if (call && (SingleObjectQueryJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SingleObjectQueryJobsService_assertThisInitialized(self); }
  32620. function SingleObjectQueryJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32621. function SingleObjectQueryJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32622. function SingleObjectQueryJobsService_getPrototypeOf(o) { SingleObjectQueryJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SingleObjectQueryJobsService_getPrototypeOf(o); }
  32623. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32624. * This program are made available under the terms of the Apache License, Version 2.0
  32625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32626. /**
  32627. * @class SuperMap.SingleObjectQueryJobsService
  32628. * @category iServer ProcessingService Query
  32629. * @classdesc 单对象查询分析服务类
  32630. * @extends {SuperMap.ProcessingServiceBase}
  32631. * @param {string} url - 单对象空间查询分析服务地址。
  32632. * @param {Object} options - 参数。
  32633. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32634. * @param {Object} [options.headers] - 请求头。
  32635. */
  32636. var SingleObjectQueryJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  32637. SingleObjectQueryJobsService_inherits(SingleObjectQueryJobsService, _ProcessingServiceBas);
  32638. var _super = SingleObjectQueryJobsService_createSuper(SingleObjectQueryJobsService);
  32639. function SingleObjectQueryJobsService(url, options) {
  32640. var _this;
  32641. SingleObjectQueryJobsService_classCallCheck(this, SingleObjectQueryJobsService);
  32642. _this = _super.call(this, url, options);
  32643. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/query');
  32644. _this.CLASS_NAME = 'SuperMap.SingleObjectQueryJobsService';
  32645. return _this;
  32646. }
  32647. /**
  32648. *@override
  32649. */
  32650. SingleObjectQueryJobsService_createClass(SingleObjectQueryJobsService, [{
  32651. key: "destroy",
  32652. value: function destroy() {
  32653. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "destroy", this).call(this);
  32654. }
  32655. /**
  32656. * @function SuperMap.SingleObjectQueryJobsService.protitype.getQueryJobs
  32657. * @description 获取单对象空间查询分析所有任务
  32658. */
  32659. }, {
  32660. key: "getQueryJobs",
  32661. value: function getQueryJobs() {
  32662. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, this.url);
  32663. }
  32664. /**
  32665. * @function SuperMap.KernelDensityJobsService.protitype.getQueryJob
  32666. * @description 获取指定id的单对象空间查询分析服务
  32667. * @param {string} id - 指定要获取数据的id
  32668. */
  32669. }, {
  32670. key: "getQueryJob",
  32671. value: function getQueryJob(id) {
  32672. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  32673. }
  32674. /**
  32675. * @function SuperMap.SingleObjectQueryJobsService.protitype.addQueryJob
  32676. * @description 新建单对象空间查询分析服务
  32677. * @param {SuperMap.SingleObjectQueryJobsParameter} params - 创建一个空间分析的请求参数。
  32678. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  32679. */
  32680. }, {
  32681. key: "addQueryJob",
  32682. value: function addQueryJob(params, seconds) {
  32683. SingleObjectQueryJobsService_get(SingleObjectQueryJobsService_getPrototypeOf(SingleObjectQueryJobsService.prototype), "addJob", this).call(this, this.url, params, SingleObjectQueryJobsParameter, seconds);
  32684. }
  32685. }]);
  32686. return SingleObjectQueryJobsService;
  32687. }(ProcessingServiceBase);
  32688. SuperMap.SingleObjectQueryJobsService = SingleObjectQueryJobsService;
  32689. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryParameters.js
  32690. function StopQueryParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32691. 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); } }
  32692. function StopQueryParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryParameters_defineProperties(Constructor, staticProps); return Constructor; }
  32693. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32694. * This program are made available under the terms of the Apache License, Version 2.0
  32695. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32696. /**
  32697. * @class SuperMap.StopQueryParameters
  32698. * @category iServer TrafficTransferAnalyst TransferStops
  32699. * @classdesc 站点查询参数类。
  32700. * @param {Object} options - 参数。
  32701. * @param {string} options.keyWord - 站点名称关键字。
  32702. * @param {boolean} [options.returnPosition=false] - 是否返回站点坐标信息。
  32703. */
  32704. var StopQueryParameters = /*#__PURE__*/function () {
  32705. function StopQueryParameters(options) {
  32706. StopQueryParameters_classCallCheck(this, StopQueryParameters);
  32707. options = options || {};
  32708. /**
  32709. * @member {string} SuperMap.StopQueryParameters.prototype.keyWord
  32710. * @description 站点名称关键字。
  32711. */
  32712. this.keyWord = null;
  32713. /**
  32714. * @member {boolean} [SuperMap.StopQueryParameters.prototype.returnPosition=false]
  32715. * @description 是否返回站点坐标信息。
  32716. */
  32717. this.returnPosition = false;
  32718. Util.extend(this, options);
  32719. this.CLASS_NAME = "SuperMap.StopQueryParameters";
  32720. }
  32721. /**
  32722. * @function SuperMap.StopQueryParameters.prototype.destroy
  32723. * @description 释放资源,将引用资源的属性置空。
  32724. */
  32725. StopQueryParameters_createClass(StopQueryParameters, [{
  32726. key: "destroy",
  32727. value: function destroy() {
  32728. Util.reset(this);
  32729. }
  32730. }]);
  32731. return StopQueryParameters;
  32732. }();
  32733. SuperMap.StopQueryParameters = StopQueryParameters;
  32734. ;// CONCATENATED MODULE: ./src/common/iServer/StopQueryService.js
  32735. function StopQueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { StopQueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { StopQueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return StopQueryService_typeof(obj); }
  32736. function StopQueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32737. 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); } }
  32738. function StopQueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) StopQueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) StopQueryService_defineProperties(Constructor, staticProps); return Constructor; }
  32739. function StopQueryService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { StopQueryService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return StopQueryService_get(target, property, receiver || target); }
  32740. function StopQueryService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = StopQueryService_getPrototypeOf(object); if (object === null) break; } return object; }
  32741. 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 } }); if (superClass) StopQueryService_setPrototypeOf(subClass, superClass); }
  32742. function StopQueryService_setPrototypeOf(o, p) { StopQueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return StopQueryService_setPrototypeOf(o, p); }
  32743. 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); }; }
  32744. function StopQueryService_possibleConstructorReturn(self, call) { if (call && (StopQueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return StopQueryService_assertThisInitialized(self); }
  32745. function StopQueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32746. function StopQueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32747. function StopQueryService_getPrototypeOf(o) { StopQueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return StopQueryService_getPrototypeOf(o); }
  32748. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32749. * This program are made available under the terms of the Apache License, Version 2.0
  32750. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32751. /**
  32752. * @class SuperMap.StopQueryService
  32753. * @category iServer TrafficTransferAnalyst TransferStops
  32754. * @classdesc 站点查询服务类。
  32755. * 返回结果通过该类支持的事件的监听函数参数获取
  32756. * @extends {SuperMap.CommonServiceBase}
  32757. * @param {string} url - 与客户端交互的站点查询服务地址。
  32758. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  32759. * @param {Object} options - 参数。</br>
  32760. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  32761. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32762. * @param {Object} [options.headers] - 请求头。
  32763. * @example 例如:
  32764. * (start code)
  32765. * var myService = new SuperMap.StopQueryService(url, {eventListeners: {
  32766. * "processCompleted": StopQueryCompleted,
  32767. * "processFailed": StopQueryError
  32768. * }
  32769. * };
  32770. * (end)
  32771. *
  32772. *
  32773. */
  32774. var StopQueryService = /*#__PURE__*/function (_CommonServiceBase) {
  32775. StopQueryService_inherits(StopQueryService, _CommonServiceBase);
  32776. var _super = StopQueryService_createSuper(StopQueryService);
  32777. function StopQueryService(url, options) {
  32778. var _this;
  32779. StopQueryService_classCallCheck(this, StopQueryService);
  32780. _this = _super.call(this, url, options);
  32781. options = options || {};
  32782. Util.extend(StopQueryService_assertThisInitialized(_this), options);
  32783. _this.CLASS_NAME = "SuperMap.StopQueryService";
  32784. return _this;
  32785. }
  32786. /**
  32787. *@override
  32788. */
  32789. StopQueryService_createClass(StopQueryService, [{
  32790. key: "destroy",
  32791. value: function destroy() {
  32792. StopQueryService_get(StopQueryService_getPrototypeOf(StopQueryService.prototype), "destroy", this).call(this);
  32793. Util.reset(this);
  32794. }
  32795. /**
  32796. * @function SuperMap.StopQueryService.prototype.processAsync
  32797. * @description 负责将客户端的更新参数传递到服务端。
  32798. * @param {SuperMap.StopQueryParameters} params - 交通换乘参数。
  32799. */
  32800. }, {
  32801. key: "processAsync",
  32802. value: function processAsync(params) {
  32803. if (!(params instanceof StopQueryParameters)) {
  32804. return;
  32805. }
  32806. var me = this;
  32807. me.url = Util.urlPathAppend(me.url, 'stops/keyword/' + params.keyWord);
  32808. me.request({
  32809. method: "GET",
  32810. params: {
  32811. returnPosition: params.returnPosition
  32812. },
  32813. scope: me,
  32814. success: me.serviceProcessCompleted,
  32815. failure: me.serviceProcessFailed
  32816. });
  32817. }
  32818. }]);
  32819. return StopQueryService;
  32820. }(CommonServiceBase);
  32821. SuperMap.StopQueryService = StopQueryService;
  32822. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsParameter.js
  32823. function SummaryAttributesJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32824. 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); } }
  32825. function SummaryAttributesJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  32826. /* Copyright© 2000 - 2021 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 SuperMap.SummaryAttributesJobsParameter
  32831. * @category iServer ProcessingService SummaryAttributes
  32832. * @classdesc 属性汇总分析任务参数类
  32833. * @param {Object} options - 参数。
  32834. * @param {string} options.datasetName - 数据集名。
  32835. * @param {string} options.groupField - 分组字段。
  32836. * @param {string} options.attributeField - 属性字段。
  32837. * @param {string} options.statisticModes - 统计模式。
  32838. * @param {SuperMap.OutputSetting} [options.output] -输出参数设置。
  32839. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  32840. */
  32841. var SummaryAttributesJobsParameter = /*#__PURE__*/function () {
  32842. function SummaryAttributesJobsParameter(options) {
  32843. SummaryAttributesJobsParameter_classCallCheck(this, SummaryAttributesJobsParameter);
  32844. if (!options) {
  32845. return;
  32846. }
  32847. /**
  32848. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.datasetName
  32849. * @description 汇总数据集名称。
  32850. */
  32851. this.datasetName = "";
  32852. /**
  32853. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.groupField
  32854. * @description 分组字段。
  32855. */
  32856. this.groupField = "";
  32857. /**
  32858. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.attributeField
  32859. * @description 属性字段。
  32860. */
  32861. this.attributeField = "";
  32862. /**
  32863. * @member {string} SuperMap.SummaryAttributesJobsParameter.prototype.statisticModes
  32864. * @description 属性汇总统计模式。
  32865. */
  32866. this.statisticModes = "";
  32867. /**
  32868. * @member {SuperMap.OutputSetting} SuperMap.SummaryAttributesJobsParameter.prototype.output
  32869. * @description 输出参数设置类。
  32870. */
  32871. this.output = null;
  32872. /**
  32873. * @member {SuperMap.MappingParameters} [SuperMap.SummaryAttributesJobsParameter.prototype.mappingParameters]
  32874. * @description 分析后结果可视化的参数类。
  32875. */
  32876. this.mappingParameters = null;
  32877. Util.extend(this, options);
  32878. this.CLASS_NAME = "SuperMap.SummaryAttributesJobsParameter";
  32879. }
  32880. /**
  32881. * @function SuperMap.SummaryAttributesJobsParameter.destroy
  32882. * @override
  32883. */
  32884. SummaryAttributesJobsParameter_createClass(SummaryAttributesJobsParameter, [{
  32885. key: "destroy",
  32886. value: function destroy() {
  32887. this.datasetName = null;
  32888. this.groupField = null;
  32889. this.attributeField = null;
  32890. this.statisticModes = null;
  32891. if (this.output instanceof OutputSetting) {
  32892. this.output.destroy();
  32893. this.output = null;
  32894. }
  32895. if (this.mappingParameters instanceof MappingParameters) {
  32896. this.mappingParameters.destroy();
  32897. this.mappingParameters = null;
  32898. }
  32899. }
  32900. /**
  32901. * @function SuperMap.SummaryAttributesJobsParameter.toObject
  32902. * @param {Object} SummaryAttributesJobsParameter - 属性汇总任务参数。
  32903. * @param {Object} tempObj - 目标对象。
  32904. * @description 生成属性汇总分析任务对象。
  32905. */
  32906. }], [{
  32907. key: "toObject",
  32908. value: function toObject(SummaryAttributesJobsParameter, tempObj) {
  32909. for (var name in SummaryAttributesJobsParameter) {
  32910. if (name === "datasetName") {
  32911. tempObj['input'] = tempObj['input'] || {};
  32912. tempObj['input'][name] = SummaryAttributesJobsParameter[name];
  32913. continue;
  32914. }
  32915. if (name === "output") {
  32916. tempObj['output'] = tempObj['output'] || {};
  32917. tempObj['output'] = SummaryAttributesJobsParameter[name];
  32918. continue;
  32919. }
  32920. tempObj['analyst'] = tempObj['analyst'] || {};
  32921. tempObj['analyst'][name] = SummaryAttributesJobsParameter[name];
  32922. if (name === 'mappingParameters') {
  32923. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  32924. tempObj['analyst']['mappingParameters'] = SummaryAttributesJobsParameter[name];
  32925. }
  32926. }
  32927. }
  32928. }]);
  32929. return SummaryAttributesJobsParameter;
  32930. }();
  32931. SuperMap.SummaryAttributesJobsParameter = SummaryAttributesJobsParameter;
  32932. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryAttributesJobsService.js
  32933. function SummaryAttributesJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryAttributesJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryAttributesJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryAttributesJobsService_typeof(obj); }
  32934. function SummaryAttributesJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  32935. 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); } }
  32936. function SummaryAttributesJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryAttributesJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryAttributesJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  32937. function SummaryAttributesJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryAttributesJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SummaryAttributesJobsService_get(target, property, receiver || target); }
  32938. function SummaryAttributesJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryAttributesJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  32939. 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 } }); if (superClass) SummaryAttributesJobsService_setPrototypeOf(subClass, superClass); }
  32940. function SummaryAttributesJobsService_setPrototypeOf(o, p) { SummaryAttributesJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryAttributesJobsService_setPrototypeOf(o, p); }
  32941. 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); }; }
  32942. function SummaryAttributesJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryAttributesJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryAttributesJobsService_assertThisInitialized(self); }
  32943. function SummaryAttributesJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  32944. function SummaryAttributesJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  32945. function SummaryAttributesJobsService_getPrototypeOf(o) { SummaryAttributesJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryAttributesJobsService_getPrototypeOf(o); }
  32946. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  32947. * This program are made available under the terms of the Apache License, Version 2.0
  32948. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  32949. /**
  32950. * @class SuperMap.SummaryAttributesJobsService
  32951. * @category iServer ProcessingService SummaryAttributes
  32952. * @classdesc 属性汇总分析服务类
  32953. * @extends {SuperMap.ProcessingServiceBase}
  32954. * @param {string} url - 汇总统计分析服务地址。
  32955. * @param {Object} options - 参数。
  32956. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  32957. * @param {Object} [options.headers] - 请求头。
  32958. */
  32959. var SummaryAttributesJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  32960. SummaryAttributesJobsService_inherits(SummaryAttributesJobsService, _ProcessingServiceBas);
  32961. var _super = SummaryAttributesJobsService_createSuper(SummaryAttributesJobsService);
  32962. function SummaryAttributesJobsService(url, options) {
  32963. var _this;
  32964. SummaryAttributesJobsService_classCallCheck(this, SummaryAttributesJobsService);
  32965. _this = _super.call(this, url, options);
  32966. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryattributes');
  32967. _this.CLASS_NAME = "SuperMap.SummaryAttributesJobsService";
  32968. return _this;
  32969. }
  32970. /**
  32971. *@override
  32972. */
  32973. SummaryAttributesJobsService_createClass(SummaryAttributesJobsService, [{
  32974. key: "destroy",
  32975. value: function destroy() {
  32976. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "destroy", this).call(this);
  32977. }
  32978. /**
  32979. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJobs
  32980. * @description 获取属性汇总分析所有任务
  32981. */
  32982. }, {
  32983. key: "getSummaryAttributesJobs",
  32984. value: function getSummaryAttributesJobs() {
  32985. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, this.url);
  32986. }
  32987. /**
  32988. * @function SuperMap.SummaryAttributesJobsService.protitype.getSummaryAttributesJob
  32989. * @description 获取指定id的属性汇总分析服务
  32990. * @param {string} id - 指定要获取数据的id
  32991. */
  32992. }, {
  32993. key: "getSummaryAttributesJob",
  32994. value: function getSummaryAttributesJob(id) {
  32995. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  32996. }
  32997. /**
  32998. * @function SuperMap.SummaryAttributesJobsService.protitype.addSummaryAttributesJob
  32999. * @description 新建属性汇总分析服务
  33000. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  33001. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33002. */
  33003. }, {
  33004. key: "addSummaryAttributesJob",
  33005. value: function addSummaryAttributesJob(params, seconds) {
  33006. SummaryAttributesJobsService_get(SummaryAttributesJobsService_getPrototypeOf(SummaryAttributesJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryAttributesJobsParameter, seconds);
  33007. }
  33008. }]);
  33009. return SummaryAttributesJobsService;
  33010. }(ProcessingServiceBase);
  33011. SuperMap.SummaryAttributesJobsService = SummaryAttributesJobsService;
  33012. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobParameter.js
  33013. function SummaryMeshJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33014. 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); } }
  33015. function SummaryMeshJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33016. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33017. * This program are made available under the terms of the Apache License, Version 2.0
  33018. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33019. /**
  33020. * @class SuperMap.SummaryMeshJobParameter
  33021. * @category iServer ProcessingService AggregatePoints
  33022. * @classdesc 点聚合分析任务参数类。
  33023. * @param {Object} options - 参数。
  33024. * @param {string} options.datasetName - 数据集名。
  33025. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  33026. * @param {number} options.fields - 权重索引。
  33027. * @param {number} [options.resolution=100] - 分辨率。
  33028. * @param {SuperMap.StatisticAnalystMode} [options.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE] - 分析模式。
  33029. * @param {number} [options.meshType=0] - 分析类型。
  33030. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 聚合类型。
  33031. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  33032. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33033. */
  33034. var SummaryMeshJobParameter = /*#__PURE__*/function () {
  33035. function SummaryMeshJobParameter(options) {
  33036. SummaryMeshJobParameter_classCallCheck(this, SummaryMeshJobParameter);
  33037. if (!options) {
  33038. return;
  33039. }
  33040. /**
  33041. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.datasetName
  33042. * @description 数据集名。
  33043. */
  33044. this.datasetName = "";
  33045. /**
  33046. * @member {string} SuperMap.SummaryMeshJobParameter.prototype.regionDataset
  33047. * @description 聚合面数据集(聚合类型为多边形聚合时使用的参数)。
  33048. */
  33049. this.regionDataset = "";
  33050. /**
  33051. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryMeshJobParameter.prototype.query
  33052. * @description 分析范围(聚合类型为网格面聚合时使用的参数)。
  33053. */
  33054. this.query = "";
  33055. /**
  33056. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.resolution=100]
  33057. * @description 分辨率(聚合类型为网格面聚合时使用的参数)。
  33058. */
  33059. this.resolution = 100;
  33060. /**
  33061. * @member {number} [SuperMap.SummaryMeshJobParameter.prototype.meshType=0]
  33062. * @description 网格面类型(聚合类型为网格面聚合时使用的参数),取值:0 或 1。
  33063. */
  33064. this.meshType = 0;
  33065. /**
  33066. * @member {SuperMap.StatisticAnalystMode} [SuperMap.SummaryMeshJobParameter.prototype.statisticModes=SuperMap.StatisticAnalystMode.AVERAGE]
  33067. * @description 统计模式。
  33068. */
  33069. this.statisticModes = StatisticAnalystMode.AVERAGE;
  33070. /**
  33071. * @member {number} SuperMap.SummaryMeshJobParameter.prototype.fields
  33072. * @description 权重字段。
  33073. */
  33074. this.fields = "";
  33075. /**
  33076. * @member {SuperMap.SummaryType} [SuperMap.SummaryMeshJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  33077. * @description 聚合类型。
  33078. */
  33079. this.type = SummaryType.SUMMARYMESH;
  33080. /**
  33081. * @member {SuperMap.OutputSetting} [SuperMap.SummaryMeshJobParameter.prototype.output]
  33082. * @description 输出参数设置类。
  33083. */
  33084. this.output = null;
  33085. /**
  33086. * @member {SuperMap.MappingParameters} [SuperMap.SummaryMeshJobParameter.prototype.mappingParameters]
  33087. * @description 分析后结果可视化的参数类。
  33088. */
  33089. this.mappingParameters = null;
  33090. Util.extend(this, options);
  33091. this.CLASS_NAME = "SuperMap.SummaryMeshJobParameter";
  33092. }
  33093. /**
  33094. * @function SuperMap.SummaryMeshJobParameter.destroy
  33095. * @override
  33096. */
  33097. SummaryMeshJobParameter_createClass(SummaryMeshJobParameter, [{
  33098. key: "destroy",
  33099. value: function destroy() {
  33100. this.datasetName = null;
  33101. this.query = null;
  33102. this.resolution = null;
  33103. this.statisticModes = null;
  33104. this.meshType = null;
  33105. this.fields = null;
  33106. this.regionDataset = null;
  33107. this.type = null;
  33108. if (this.output instanceof OutputSetting) {
  33109. this.output.destroy();
  33110. this.output = null;
  33111. }
  33112. if (this.mappingParameters instanceof MappingParameters) {
  33113. this.mappingParameters.destroy();
  33114. this.mappingParameters = null;
  33115. }
  33116. }
  33117. /**
  33118. * @function SuperMap.SummaryMeshJobParameter.toObject
  33119. * @param {Object} summaryMeshJobParameter - 点聚合分析任务参数。
  33120. * @param {Object} tempObj - 目标对象。
  33121. * @description 生成点聚合分析任务对象。
  33122. */
  33123. }], [{
  33124. key: "toObject",
  33125. value: function toObject(summaryMeshJobParameter, tempObj) {
  33126. for (var name in summaryMeshJobParameter) {
  33127. if (name === "datasetName") {
  33128. tempObj['input'] = tempObj['input'] || {};
  33129. tempObj['input'][name] = summaryMeshJobParameter[name];
  33130. continue;
  33131. }
  33132. if (name === "type") {
  33133. tempObj['type'] = summaryMeshJobParameter[name];
  33134. continue;
  33135. }
  33136. if (name === "output") {
  33137. tempObj['output'] = tempObj['output'] || {};
  33138. tempObj['output'] = summaryMeshJobParameter[name];
  33139. continue;
  33140. }
  33141. if (summaryMeshJobParameter.type === 'SUMMARYMESH' && name !== 'regionDataset' || summaryMeshJobParameter.type === 'SUMMARYREGION' && !contains(['meshType', 'resolution', 'query'], name)) {
  33142. tempObj['analyst'] = tempObj['analyst'] || {};
  33143. if (name === 'query' && summaryMeshJobParameter[name]) {
  33144. tempObj['analyst'][name] = summaryMeshJobParameter[name].toBBOX();
  33145. } else {
  33146. tempObj['analyst'][name] = summaryMeshJobParameter[name];
  33147. }
  33148. if (name === 'mappingParameters') {
  33149. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33150. tempObj['analyst']['mappingParameters'] = summaryMeshJobParameter[name];
  33151. }
  33152. }
  33153. }
  33154. function contains(arr, obj) {
  33155. var i = arr.length;
  33156. while (i--) {
  33157. if (arr[i] === obj) {
  33158. return true;
  33159. }
  33160. }
  33161. return false;
  33162. }
  33163. }
  33164. }]);
  33165. return SummaryMeshJobParameter;
  33166. }();
  33167. SuperMap.SummaryMeshJobParameter = SummaryMeshJobParameter;
  33168. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryMeshJobsService.js
  33169. function SummaryMeshJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryMeshJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryMeshJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryMeshJobsService_typeof(obj); }
  33170. function SummaryMeshJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33171. 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); } }
  33172. function SummaryMeshJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryMeshJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryMeshJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33173. function SummaryMeshJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryMeshJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SummaryMeshJobsService_get(target, property, receiver || target); }
  33174. function SummaryMeshJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryMeshJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33175. 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 } }); if (superClass) SummaryMeshJobsService_setPrototypeOf(subClass, superClass); }
  33176. function SummaryMeshJobsService_setPrototypeOf(o, p) { SummaryMeshJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryMeshJobsService_setPrototypeOf(o, p); }
  33177. 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); }; }
  33178. function SummaryMeshJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryMeshJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryMeshJobsService_assertThisInitialized(self); }
  33179. function SummaryMeshJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33180. function SummaryMeshJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33181. function SummaryMeshJobsService_getPrototypeOf(o) { SummaryMeshJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryMeshJobsService_getPrototypeOf(o); }
  33182. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33183. * This program are made available under the terms of the Apache License, Version 2.0
  33184. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33185. /**
  33186. * @class SuperMap.SummaryMeshJobsService
  33187. * @category iServer ProcessingService AggregatePoints
  33188. * @classdesc 点聚合分析任务类。
  33189. * @param {string} url -点聚合分析任务地址。
  33190. * @param {Object} options - 参数。
  33191. * @param {SuperMap.Events} options.events - 处理所有事件的对象。<br>
  33192. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  33193. * @param {Object} [options.eventListeners] - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  33194. * @param {number} options.index - 服务访问地址在数组中的位置。<br>
  33195. * @param {number} options.length - 服务访问地址数组长度。
  33196. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33197. * @param {Object} [options.headers] - 请求头。
  33198. */
  33199. var SummaryMeshJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33200. SummaryMeshJobsService_inherits(SummaryMeshJobsService, _ProcessingServiceBas);
  33201. var _super = SummaryMeshJobsService_createSuper(SummaryMeshJobsService);
  33202. function SummaryMeshJobsService(url, options) {
  33203. var _this;
  33204. SummaryMeshJobsService_classCallCheck(this, SummaryMeshJobsService);
  33205. _this = _super.call(this, url, options);
  33206. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/aggregatepoints');
  33207. _this.CLASS_NAME = 'SuperMap.SummaryMeshJobsService';
  33208. return _this;
  33209. }
  33210. /**
  33211. * @override
  33212. */
  33213. SummaryMeshJobsService_createClass(SummaryMeshJobsService, [{
  33214. key: "destroy",
  33215. value: function destroy() {
  33216. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "destroy", this).call(this);
  33217. }
  33218. /**
  33219. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJobs
  33220. * @description 获取点聚合分析任务
  33221. */
  33222. }, {
  33223. key: "getSummaryMeshJobs",
  33224. value: function getSummaryMeshJobs() {
  33225. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, this.url);
  33226. }
  33227. /**
  33228. * @function SuperMap.SummaryMeshJobsService.prototype.getSummaryMeshJob
  33229. * @description 获取指定ip的点聚合分析任务
  33230. * @param {string} id - 指定要获取数据的id
  33231. */
  33232. }, {
  33233. key: "getSummaryMeshJob",
  33234. value: function getSummaryMeshJob(id) {
  33235. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  33236. }
  33237. /**
  33238. * @function SuperMap.SummaryMeshJobsService.prototype.addSummaryMeshJob
  33239. * @description 新建点聚合分析服务
  33240. * @param {SuperMap.SummaryMeshJobParameter} params - 创建一个空间分析的请求参数。
  33241. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33242. */
  33243. }, {
  33244. key: "addSummaryMeshJob",
  33245. value: function addSummaryMeshJob(params, seconds) {
  33246. SummaryMeshJobsService_get(SummaryMeshJobsService_getPrototypeOf(SummaryMeshJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryMeshJobParameter, seconds);
  33247. }
  33248. }]);
  33249. return SummaryMeshJobsService;
  33250. }(ProcessingServiceBase);
  33251. SuperMap.SummaryMeshJobsService = SummaryMeshJobsService;
  33252. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobParameter.js
  33253. function SummaryRegionJobParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33254. 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); } }
  33255. function SummaryRegionJobParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobParameter_defineProperties(Constructor, staticProps); return Constructor; }
  33256. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33257. * This program are made available under the terms of the Apache License, Version 2.0
  33258. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33259. /**
  33260. * @class SuperMap.SummaryRegionJobParameter
  33261. * @category iServer ProcessingService SummaryRegion
  33262. * @classdesc 区域汇总分析任务参数类。
  33263. * @param {Object} options - 参数。
  33264. * @param {string} options.datasetName - 数据集名。
  33265. * @param {(SuperMap.Bounds|L.Bounds|ol.extent)} [options.query] - 分析范围(默认为全图范围)。
  33266. * @param {string} [options.standardFields] - 标准属性字段名称。
  33267. * @param {string} [options.weightedFields] - 权重字段名称。
  33268. * @param {SuperMap.StatisticAnalystMode} [options.standardStatisticModes] - 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  33269. * @param {SuperMap.StatisticAnalystMode} [options.weightedStatisticModes] - 权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  33270. * @param {boolean} [options.sumShape=true] - 是否统计长度或面积。
  33271. * @param {boolean} [options.standardSummaryFields=false] - 是否以标准属字段统计。
  33272. * @param {boolean} [options.weightedSummaryFields=false] - 是否以权重字段统计。
  33273. * @param {number} [options.resolution=100] - 网格大小。
  33274. * @param {number} [options.meshType=0] - 网格面汇总类型。
  33275. * @param {SuperMap.AnalystSizeUnit} [options.meshSizeUnit=SuperMap.AnalystSizeUnit.METER] - 网格大小单位。
  33276. * @param {SuperMap.SummaryType} [options.type=SuperMap.SummaryType.SUMMARYMESH] - 汇总类型。
  33277. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  33278. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  33279. */
  33280. var SummaryRegionJobParameter = /*#__PURE__*/function () {
  33281. function SummaryRegionJobParameter(options) {
  33282. SummaryRegionJobParameter_classCallCheck(this, SummaryRegionJobParameter);
  33283. if (!options) {
  33284. return;
  33285. }
  33286. /**
  33287. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.datasetName
  33288. * @description 数据集名。
  33289. */
  33290. this.datasetName = "";
  33291. /**
  33292. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.regionDataset
  33293. * @description 汇总数据源(多边形汇总时用到的参数)。
  33294. */
  33295. this.regionDataset = "";
  33296. /**
  33297. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.sumShape=true]
  33298. * @description 是否统计长度或面积。
  33299. */
  33300. this.sumShape = true;
  33301. /**
  33302. * @member {(SuperMap.Bounds|L.Bounds|ol.extent)} SuperMap.SummaryRegionJobParameter.prototype.query
  33303. * @description 分析范围。
  33304. */
  33305. this.query = "";
  33306. /**
  33307. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.standardSummaryFields=false]
  33308. * @description 是否以标准属字段统计。
  33309. */
  33310. this.standardSummaryFields = false;
  33311. /**
  33312. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.standardFields
  33313. * @description 标准属性字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。standardSummaryFields 为 true 时必填。
  33314. */
  33315. this.standardFields = "";
  33316. /**
  33317. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.standardStatisticModes
  33318. * @description 标准属性字段的统计模式。standardSummaryFields 为 true 时必填。
  33319. */
  33320. this.standardStatisticModes = "";
  33321. /**
  33322. * @member {boolean} [SuperMap.SummaryRegionJobParameter.prototype.weightedSummaryFields=false]
  33323. * @description 是否以权重字段统计。
  33324. */
  33325. this.weightedSummaryFields = false;
  33326. /**
  33327. * @member {string} SuperMap.SummaryRegionJobParameter.prototype.weightedFields
  33328. * @description 权重字段名称。仅支持系统字段以外的整形、长整形、浮点型的字段的名称。weightedSummaryFields 为 true 时必填。
  33329. */
  33330. this.weightedFields = "";
  33331. /**
  33332. * @member {SuperMap.StatisticAnalystMode} SuperMap.SummaryRegionJobParameter.prototype.weightedStatisticModes
  33333. * @description 以权重字段统计的统计模式。权重字段的统计模式。weightedSummaryFields 为 true 时必填。
  33334. */
  33335. this.weightedStatisticModes = "";
  33336. /**
  33337. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.meshType=0]
  33338. * @description 网格面汇总类型。
  33339. */
  33340. this.meshType = 0;
  33341. /**
  33342. * @member {number} [SuperMap.SummaryRegionJobParameter.prototype.resolution=100]
  33343. * @description 网格大小。
  33344. */
  33345. this.resolution = 100;
  33346. /**
  33347. * @member {SuperMap.AnalystSizeUnit} [SuperMap.SummaryRegionJobParameter.prototype.meshSizeUnit=SuperMap.AnalystSizeUnit.METER]
  33348. * @description 网格大小单位。
  33349. */
  33350. this.meshSizeUnit = AnalystSizeUnit.METER;
  33351. /**
  33352. * @member {SuperMap.SummaryType} [SuperMap.SummaryRegionJobParameter.prototype.type=SuperMap.SummaryType.SUMMARYMESH]
  33353. * @description 汇总类型。
  33354. */
  33355. this.type = SummaryType.SUMMARYMESH;
  33356. /**
  33357. * @member {SuperMap.OutputSetting} SuperMap.SummaryRegionJobParameter.prototype.output
  33358. * @description 输出参数设置类
  33359. */
  33360. this.output = null;
  33361. /**
  33362. * @member {SuperMap.MappingParameters} [SuperMap.SummaryRegionJobParameter.prototype.mappingParameters]
  33363. * @description 分析后结果可视化的参数类。
  33364. */
  33365. this.mappingParameters = null;
  33366. Util.extend(this, options);
  33367. this.CLASS_NAME = "SuperMap.SummaryRegionJobParameter";
  33368. }
  33369. /**
  33370. * @function SuperMap.SummaryRegionJobParameter.prototype.destroy
  33371. * @description 释放资源,将引用资源的属性置空。
  33372. */
  33373. SummaryRegionJobParameter_createClass(SummaryRegionJobParameter, [{
  33374. key: "destroy",
  33375. value: function destroy() {
  33376. this.datasetName = null;
  33377. this.sumShape = null;
  33378. this.regionDataset = null;
  33379. this.query = null;
  33380. this.standardSummaryFields = null;
  33381. this.standardFields = null;
  33382. this.standardStatisticModes = null;
  33383. this.weightedSummaryFields = null;
  33384. this.weightedFields = null;
  33385. this.weightedStatisticModes = null;
  33386. this.meshType = null;
  33387. this.resolution = null;
  33388. this.meshSizeUnit = null;
  33389. this.type = null;
  33390. if (this.output instanceof OutputSetting) {
  33391. this.output.destroy();
  33392. this.output = null;
  33393. }
  33394. if (this.mappingParameters instanceof MappingParameters) {
  33395. this.mappingParameters.destroy();
  33396. this.mappingParameters = null;
  33397. }
  33398. }
  33399. /**
  33400. * @function SuperMap.SummaryRegionJobParameter.toObject
  33401. * @param {Object} summaryRegionJobParameter - 矢量裁剪分析任务参数。
  33402. * @param {Object} tempObj - 目标对象。
  33403. * @description 生成区域汇总分析服务对象。
  33404. */
  33405. }], [{
  33406. key: "toObject",
  33407. value: function toObject(summaryRegionJobParameter, tempObj) {
  33408. for (var name in summaryRegionJobParameter) {
  33409. if (name === "datasetName") {
  33410. tempObj['input'] = tempObj['input'] || {};
  33411. tempObj['input'][name] = summaryRegionJobParameter[name];
  33412. continue;
  33413. }
  33414. if (name === "type") {
  33415. tempObj['type'] = summaryRegionJobParameter[name];
  33416. continue;
  33417. }
  33418. if (name === "type") {
  33419. tempObj['type'] = summaryRegionJobParameter[name];
  33420. continue;
  33421. }
  33422. if (name === "output") {
  33423. tempObj['output'] = tempObj['output'] || {};
  33424. tempObj['output'] = summaryRegionJobParameter[name];
  33425. continue;
  33426. }
  33427. if (summaryRegionJobParameter.type === "SUMMARYREGION" || summaryRegionJobParameter.type === "SUMMARYMESH" && name !== "regionDataset") {
  33428. tempObj['analyst'] = tempObj['analyst'] || {};
  33429. if (name === 'query' && summaryRegionJobParameter[name]) {
  33430. tempObj['analyst'][name] = summaryRegionJobParameter[name].toBBOX();
  33431. } else {
  33432. tempObj['analyst'][name] = summaryRegionJobParameter[name];
  33433. }
  33434. if (name === 'mappingParameters') {
  33435. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  33436. tempObj['analyst']['mappingParameters'] = summaryRegionJobParameter[name];
  33437. }
  33438. }
  33439. }
  33440. }
  33441. }]);
  33442. return SummaryRegionJobParameter;
  33443. }();
  33444. SuperMap.SummaryRegionJobParameter = SummaryRegionJobParameter;
  33445. ;// CONCATENATED MODULE: ./src/common/iServer/SummaryRegionJobsService.js
  33446. function SummaryRegionJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SummaryRegionJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { SummaryRegionJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SummaryRegionJobsService_typeof(obj); }
  33447. function SummaryRegionJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33448. 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); } }
  33449. function SummaryRegionJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SummaryRegionJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SummaryRegionJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  33450. function SummaryRegionJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SummaryRegionJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SummaryRegionJobsService_get(target, property, receiver || target); }
  33451. function SummaryRegionJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SummaryRegionJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  33452. 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 } }); if (superClass) SummaryRegionJobsService_setPrototypeOf(subClass, superClass); }
  33453. function SummaryRegionJobsService_setPrototypeOf(o, p) { SummaryRegionJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SummaryRegionJobsService_setPrototypeOf(o, p); }
  33454. 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); }; }
  33455. function SummaryRegionJobsService_possibleConstructorReturn(self, call) { if (call && (SummaryRegionJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return SummaryRegionJobsService_assertThisInitialized(self); }
  33456. function SummaryRegionJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33457. function SummaryRegionJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33458. function SummaryRegionJobsService_getPrototypeOf(o) { SummaryRegionJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SummaryRegionJobsService_getPrototypeOf(o); }
  33459. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33460. * This program are made available under the terms of the Apache License, Version 2.0
  33461. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33462. /**
  33463. * @class SuperMap.SummaryRegionJobsService
  33464. * @category iServer ProcessingService SummaryRegion
  33465. * @classdesc 区域汇总分析服务类
  33466. * @extends {SuperMap.ProcessingServiceBase}
  33467. * @param {string} url - 区域汇总分析服务地址。
  33468. * @param {Object} options - 参数。
  33469. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33470. * @param {Object} [options.headers] - 请求头。
  33471. */
  33472. var SummaryRegionJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  33473. SummaryRegionJobsService_inherits(SummaryRegionJobsService, _ProcessingServiceBas);
  33474. var _super = SummaryRegionJobsService_createSuper(SummaryRegionJobsService);
  33475. function SummaryRegionJobsService(url, options) {
  33476. var _this;
  33477. SummaryRegionJobsService_classCallCheck(this, SummaryRegionJobsService);
  33478. _this = _super.call(this, url, options);
  33479. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/summaryregion');
  33480. _this.CLASS_NAME = 'SuperMap.SummaryRegionJobsService';
  33481. return _this;
  33482. }
  33483. /**
  33484. *@override
  33485. */
  33486. SummaryRegionJobsService_createClass(SummaryRegionJobsService, [{
  33487. key: "destroy",
  33488. value: function destroy() {
  33489. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "destroy", this).call(this);
  33490. }
  33491. /**
  33492. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJobs
  33493. * @description 获取区域汇总分析任务集合。
  33494. */
  33495. }, {
  33496. key: "getSummaryRegionJobs",
  33497. value: function getSummaryRegionJobs() {
  33498. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, this.url);
  33499. }
  33500. /**
  33501. * @function SuperMap.SummaryRegionJobsService.prototype.getSummaryRegionJob
  33502. * @description 获取指定id的区域汇总分析任务。
  33503. * @param {string} id -要获取区域汇总分析任务的id
  33504. */
  33505. }, {
  33506. key: "getSummaryRegionJob",
  33507. value: function getSummaryRegionJob(id) {
  33508. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  33509. }
  33510. /**
  33511. * @function SuperMap.SummaryRegionJobsService.prototype.addSummaryRegionJob
  33512. * @description 新建区域汇总任务。
  33513. * @param {SuperMap.SummaryRegionJobParameter} params - 创建一个区域汇总任务的请求参数。
  33514. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  33515. */
  33516. }, {
  33517. key: "addSummaryRegionJob",
  33518. value: function addSummaryRegionJob(params, seconds) {
  33519. SummaryRegionJobsService_get(SummaryRegionJobsService_getPrototypeOf(SummaryRegionJobsService.prototype), "addJob", this).call(this, this.url, params, SummaryRegionJobParameter, seconds);
  33520. }
  33521. }]);
  33522. return SummaryRegionJobsService;
  33523. }(ProcessingServiceBase);
  33524. SuperMap.SummaryRegionJobsService = SummaryRegionJobsService;
  33525. ;// CONCATENATED MODULE: ./src/common/iServer/SupplyCenter.js
  33526. function SupplyCenter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33527. 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); } }
  33528. function SupplyCenter_createClass(Constructor, protoProps, staticProps) { if (protoProps) SupplyCenter_defineProperties(Constructor.prototype, protoProps); if (staticProps) SupplyCenter_defineProperties(Constructor, staticProps); return Constructor; }
  33529. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33530. * This program are made available under the terms of the Apache License, Version 2.0
  33531. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33532. /**
  33533. * @class SuperMap.SupplyCenter
  33534. * @category iServer NetworkAnalyst Location
  33535. * @classdesc 资源供给中心类。在资源分配和选址分区分析两个功能中使用。
  33536. * @param {Object} options - 参数。
  33537. * @param {number} options.maxWeight - 资源供给中心的最大耗费值。
  33538. * @param {number} options.nodeID - 资源供给中心点的结点 ID 号。资源供给中心必须是结点。
  33539. * @param {number} options.resourceValue - 资源供给中心能提供的最大服务量或商品数量。
  33540. * @param {SuperMap.SupplyCenterType} [options.type] - 资源供给中心点的类型常量。
  33541. */
  33542. var SupplyCenter = /*#__PURE__*/function () {
  33543. function SupplyCenter(options) {
  33544. SupplyCenter_classCallCheck(this, SupplyCenter);
  33545. /**
  33546. * @member {number} SuperMap.SupplyCenter.prototype.maxWeight
  33547. * @description 资源供给中心的最大耗费值。中心点最大阻值设置越小,表示中心点所提供的资源可影响范围越大。
  33548. * 最大阻力值是用来限制需求点到中心点的花费。
  33549. * 如果需求点(弧段或结点)到此中心的花费大于最大阻力值,则该需求点不属于该资源供给中心提供资源的范围。
  33550. */
  33551. this.maxWeight = null;
  33552. /**
  33553. * @member {number} SuperMap.SupplyCenter.prototype.nodeID
  33554. * @description 资源供给中心点的结点 ID 号,资源供给中心必须是结点。
  33555. */
  33556. this.nodeID = null;
  33557. /**
  33558. * @member {number} SuperMap.SupplyCenter.prototype.resourceValue
  33559. * @description 资源供给中心能提供的最大服务量或商品数量。例如资源中心为学校,资源中心资源量表示该学校能够接纳多少学生。
  33560. */
  33561. this.resourceValue = null;
  33562. /**
  33563. * @member {SuperMap.SupplyCenterType} [SuperMap.SupplyCenter.prototype.type]
  33564. * @description 资源供给中心点的类型常量。资源供给中心点的类型包括非中心,固定中心和可选中心。
  33565. * 固定中心用于资源分配分析;固定中心和可选中心用于选址分析;非中心在两种网络分析时都不予考虑。
  33566. */
  33567. this.type = null;
  33568. if (options) {
  33569. Util.extend(this, options);
  33570. }
  33571. this.CLASS_NAME = "SuperMap.SupplyCenter";
  33572. }
  33573. /**
  33574. * @function SuperMap.SupplyCenter.prototype.destroy
  33575. * @description 释放资源,将引用资源的属性置空。
  33576. */
  33577. SupplyCenter_createClass(SupplyCenter, [{
  33578. key: "destroy",
  33579. value: function destroy() {
  33580. var me = this;
  33581. me.maxWeight = null;
  33582. me.nodeID = null;
  33583. me.resourceValue = null;
  33584. me.type = null;
  33585. }
  33586. /**
  33587. * @function SuperMap.SupplyCenter.fromJson
  33588. * @description 将服务端 JSON 对象转换成当前客户端对象。
  33589. * @param {Object} jsonObject - 要转换的 JSON 对象。
  33590. * @returns {SuperMap.SupplyCenter} SupplyCenter 对象。
  33591. */
  33592. }], [{
  33593. key: "fromJson",
  33594. value: function fromJson(jsonObject) {
  33595. if (!jsonObject) {
  33596. return;
  33597. }
  33598. return new SupplyCenter({
  33599. maxWeight: jsonObject.maxWeight,
  33600. nodeID: jsonObject.nodeID,
  33601. resourceValue: jsonObject.resourceValue,
  33602. type: jsonObject.type
  33603. });
  33604. }
  33605. }]);
  33606. return SupplyCenter;
  33607. }();
  33608. SuperMap.SupplyCenter = SupplyCenter;
  33609. ;// CONCATENATED MODULE: ./src/common/iServer/SurfaceAnalystService.js
  33610. function SurfaceAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SurfaceAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { SurfaceAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SurfaceAnalystService_typeof(obj); }
  33611. function SurfaceAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33612. 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); } }
  33613. function SurfaceAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SurfaceAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SurfaceAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  33614. function SurfaceAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SurfaceAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SurfaceAnalystService_get(target, property, receiver || target); }
  33615. function SurfaceAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SurfaceAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  33616. 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 } }); if (superClass) SurfaceAnalystService_setPrototypeOf(subClass, superClass); }
  33617. function SurfaceAnalystService_setPrototypeOf(o, p) { SurfaceAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SurfaceAnalystService_setPrototypeOf(o, p); }
  33618. 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); }; }
  33619. function SurfaceAnalystService_possibleConstructorReturn(self, call) { if (call && (SurfaceAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SurfaceAnalystService_assertThisInitialized(self); }
  33620. function SurfaceAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33621. function SurfaceAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33622. function SurfaceAnalystService_getPrototypeOf(o) { SurfaceAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SurfaceAnalystService_getPrototypeOf(o); }
  33623. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33624. * This program are made available under the terms of the Apache License, Version 2.0
  33625. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33626. /**
  33627. * @class SuperMap.SurfaceAnalystService
  33628. * @category iServer SpatialAnalyst SurfaceAnalyst
  33629. * @classdesc 表面分析服务类。
  33630. * 该类负责将客户设置的表面分析服务参数传递给服务端,并接收服务端返回的表面分析服务分析结果数据。
  33631. * 表面分析结果通过该类支持的事件的监听函数参数获取
  33632. * @param {string} url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst
  33633. * @param {Object} options - 参数。</br>
  33634. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33635. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33636. * @param {Object} [options.headers] - 请求头。
  33637. * @extends {SuperMap.SpatialAnalystBase}
  33638. * @example 例如:
  33639. * (start code)
  33640. * var mySurfaceAnalystService = new SuperMap.SurfaceAnalystService(url, {
  33641. * eventListeners: {
  33642. * "processCompleted": surfaceAnalysCompleted,
  33643. * "processFailed": surfaceAnalysFailed
  33644. * }
  33645. * });
  33646. * (end)
  33647. *
  33648. */
  33649. var SurfaceAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  33650. SurfaceAnalystService_inherits(SurfaceAnalystService, _SpatialAnalystBase);
  33651. var _super = SurfaceAnalystService_createSuper(SurfaceAnalystService);
  33652. function SurfaceAnalystService(url, options) {
  33653. var _this;
  33654. SurfaceAnalystService_classCallCheck(this, SurfaceAnalystService);
  33655. _this = _super.call(this, url, options);
  33656. _this.CLASS_NAME = "SuperMap.SurfaceAnalystService";
  33657. return _this;
  33658. }
  33659. /**
  33660. * @function SuperMap.SurfaceAnalystService.prototype.destroy
  33661. * @description 释放资源,将引用的资源属性置空。
  33662. */
  33663. SurfaceAnalystService_createClass(SurfaceAnalystService, [{
  33664. key: "destroy",
  33665. value: function destroy() {
  33666. SurfaceAnalystService_get(SurfaceAnalystService_getPrototypeOf(SurfaceAnalystService.prototype), "destroy", this).call(this);
  33667. }
  33668. /**
  33669. * @function SuperMap.SurfaceAnalystService.prototype.processAsync
  33670. * @description 负责将客户端的表面分析服务参数传递到服务端。
  33671. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  33672. */
  33673. }, {
  33674. key: "processAsync",
  33675. value: function processAsync(params) {
  33676. if (!(params instanceof SurfaceAnalystParameters)) {
  33677. return;
  33678. }
  33679. var me = this,
  33680. jsonParameters;
  33681. jsonParameters = me.getJsonParameters(params);
  33682. me.request({
  33683. method: "POST",
  33684. data: jsonParameters,
  33685. scope: me,
  33686. success: me.serviceProcessCompleted,
  33687. failure: me.serviceProcessFailed
  33688. });
  33689. }
  33690. /**
  33691. * @function SuperMap.SurfaceAnalystService.prototype.getJsonParameters
  33692. * @description 将参数转化为 JSON 字符串。
  33693. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析提取操作参数类。
  33694. * @returns {Object} 转化后的JSON字符串。
  33695. */
  33696. }, {
  33697. key: "getJsonParameters",
  33698. value: function getJsonParameters(params) {
  33699. var jsonParameters = '';
  33700. var parameterObject = {};
  33701. var me = this;
  33702. if (params instanceof DatasetSurfaceAnalystParameters) {
  33703. me.url = Util.urlPathAppend(me.url, 'datasets/' + params.dataset + '/' + params.surfaceAnalystMethod.toLowerCase());
  33704. DatasetSurfaceAnalystParameters.toObject(params, parameterObject);
  33705. jsonParameters = Util.toJSON(parameterObject);
  33706. } else if (params instanceof GeometrySurfaceAnalystParameters) {
  33707. me.url = Util.urlPathAppend(me.url, 'geometry/' + params.surfaceAnalystMethod.toLowerCase());
  33708. jsonParameters = Util.toJSON(params);
  33709. } else {
  33710. return;
  33711. }
  33712. me.url = Util.urlAppend(me.url, 'returnContent=true');
  33713. return jsonParameters;
  33714. }
  33715. }]);
  33716. return SurfaceAnalystService;
  33717. }(SpatialAnalystBase);
  33718. SuperMap.SurfaceAnalystService = SurfaceAnalystService;
  33719. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationParameters.js
  33720. function TerrainCurvatureCalculationParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33721. 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); } }
  33722. function TerrainCurvatureCalculationParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationParameters_defineProperties(Constructor, staticProps); return Constructor; }
  33723. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33724. * This program are made available under the terms of the Apache License, Version 2.0
  33725. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33726. /**
  33727. * @class SuperMap.TerrainCurvatureCalculationParameters
  33728. * @category iServer SpatialAnalyst TerrainCalculation
  33729. * @classdesc 地形曲率计算参数类。
  33730. * @param {Object} options - 参数。
  33731. * @param {string} options.dataset - 要用来做地形曲率计算数据源中数据集的名称。该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  33732. * @param {string} options.averageCurvatureName - 结果数据集:平均曲率数据集的名称。
  33733. * @param {string} options.profileCurvatureName - 结果数据集:剖面曲率数据集的名称。
  33734. * @param {string} options.planCurvatureName - 结果数据集:平面曲率数据集的名称。
  33735. * @param {number} [options.zFactor=1.0] - 指定的高程缩放系数。1.0 表示不缩放。
  33736. * @param {boolean} [options.deleteExistResultDataset=false] - 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  33737. */
  33738. var TerrainCurvatureCalculationParameters = /*#__PURE__*/function () {
  33739. function TerrainCurvatureCalculationParameters(options) {
  33740. TerrainCurvatureCalculationParameters_classCallCheck(this, TerrainCurvatureCalculationParameters);
  33741. if (!options) {
  33742. return;
  33743. }
  33744. /**
  33745. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.dataset
  33746. * @description 要用来做地形曲率计算数据源中数据集的名称。
  33747. * 该名称用形如"数据集名称@数据源别名"形式来表示,例如:JingjinTerrain@Jingjin。
  33748. * 注:地形曲率计算必须为栅格数据集。
  33749. */
  33750. this.dataset = null;
  33751. /**
  33752. * @member {number} [SuperMap.TerrainCurvatureCalculationParameters.prototype.zFactor=1.0]
  33753. * @description 指定的高程缩放系数。1.0 表示不缩放。
  33754. * 该值是指在 DEM 栅格数据中,栅格值( Z 坐标,即高程值)相对于 X 和 Y 坐标的单位变换系数。
  33755. * 通常有 X,Y,Z 都参加的计算中,需要将高程值乘以一个高程缩放系数,使得三者单位一致。
  33756. * 例如,X、Y 方向上的单位是米,而 Z 方向的单位是英尺,由于 1 英尺等于 0.3048 米,则需要指定缩放系数为 0.3048。
  33757. */
  33758. this.zFactor = 1.0;
  33759. /**
  33760. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.averageCurvatureName
  33761. * @description 结果数据集:平均曲率数据集的名称。
  33762. */
  33763. this.averageCurvatureName = null;
  33764. /**
  33765. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.profileCurvatureName
  33766. * @description 结果数据集:剖面曲率数据集的名称。
  33767. */
  33768. this.profileCurvatureName = "";
  33769. /**
  33770. * @member {string} SuperMap.TerrainCurvatureCalculationParameters.prototype.planCurvatureName
  33771. * @description 结果数据集:平面曲率数据集的名称。
  33772. */
  33773. this.planCurvatureName = "";
  33774. /**
  33775. * @member {boolean} [SuperMap.TerrainCurvatureCalculationParameters.prototype.deleteExistResultDataset=false]
  33776. * @description 如果用户命名的结果数据集名称与已有的数据集重名,是否删除已有的数据集。
  33777. */
  33778. this.deleteExistResultDataset = false;
  33779. Util.extend(this, options);
  33780. this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationParameters";
  33781. }
  33782. /**
  33783. * @function SuperMap.TerrainCurvatureCalculationParameters.prototype.destroy
  33784. * @description 释放资源,将引用资源的属性置空。
  33785. */
  33786. TerrainCurvatureCalculationParameters_createClass(TerrainCurvatureCalculationParameters, [{
  33787. key: "destroy",
  33788. value: function destroy() {
  33789. var me = this;
  33790. me.dataset = null;
  33791. me.zFactor = 1.0;
  33792. me.averageCurvatureName = null;
  33793. me.profileCurvatureName = null;
  33794. me.planCurvatureName = null;
  33795. me.deleteExistResultDataset = true;
  33796. }
  33797. /**
  33798. * @function SuperMap.TerrainCurvatureCalculationParameters.toObject
  33799. * @param {Object} derrainCurvatureCalculationParameters - 地形曲率计算参数。
  33800. * @param {Object} tempObj - 目标对象。
  33801. * @description 生成地形曲率计算对象。
  33802. */
  33803. }], [{
  33804. key: "toObject",
  33805. value: function toObject(derrainCurvatureCalculationParameters, tempObj) {
  33806. for (var name in derrainCurvatureCalculationParameters) {
  33807. if (name !== "dataset") {
  33808. tempObj[name] = derrainCurvatureCalculationParameters[name];
  33809. }
  33810. }
  33811. }
  33812. }]);
  33813. return TerrainCurvatureCalculationParameters;
  33814. }();
  33815. SuperMap.TerrainCurvatureCalculationParameters = TerrainCurvatureCalculationParameters;
  33816. ;// CONCATENATED MODULE: ./src/common/iServer/TerrainCurvatureCalculationService.js
  33817. function TerrainCurvatureCalculationService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TerrainCurvatureCalculationService_typeof = function _typeof(obj) { return typeof obj; }; } else { TerrainCurvatureCalculationService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TerrainCurvatureCalculationService_typeof(obj); }
  33818. function TerrainCurvatureCalculationService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33819. 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); } }
  33820. function TerrainCurvatureCalculationService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TerrainCurvatureCalculationService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TerrainCurvatureCalculationService_defineProperties(Constructor, staticProps); return Constructor; }
  33821. function TerrainCurvatureCalculationService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TerrainCurvatureCalculationService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TerrainCurvatureCalculationService_get(target, property, receiver || target); }
  33822. function TerrainCurvatureCalculationService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TerrainCurvatureCalculationService_getPrototypeOf(object); if (object === null) break; } return object; }
  33823. 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 } }); if (superClass) TerrainCurvatureCalculationService_setPrototypeOf(subClass, superClass); }
  33824. function TerrainCurvatureCalculationService_setPrototypeOf(o, p) { TerrainCurvatureCalculationService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TerrainCurvatureCalculationService_setPrototypeOf(o, p); }
  33825. 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); }; }
  33826. function TerrainCurvatureCalculationService_possibleConstructorReturn(self, call) { if (call && (TerrainCurvatureCalculationService_typeof(call) === "object" || typeof call === "function")) { return call; } return TerrainCurvatureCalculationService_assertThisInitialized(self); }
  33827. function TerrainCurvatureCalculationService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  33828. function TerrainCurvatureCalculationService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  33829. function TerrainCurvatureCalculationService_getPrototypeOf(o) { TerrainCurvatureCalculationService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TerrainCurvatureCalculationService_getPrototypeOf(o); }
  33830. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33831. * This program are made available under the terms of the Apache License, Version 2.0
  33832. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33833. /**
  33834. * @class SuperMap.TerrainCurvatureCalculationService
  33835. * @category iServer SpatialAnalyst TerrainCalculation
  33836. * @classdesc 地形曲率计算服务类。
  33837. * @extends {SuperMap.SpatialAnalystBase}
  33838. * @param {Object} options - 参数。
  33839. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  33840. * @param {string} options.url - 服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst 。
  33841. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  33842. * @param {Object} [options.headers] - 请求头。
  33843. * @example 例如:
  33844. * (start code)
  33845. * var myTerrainCurvatureCalculationService = new SuperMap.TerrainCurvatureCalculationService(url);
  33846. * myTerrainCurvatureCalculationService.on({
  33847. * "processCompleted": processCompleted,
  33848. * "processFailed": processFailed
  33849. * }
  33850. * );
  33851. * (end)
  33852. *
  33853. */
  33854. var TerrainCurvatureCalculationService = /*#__PURE__*/function (_SpatialAnalystBase) {
  33855. TerrainCurvatureCalculationService_inherits(TerrainCurvatureCalculationService, _SpatialAnalystBase);
  33856. var _super = TerrainCurvatureCalculationService_createSuper(TerrainCurvatureCalculationService);
  33857. function TerrainCurvatureCalculationService(url, options) {
  33858. var _this;
  33859. TerrainCurvatureCalculationService_classCallCheck(this, TerrainCurvatureCalculationService);
  33860. _this = _super.call(this, url, options);
  33861. _this.CLASS_NAME = "SuperMap.TerrainCurvatureCalculationService";
  33862. return _this;
  33863. }
  33864. /**
  33865. *@override
  33866. */
  33867. TerrainCurvatureCalculationService_createClass(TerrainCurvatureCalculationService, [{
  33868. key: "destroy",
  33869. value: function destroy() {
  33870. TerrainCurvatureCalculationService_get(TerrainCurvatureCalculationService_getPrototypeOf(TerrainCurvatureCalculationService.prototype), "destroy", this).call(this);
  33871. }
  33872. /**
  33873. * @function SuperMap.TerrainCurvatureCalculationService.prototype.processAsync
  33874. * @description 负责将客户端的查询参数传递到服务端。
  33875. * @param {SuperMap.TerrainCurvatureCalculationParameters} parameter - 地形曲率计算参数类。
  33876. */
  33877. }, {
  33878. key: "processAsync",
  33879. value: function processAsync(parameter) {
  33880. var me = this;
  33881. var parameterObject = {};
  33882. if (parameter instanceof TerrainCurvatureCalculationParameters) {
  33883. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/terraincalculation/curvature');
  33884. }
  33885. TerrainCurvatureCalculationParameters.toObject(parameter, parameterObject);
  33886. var jsonParameters = SuperMap.Util.toJSON(parameterObject);
  33887. me.url = Util.urlAppend(me.url, 'returnContent=true');
  33888. me.request({
  33889. method: "POST",
  33890. data: jsonParameters,
  33891. scope: me,
  33892. success: me.serviceProcessCompleted,
  33893. failure: me.serviceProcessFailed
  33894. });
  33895. }
  33896. }]);
  33897. return TerrainCurvatureCalculationService;
  33898. }(SpatialAnalystBase);
  33899. SuperMap.TerrainCurvatureCalculationService = TerrainCurvatureCalculationService;
  33900. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRangeItem.js
  33901. function ThemeGridRangeItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  33902. 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); } }
  33903. function ThemeGridRangeItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRangeItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRangeItem_defineProperties(Constructor, staticProps); return Constructor; }
  33904. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  33905. * This program are made available under the terms of the Apache License, Version 2.0
  33906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  33907. /**
  33908. * @class SuperMap.ThemeGridRangeItem
  33909. * @category iServer Map Theme
  33910. * @classdesc 栅格分段专题图子项类。
  33911. * @description 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  33912. * 本类用来设置每个范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  33913. * @param {Object} options - 参数。
  33914. * @param {SuperMap.ServerColor} options.color - 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  33915. * @param {string} [options.caption] - 栅格分段专题图子项的标题。
  33916. * @param {number} [options.end=0] - 栅格分段专题图子项的终止值。
  33917. * @param {number} [options.start=0] - 栅格分段专题图子项的起始值。
  33918. * @param {boolean} [options.visible=true] - 栅格分段专题图子项是否可见。
  33919. */
  33920. var ThemeGridRangeItem = /*#__PURE__*/function () {
  33921. function ThemeGridRangeItem(options) {
  33922. ThemeGridRangeItem_classCallCheck(this, ThemeGridRangeItem);
  33923. /**
  33924. * @member {string} [SuperMap.ThemeGridRangeItem.prototype.caption]
  33925. * @description 栅格分段专题图子项的标题。
  33926. */
  33927. this.caption = null;
  33928. /**
  33929. * @member {SuperMap.ServerColor} SuperMap.ThemeGridRangeItem.prototype.color
  33930. * @description 栅格分段专题图中每一个分段专题图子项的对应的颜色。
  33931. */
  33932. this.color = new ServerColor();
  33933. /**
  33934. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.end=0]
  33935. * @description 栅格分段专题图子项的终止值,即该段专题值范围的最大值。
  33936. */
  33937. this.end = 0;
  33938. /**
  33939. * @member {number} [SuperMap.ThemeGridRangeItem.prototype.start=0]
  33940. * @description 栅格分段专题图子项的起始值,即该段专题值范围的最小值。
  33941. */
  33942. this.start = 0;
  33943. /**
  33944. * @member {boolean} [SuperMap.ThemeGridRangeItem.prototype.visible=true]
  33945. * @description 栅格分段专题图子项是否可见。
  33946. */
  33947. this.visible = true;
  33948. if (options) {
  33949. Util.extend(this, options);
  33950. }
  33951. this.CLASS_NAME = "SuperMap.ThemeGridRangeItem";
  33952. }
  33953. /**
  33954. * @function SuperMap.ThemeGridRangeItem.prototype.destroy
  33955. * @description 释放资源,将引用资源的属性置空。
  33956. */
  33957. ThemeGridRangeItem_createClass(ThemeGridRangeItem, [{
  33958. key: "destroy",
  33959. value: function destroy() {
  33960. var me = this;
  33961. me.caption = null;
  33962. me.end = null;
  33963. me.start = null; //需要验证是够存在destroy方法
  33964. if (me.color) {
  33965. me.color.destroy();
  33966. me.color = null;
  33967. }
  33968. me.visible = null;
  33969. }
  33970. /**
  33971. * @function SuperMap.ThemeGridRangeItem.prototype.toServerJSONObject
  33972. * @description 转换成对应的 JSON 格式对象。
  33973. * @returns {Object} 对应的 JSON 格式对象。
  33974. */
  33975. }, {
  33976. key: "toServerJSONObject",
  33977. value: function toServerJSONObject() {
  33978. var obj = {};
  33979. obj = Util.copyAttributes(obj, this);
  33980. if (obj.color) {
  33981. if (obj.color.toServerJSONObject) {
  33982. obj.color = obj.color.toServerJSONObject();
  33983. }
  33984. }
  33985. return obj;
  33986. }
  33987. /**
  33988. * @function SuperMap.ThemeGridRangeItem.fromObj
  33989. * @description 从传入对象获取栅格分段专题图子项类。
  33990. * @param {Object} obj - 传入对象。
  33991. * @returns {SuperMap.ThemeGridRangeItem} ThemeGridRangeItem 对象。
  33992. */
  33993. }], [{
  33994. key: "fromObj",
  33995. value: function fromObj(obj) {
  33996. if (!obj) {
  33997. return;
  33998. }
  33999. var res = new ThemeGridRangeItem();
  34000. Util.copy(res, obj);
  34001. res.color = ServerColor.fromJson(obj.color);
  34002. return res;
  34003. }
  34004. }]);
  34005. return ThemeGridRangeItem;
  34006. }();
  34007. SuperMap.ThemeGridRangeItem = ThemeGridRangeItem;
  34008. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridRange.js
  34009. function ThemeGridRange_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGridRange_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGridRange_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGridRange_typeof(obj); }
  34010. function ThemeGridRange_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34011. 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); } }
  34012. function ThemeGridRange_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridRange_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridRange_defineProperties(Constructor, staticProps); return Constructor; }
  34013. function ThemeGridRange_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridRange_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeGridRange_get(target, property, receiver || target); }
  34014. function ThemeGridRange_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridRange_getPrototypeOf(object); if (object === null) break; } return object; }
  34015. 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 } }); if (superClass) ThemeGridRange_setPrototypeOf(subClass, superClass); }
  34016. function ThemeGridRange_setPrototypeOf(o, p) { ThemeGridRange_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridRange_setPrototypeOf(o, p); }
  34017. 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); }; }
  34018. function ThemeGridRange_possibleConstructorReturn(self, call) { if (call && (ThemeGridRange_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridRange_assertThisInitialized(self); }
  34019. function ThemeGridRange_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34020. function ThemeGridRange_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34021. function ThemeGridRange_getPrototypeOf(o) { ThemeGridRange_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridRange_getPrototypeOf(o); }
  34022. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34023. * This program are made available under the terms of the Apache License, Version 2.0
  34024. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34025. /**
  34026. * @class SuperMap.ThemeGridRange
  34027. * @category iServer Map Theme
  34028. * @classdesc 栅格分段专题图。
  34029. * @description 栅格分段专题图,是将所有单元格的值按照某种分段方式分成多个范围段,值在同一个范围段中的单元格使用相同的颜色进行显示。
  34030. * 栅格分段专题图一般用来反映连续分布现象的数量或程度特征。比如某年的全国降水量分布图,将各气象站点的观测值经过内插之后生成的栅格数据进行分段显示。
  34031. * 该类类似于分段专题图类,不同点在于分段专题图的操作对象是矢量数据,而栅格分段专题图的操作对象是栅格数据。
  34032. * @extends {SuperMap.Theme}
  34033. * @param {Object} options - 参数。
  34034. * @param {Array.<SuperMap.ThemeGridRangeItem>} options.items - 栅格分段专题图子项数组。
  34035. * @param {boolean} [options.reverseColor=false] - 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  34036. * @param {SuperMap.RangeMode} [options.rangeMode=SuperMap.RangeMode.EQUALINTERVAL] - 分段专题图的分段模式。
  34037. * @param {number} [options.rangeParameter=0] - 分段参数。
  34038. * @param {SuperMap.ColorGradientType} [options.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED] - 渐变颜色枚举类。
  34039. */
  34040. var ThemeGridRange = /*#__PURE__*/function (_Theme) {
  34041. ThemeGridRange_inherits(ThemeGridRange, _Theme);
  34042. var _super = ThemeGridRange_createSuper(ThemeGridRange);
  34043. function ThemeGridRange(options) {
  34044. var _this;
  34045. ThemeGridRange_classCallCheck(this, ThemeGridRange);
  34046. _this = _super.call(this, "GRIDRANGE", options);
  34047. /**
  34048. * @member {Array.<SuperMap.ThemeGridRangeItem>} SuperMap.ThemeGridRange.prototype.items
  34049. * @description 栅格分段专题图子项数组。<br>
  34050. * 在栅格分段专题图中,将栅格值按照某种分段模式被分成多个范围段。
  34051. * 本类用来设置每个栅格范围段的分段起始值、终止值、名称和颜色等。每个分段所表示的范围为 [Start,End)。
  34052. */
  34053. _this.items = null;
  34054. /**
  34055. * @member {SuperMap.RangeMode} [SuperMap.ThemeGridRange.prototype.rangeMode=SuperMap.RangeMode.EQUALINTERVAL]
  34056. * @description 分段专题图的分段模式。<br>
  34057. * 在栅格分段专题图中,作为专题变量的字段或表达式的值按照某种分段方式被分成多个范围段。
  34058. * 目前 SuperMap 提供的分段方式包括:等距离分段法、平方根分段法、标准差分段法、对数分段法、等计数分段法和自定义距离法,
  34059. * 显然这些分段方法根据一定的距离进行分段,因而范围分段专题图所基于的专题变量必须为数值型。
  34060. */
  34061. _this.rangeMode = RangeMode.EQUALINTERVAL;
  34062. /**
  34063. * @member {number} [SuperMap.ThemeGridRange.prototype.rangeParameter=0]
  34064. * @description 分段参数。<br>
  34065. * 当分段模式为等距离分段法,平方根分段,对数分段法,计数分段法其中一种模式时,该参数用于设置分段个数,必设;当分段模式为标准差分段法时,
  34066. * 该参数不起作用;当分段模式为自定义距离时,该参数用于设置自定义距离。
  34067. */
  34068. _this.rangeParameter = 0;
  34069. /**
  34070. * @member {SuperMap.ColorGradientType} [SuperMap.ThemeGridRange.prototype.colorGradientType=SuperMap.ColorGradientType.YELLOW_RED]
  34071. * @description 渐变颜色枚举类。
  34072. *
  34073. */
  34074. _this.colorGradientType = ColorGradientType.YELLOW_RED;
  34075. /**
  34076. * @member {boolean} SuperMap.ThemeGridRange.prototype.reverseColor
  34077. * @description 是否对栅格分段专题图中分段的颜色风格进行反序显示。
  34078. */
  34079. _this.reverseColor = false;
  34080. if (options) {
  34081. Util.extend(ThemeGridRange_assertThisInitialized(_this), options);
  34082. }
  34083. _this.CLASS_NAME = "SuperMap.ThemeGridRange";
  34084. return _this;
  34085. }
  34086. /**
  34087. * @function SuperMap.ThemeGridRange.prototype.destroy
  34088. * @override
  34089. */
  34090. ThemeGridRange_createClass(ThemeGridRange, [{
  34091. key: "destroy",
  34092. value: function destroy() {
  34093. ThemeGridRange_get(ThemeGridRange_getPrototypeOf(ThemeGridRange.prototype), "destroy", this).call(this);
  34094. var me = this;
  34095. if (me.items) {
  34096. if (me.items.length > 0) {
  34097. for (var item in me.items) {
  34098. me.items[item].destroy();
  34099. me.items[item] = null;
  34100. }
  34101. }
  34102. me.items = null;
  34103. }
  34104. me.reverseColor = null;
  34105. me.rangeMode = null;
  34106. me.rangeParameter = null;
  34107. me.colorGradientType = null;
  34108. }
  34109. /**
  34110. * @function SuperMap.ThemeGridRange.fromObj
  34111. * @description 从传入对象获取栅格分段专题图。
  34112. * @param {Object} obj - 传入对象。
  34113. * @returns {SuperMap.ThemeGridRange} ThemeGridRange 对象。
  34114. */
  34115. }], [{
  34116. key: "fromObj",
  34117. value: function fromObj(obj) {
  34118. if (!obj) {
  34119. return;
  34120. }
  34121. var res = new ThemeGridRange();
  34122. Util.copy(res, obj);
  34123. var itemsR = obj.items;
  34124. var len = itemsR ? itemsR.length : 0;
  34125. res.items = [];
  34126. for (var i = 0; i < len; i++) {
  34127. res.items.push(ThemeGridRangeItem.fromObj(itemsR[i]));
  34128. }
  34129. return res;
  34130. }
  34131. }]);
  34132. return ThemeGridRange;
  34133. }(Theme);
  34134. SuperMap.ThemeGridRange = ThemeGridRange;
  34135. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUniqueItem.js
  34136. function ThemeGridUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34137. 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); } }
  34138. function ThemeGridUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  34139. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34140. * This program are made available under the terms of the Apache License, Version 2.0
  34141. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34142. /**
  34143. * @class SuperMap.ThemeGridUniqueItem
  34144. * @category iServer Map Theme
  34145. * @classdesc 栅格单值专题图子项类。
  34146. * 栅格单值专题图是将值相同的单元格归为一类,每一类是一个专题图子项。
  34147. * @param {Object} options - 参数。
  34148. * @param {string} [options.caption] - 栅格单值专题图子项的名称。
  34149. * @param {SuperMap.ServerColor} [options.color] - 栅格单值专题图子项的显示颜色。
  34150. * @param {number} options.unique - 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  34151. * @param {boolean} [options.visible=true] - 栅格单值专题图子项是否可见。
  34152. */
  34153. var ThemeGridUniqueItem = /*#__PURE__*/function () {
  34154. function ThemeGridUniqueItem(options) {
  34155. ThemeGridUniqueItem_classCallCheck(this, ThemeGridUniqueItem);
  34156. /**
  34157. * @member {string} [SuperMap.ThemeGridUniqueItem.prototype.caption]
  34158. * @description 栅格单值专题图子项的名称。
  34159. */
  34160. this.caption = null;
  34161. /**
  34162. * @member {SuperMap.ServerColor} [SuperMap.ThemeGridUniqueItem.prototype.color]
  34163. * @description 栅格单值专题图子项的显示颜色。
  34164. */
  34165. this.color = new ServerColor();
  34166. /**
  34167. * @member {number} SuperMap.ThemeGridUniqueItem.prototype.unique
  34168. * @description 栅格单值专题图子项的专题值,即单元格的值,值相同的单元格位于一个子项内。
  34169. */
  34170. this.unique = null;
  34171. /**
  34172. * @member {boolean} [SuperMap.ThemeGridUniqueItem.prototype.visible=true]
  34173. * @description 栅格单值专题图子项是否可见。
  34174. */
  34175. this.visible = true;
  34176. if (options) {
  34177. Util.extend(this, options);
  34178. }
  34179. this.CLASS_NAME = "SuperMap.ThemeGridUniqueItem";
  34180. }
  34181. /**
  34182. * @function SuperMap.ThemeGridUniqueItem.prototype.destroy
  34183. * @description 释放资源,将引用资源的属性置空。
  34184. */
  34185. ThemeGridUniqueItem_createClass(ThemeGridUniqueItem, [{
  34186. key: "destroy",
  34187. value: function destroy() {
  34188. var me = this;
  34189. me.caption = null;
  34190. me.unique = null;
  34191. if (me.color) {
  34192. me.color.destroy();
  34193. me.color = null;
  34194. }
  34195. me.visible = null;
  34196. }
  34197. /**
  34198. * @function SuperMap.ThemeGridUniqueItem.prototype.toServerJSONObject
  34199. * @description 转换成对应的 JSON 格式对象。
  34200. * @returns {Object} 对应的 JSON 格式对象。
  34201. */
  34202. }, {
  34203. key: "toServerJSONObject",
  34204. value: function toServerJSONObject() {
  34205. var obj = {};
  34206. obj = Util.copyAttributes(obj, this);
  34207. if (obj.color) {
  34208. if (obj.color.toServerJSONObject) {
  34209. obj.color = obj.color.toServerJSONObject();
  34210. }
  34211. }
  34212. return obj;
  34213. }
  34214. /**
  34215. * @function SuperMap.ThemeGridUniqueItem.fromObj
  34216. * @description 从传入对象获取栅格单值专题图子项类。
  34217. * @param {Object} obj - 传入对象。
  34218. * @returns {SuperMap.ThemeGridUniqueItem} ThemeGridUniqueItem 对象。
  34219. */
  34220. }], [{
  34221. key: "fromObj",
  34222. value: function fromObj(obj) {
  34223. var res = new ThemeGridUniqueItem();
  34224. Util.copy(res, obj);
  34225. res.color = ServerColor.fromJson(obj.color);
  34226. return res;
  34227. }
  34228. }]);
  34229. return ThemeGridUniqueItem;
  34230. }();
  34231. SuperMap.ThemeGridUniqueItem = ThemeGridUniqueItem;
  34232. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeGridUnique.js
  34233. function ThemeGridUnique_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeGridUnique_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeGridUnique_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeGridUnique_typeof(obj); }
  34234. function ThemeGridUnique_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34235. 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); } }
  34236. function ThemeGridUnique_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeGridUnique_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeGridUnique_defineProperties(Constructor, staticProps); return Constructor; }
  34237. function ThemeGridUnique_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeGridUnique_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeGridUnique_get(target, property, receiver || target); }
  34238. function ThemeGridUnique_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeGridUnique_getPrototypeOf(object); if (object === null) break; } return object; }
  34239. 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 } }); if (superClass) ThemeGridUnique_setPrototypeOf(subClass, superClass); }
  34240. function ThemeGridUnique_setPrototypeOf(o, p) { ThemeGridUnique_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeGridUnique_setPrototypeOf(o, p); }
  34241. 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); }; }
  34242. function ThemeGridUnique_possibleConstructorReturn(self, call) { if (call && (ThemeGridUnique_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeGridUnique_assertThisInitialized(self); }
  34243. function ThemeGridUnique_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34244. function ThemeGridUnique_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34245. function ThemeGridUnique_getPrototypeOf(o) { ThemeGridUnique_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeGridUnique_getPrototypeOf(o); }
  34246. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34247. * This program are made available under the terms of the Apache License, Version 2.0
  34248. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34249. /**
  34250. * @class SuperMap.ThemeGridUnique
  34251. * @category iServer Map Theme
  34252. * @classdesc 栅格单值专题图类。
  34253. * @description 栅格单值专题图,是将单元格值相同的归为一类,为每一类设定一种颜色,从而用来区分不同的类别。<br>
  34254. * 栅格单值专题图适用于离散栅格数据和部分连续栅格数据,对于单元格值各不相同的那些连续栅格数据,使用栅格单值专题图不具有任何意义。
  34255. * @extends {SuperMap.Theme}
  34256. * @param {Object} options - 参数。
  34257. * @param {Array.<SuperMap.ThemeGridUniqueItem>} options.items - 栅格单值专题图子项数组。
  34258. * @param {SuperMap.ServerColor} [options.defaultcolor] - 栅格单值专题图的默认颜色。
  34259. */
  34260. var ThemeGridUnique = /*#__PURE__*/function (_Theme) {
  34261. ThemeGridUnique_inherits(ThemeGridUnique, _Theme);
  34262. var _super = ThemeGridUnique_createSuper(ThemeGridUnique);
  34263. function ThemeGridUnique(options) {
  34264. var _this;
  34265. ThemeGridUnique_classCallCheck(this, ThemeGridUnique);
  34266. _this = _super.call(this, "GRIDUNIQUE", options);
  34267. /**
  34268. * @member {SuperMap.ServerColor} SuperMap.ThemeGridUnique.prototype.defaultcolor
  34269. * @description 栅格单值专题图的默认颜色。
  34270. * 对于那些未在格网单值专题图子项之列的要素使用该颜色显示。
  34271. */
  34272. _this.defaultcolor = new ServerColor();
  34273. /**
  34274. * @member {Array.<SuperMap.ThemeGridUniqueItem>} SuperMap.ThemeGridUnique.prototype.items
  34275. * @description 栅格单值专题图子项数组。
  34276. * 栅格单值专题图将值相同的单元格归为一类,每一类是一个专题图子项。
  34277. */
  34278. _this.items = null;
  34279. if (options) {
  34280. Util.extend(ThemeGridUnique_assertThisInitialized(_this), options);
  34281. }
  34282. _this.CLASS_NAME = "SuperMap.ThemeGridUnique";
  34283. return _this;
  34284. }
  34285. /**
  34286. * @function SuperMap.ThemeGridUnique.prototype.destroy
  34287. * @override
  34288. */
  34289. ThemeGridUnique_createClass(ThemeGridUnique, [{
  34290. key: "destroy",
  34291. value: function destroy() {
  34292. ThemeGridUnique_get(ThemeGridUnique_getPrototypeOf(ThemeGridUnique.prototype), "destroy", this).call(this);
  34293. var me = this;
  34294. if (me.items) {
  34295. if (me.items.length > 0) {
  34296. for (var item in me.items) {
  34297. me.items[item].destroy();
  34298. me.items[item] = null;
  34299. }
  34300. }
  34301. me.items = null;
  34302. }
  34303. if (me.defaultcolor) {
  34304. me.defaultcolor.destroy();
  34305. me.defaultcolor = null;
  34306. }
  34307. }
  34308. /**
  34309. * @function SuperMap.ThemeGridUnique.prototype.toServerJSONObject
  34310. * @description 转换成对应的 JSON 格式对象。
  34311. * @returns {Object} 对应的 JSON 格式对象
  34312. */
  34313. }, {
  34314. key: "toServerJSONObject",
  34315. value: function toServerJSONObject() {
  34316. var obj = {};
  34317. obj = Util.copyAttributes(obj, this);
  34318. if (obj.defaultcolor) {
  34319. if (obj.defaultcolor.toServerJSONObject) {
  34320. obj.defaultcolor = obj.defaultcolor.toServerJSONObject();
  34321. }
  34322. }
  34323. if (obj.items) {
  34324. var items = [],
  34325. len = obj.items.length;
  34326. for (var i = 0; i < len; i++) {
  34327. items.push(obj.items[i].toServerJSONObject());
  34328. }
  34329. obj.items = items;
  34330. }
  34331. return obj;
  34332. }
  34333. /**
  34334. * @function SuperMap.ThemeGridUnique.fromObj
  34335. * @description 从传入对象获取栅格单值专题图类。
  34336. * @param {Object} obj - 传入对象
  34337. * @returns {SuperMap.ThemeGridUnique} ThemeGridUnique 对象
  34338. */
  34339. }], [{
  34340. key: "fromObj",
  34341. value: function fromObj(obj) {
  34342. var res = new ThemeGridUnique();
  34343. var uItems = obj.items;
  34344. var len = uItems ? uItems.length : 0;
  34345. Util.extend(res, obj);
  34346. res.items = [];
  34347. res.defaultcolor = ServerColor.fromJson(obj.defaultcolor);
  34348. for (var i = 0; i < len; i++) {
  34349. res.items.push(ThemeGridUniqueItem.fromObj(uItems[i]));
  34350. }
  34351. return res;
  34352. }
  34353. }]);
  34354. return ThemeGridUnique;
  34355. }(Theme);
  34356. SuperMap.ThemeGridUnique = ThemeGridUnique;
  34357. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeLabelUniqueItem.js
  34358. function ThemeLabelUniqueItem_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34359. 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); } }
  34360. function ThemeLabelUniqueItem_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLabelUniqueItem_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLabelUniqueItem_defineProperties(Constructor, staticProps); return Constructor; }
  34361. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34362. * This program are made available under the terms of the Apache License, Version 2.0
  34363. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34364. /**
  34365. * @class SuperMap.ThemeLabelUniqueItem
  34366. * @category iServer Map Theme
  34367. * @classdesc 单值标签专题图的子项。
  34368. * @description 标签专题图用专题值对点、线、面等对象做标注,值得注意的是,单值标签专题图允许用户通过 uniqueExpression
  34369. * 字段指定用于单值的字段,同一值的标签具有相同的显示风格,其中每一个值就是一个专题图子项,
  34370. * 每一个子项都具有其名称、风格、指定的单值、X 方向偏移量和 Y 方向偏移量。
  34371. * @param {Object} options - 参数。
  34372. * @param {string} options.unique - 单值专题图子项的值,可以为数字、字符串等。
  34373. * @param {string} [options.caption] - 专题图子项的名称。
  34374. * @param {number} [options.offsetX=0] - 标签在 X 方向偏移量。
  34375. * @param {number} [options.offsetY=0] - 标签在 Y 方向偏移量。
  34376. * @param {boolean} [options.visible=true] - 标签专题图子项是否可见。
  34377. * @param {SuperMap.ServerTextStyle} [options.style] - 标签专题图子项文本的显示风格。
  34378. */
  34379. var ThemeLabelUniqueItem = /*#__PURE__*/function () {
  34380. function ThemeLabelUniqueItem(options) {
  34381. ThemeLabelUniqueItem_classCallCheck(this, ThemeLabelUniqueItem);
  34382. /**
  34383. * @member {string} [SuperMap.ThemeLabelUniqueItem.prototype.caption]
  34384. * @description 标签专题子项的标题。
  34385. */
  34386. this.caption = null;
  34387. /**
  34388. * @member {string} SuperMap.ThemeLabelUniqueItem.prototype.unique
  34389. * @description 单值专题图子项的值,可以为数字、字符串等。
  34390. */
  34391. this.unique = null;
  34392. /**
  34393. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetX=0]
  34394. * @description 标签在 X 方向偏移量。
  34395. */
  34396. this.offsetX = 0;
  34397. /**
  34398. * @member {number} [SuperMap.ThemeLabelUniqueItem.prototype.offsetY=0]
  34399. * @description 标签在 Y 方向偏移量。
  34400. */
  34401. this.offsetY = 0;
  34402. /**
  34403. * @member {boolean} [SuperMap.ThemeLabelUniqueItem.prototype.visible=true]
  34404. * @description 标签专题图子项是否可见。如果标签专题图子项可见,则为 true,否则为 false。
  34405. */
  34406. this.visible = true;
  34407. /**
  34408. * @member {SuperMap.ServerTextStyle} SuperMap.ThemeLabelUniqueItem.prototype.style
  34409. * @description 标签专题图子项文本的显示风格。各种风格的优先级从高到低为:<br>
  34410. * uniformMixedStyle(标签文本的复合风格),SuperMap.ThemeLabelUniqueItem.style(单值子项的文本风格),uniformStyle(统一文本风格)。
  34411. */
  34412. this.style = new ServerTextStyle();
  34413. if (options) {
  34414. Util.extend(this, options);
  34415. }
  34416. this.CLASS_NAME = "SuperMap.ThemeLabelUniqueItem";
  34417. }
  34418. /**
  34419. * @function SuperMap.ThemeLabelUniqueItem.prototype.destroy
  34420. * @description 释放资源,将引用资源的属性置空。
  34421. */
  34422. ThemeLabelUniqueItem_createClass(ThemeLabelUniqueItem, [{
  34423. key: "destroy",
  34424. value: function destroy() {
  34425. var me = this;
  34426. me.unique = null;
  34427. me.caption = null;
  34428. me.offsetX = null;
  34429. me.offsetY = null;
  34430. if (me.style) {
  34431. me.style.destroy();
  34432. me.style = null;
  34433. }
  34434. me.visible = null;
  34435. }
  34436. /**
  34437. * @function SuperMap.ThemeLabelUniqueItem.fromObj
  34438. * @description 从传入对象获取单值标签专题图的子项类。
  34439. * @param {Object} obj - 传入对象。
  34440. * @returns {SuperMap.ThemeLabelUniqueItem} ThemeLabelUniqueItem 对象。
  34441. */
  34442. }], [{
  34443. key: "fromObj",
  34444. value: function fromObj(obj) {
  34445. if (!obj) {
  34446. return;
  34447. }
  34448. var t = new ThemeLabelUniqueItem();
  34449. Util.copy(t, obj);
  34450. return t;
  34451. }
  34452. }]);
  34453. return ThemeLabelUniqueItem;
  34454. }();
  34455. SuperMap.ThemeLabelUniqueItem = ThemeLabelUniqueItem;
  34456. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeParameters.js
  34457. function ThemeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34458. 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); } }
  34459. function ThemeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  34460. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34461. * This program are made available under the terms of the Apache License, Version 2.0
  34462. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34463. /**
  34464. * @class SuperMap.ThemeParameters
  34465. * @category iServer Map Theme
  34466. * @classdesc 专题图参数类。
  34467. * 该类存储了制作专题所需的参数,包括数据源、数据集名称和专题图对象。
  34468. * @param {Object} options - 参数。
  34469. * @param {Array.<string>} options.datasetNames - 要制作专题图的数据集数组。
  34470. * @param {Array.<string>} options.dataSourceNames - 要制作专题图的数据集所在的数据源数组。
  34471. * @param {Array.<SuperMap.JoinItem>} [options.joinItems] - 专题图外部表的连接信息 JoinItem 数组。
  34472. * @param {Array.<SuperMap.Theme>} options.themes - 专题图对象列表。
  34473. * @param {Array.<string>} [options.displayFilters] - 专题图属性过滤条件。
  34474. * @param {Array.<string>} [options.displayOrderBys] - 专题图对象生成符号叠加次序排序字段。
  34475. * @param {Object} [options.fieldValuesDisplayFilter] - 图层要素的显示和隐藏的过滤属性,其带有三个属性,分别是:values、fieldName、fieldValuesDisplayMode。
  34476. */
  34477. var ThemeParameters = /*#__PURE__*/function () {
  34478. function ThemeParameters(options) {
  34479. ThemeParameters_classCallCheck(this, ThemeParameters);
  34480. /**
  34481. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.datasetNames
  34482. * @description 要制作专题图的数据集数组。
  34483. */
  34484. this.datasetNames = null;
  34485. /**
  34486. * @member {Array.<string>} SuperMap.ThemeParameters.prototype.dataSourceNames
  34487. * @description 要制作专题图的数据集所在的数据源数组。
  34488. */
  34489. this.dataSourceNames = null;
  34490. /**
  34491. * @member {Array.<SuperMap.JoinItem>} [SuperMap.ThemeParameters.prototype.joinItems]
  34492. * @description 设置与外部表的连接信息 JoinItem 数组。
  34493. * 使用此属性可以制作与外部表连接的专题图。
  34494. */
  34495. this.joinItems = null;
  34496. /**
  34497. * @member {Array.<SuperMap.Theme>} SuperMap.ThemeParameters.prototype.themes
  34498. * @description 专题图对象列表。
  34499. * 该参数为实例化的各类专题图对象的集合。
  34500. */
  34501. this.themes = null;
  34502. /**
  34503. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayFilters]
  34504. * @description 专题图属性过滤条件。
  34505. */
  34506. this.displayFilters = null;
  34507. /**
  34508. * @member {Array.<string>} [SuperMap.ThemeParameters.prototype.displayOrderBys]
  34509. * @description 专题图对象生成符号叠加次序排序字段。
  34510. */
  34511. this.displayOrderBys = null;
  34512. /**
  34513. * @member {Object} [SuperMap.ThemeParameters.prototype.fieldValuesDisplayFilter]
  34514. * @property {Array.<number>} values - 需要过滤的值。
  34515. * @property {string} fieldName - 要过滤的字段名称只支持数字类型的字段。
  34516. * @property {string} fieldValuesDisplayMode - 目前为 DISPLAY/DISABLE。当为 DISPLAY 时,表示只显示以上设置的相应属性值的要素,否则表示不显示以上设置的相应属性值的要素。
  34517. */
  34518. this.fieldValuesDisplayFilter = null;
  34519. if (options) {
  34520. Util.extend(this, options);
  34521. }
  34522. this.CLASS_NAME = "SuperMap.ThemeParameters";
  34523. }
  34524. /**
  34525. * @function SuperMap.ThemeParameters.prototype.destroy
  34526. * @description 释放资源,将引用资源的属性置空。
  34527. */
  34528. ThemeParameters_createClass(ThemeParameters, [{
  34529. key: "destroy",
  34530. value: function destroy() {
  34531. var me = this;
  34532. me.datasetNames = null;
  34533. me.dataSourceNames = null;
  34534. if (me.joinItems) {
  34535. for (var i = 0, joinItems = me.joinItems, len = joinItems.length; i < len; i++) {
  34536. joinItems[i].destroy();
  34537. }
  34538. me.joinItems = null;
  34539. }
  34540. if (me.themes) {
  34541. for (var _i = 0, themes = me.themes, _len = themes.length; _i < _len; _i++) {
  34542. themes[_i].destroy();
  34543. }
  34544. me.themes = null;
  34545. }
  34546. }
  34547. }]);
  34548. return ThemeParameters;
  34549. }();
  34550. SuperMap.ThemeParameters = ThemeParameters;
  34551. ;// CONCATENATED MODULE: ./src/common/iServer/ThemeService.js
  34552. function ThemeService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeService_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeService_typeof(obj); }
  34553. function ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34554. 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); } }
  34555. function ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  34556. function ThemeService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeService_get(target, property, receiver || target); }
  34557. function ThemeService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeService_getPrototypeOf(object); if (object === null) break; } return object; }
  34558. 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 } }); if (superClass) ThemeService_setPrototypeOf(subClass, superClass); }
  34559. function ThemeService_setPrototypeOf(o, p) { ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeService_setPrototypeOf(o, p); }
  34560. 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); }; }
  34561. function ThemeService_possibleConstructorReturn(self, call) { if (call && (ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeService_assertThisInitialized(self); }
  34562. function ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34563. function ThemeService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34564. function ThemeService_getPrototypeOf(o) { ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeService_getPrototypeOf(o); }
  34565. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34566. * This program are made available under the terms of the Apache License, Version 2.0
  34567. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34568. /**
  34569. * @class SuperMap.ThemeService
  34570. * @category iServer Map Theme
  34571. * @classdesc 专题图服务类。
  34572. * @extends {SuperMap.CommonServiceBase}
  34573. * @example
  34574. * var myThemeService = new SuperMap.ThemeService(url, {
  34575. * eventListeners: {
  34576. * "processCompleted": themeCompleted,
  34577. * "processFailed": themeFailed
  34578. * }
  34579. * });
  34580. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map 。
  34581. * @param {Object} options - 参数。
  34582. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34583. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34584. * @param {Object} [options.headers] - 请求头。
  34585. */
  34586. var ThemeService_ThemeService = /*#__PURE__*/function (_CommonServiceBase) {
  34587. ThemeService_inherits(ThemeService, _CommonServiceBase);
  34588. var _super = ThemeService_createSuper(ThemeService);
  34589. function ThemeService(url, options) {
  34590. var _this;
  34591. ThemeService_classCallCheck(this, ThemeService);
  34592. _this = _super.call(this, url, options);
  34593. if (options) {
  34594. SuperMap.Util.extend(ThemeService_assertThisInitialized(_this), options);
  34595. }
  34596. _this.url = Util.urlPathAppend(_this.url, 'tempLayersSet');
  34597. _this.CLASS_NAME = 'SuperMap.ThemeService';
  34598. return _this;
  34599. }
  34600. /**
  34601. * @override
  34602. */
  34603. ThemeService_createClass(ThemeService, [{
  34604. key: "destroy",
  34605. value: function destroy() {
  34606. ThemeService_get(ThemeService_getPrototypeOf(ThemeService.prototype), "destroy", this).call(this);
  34607. }
  34608. /**
  34609. * @function SuperMap.ThemeService.prototype.processAsync
  34610. * @description 负责将客户端的专题图参数传递到服务端。
  34611. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  34612. */
  34613. }, {
  34614. key: "processAsync",
  34615. value: function processAsync(params) {
  34616. if (!(params instanceof ThemeParameters)) {
  34617. return;
  34618. }
  34619. var me = this,
  34620. jsonParameters = null;
  34621. jsonParameters = me.getJsonParameters(params);
  34622. me.request({
  34623. method: "POST",
  34624. data: jsonParameters,
  34625. scope: me,
  34626. success: me.serviceProcessCompleted,
  34627. failure: me.serviceProcessFailed
  34628. });
  34629. }
  34630. /**
  34631. * @function SuperMap.ThemeService.prototype.getJsonParameters
  34632. * @description 将专题图参数参数转化为 JSON 字符串。
  34633. * @param {SuperMap.ThemeParameters} parameter - 专题图参数类。
  34634. * @returns {Object} 转化后的JSON字符串。
  34635. */
  34636. }, {
  34637. key: "getJsonParameters",
  34638. value: function getJsonParameters(parameter) {
  34639. var jsonParameters = "",
  34640. themeObj = null,
  34641. filters = null,
  34642. orderBys = null,
  34643. fieldValuesDisplayFilter;
  34644. jsonParameters += "[{'type': 'UGC','subLayers': {'layers': [";
  34645. for (var i = 0; i < parameter.themes.length; i++) {
  34646. themeObj = parameter.themes[i];
  34647. var jsonTheme = Util.toJSON(themeObj);
  34648. jsonTheme = jsonTheme.slice(0, -1);
  34649. jsonParameters += "{'theme': " + jsonTheme + "},'type': 'UGC','ugcLayerType': 'THEME',";
  34650. filters = parameter.displayFilters;
  34651. if (filters && filters.length > 0) {
  34652. if (filters.length === 1) {
  34653. jsonParameters += "'displayFilter':\"" + filters[0] + "\",";
  34654. } else {
  34655. jsonParameters += "'displayFilter':\"" + filters[i] + "\",";
  34656. }
  34657. }
  34658. orderBys = parameter.displayOrderBy;
  34659. if (orderBys && orderBys.length > 0) {
  34660. if (orderBys.length === 1) {
  34661. jsonParameters += "'displayOrderBy':'" + orderBys[0] + "',";
  34662. } else {
  34663. jsonParameters += "'displayOrderBy':'" + orderBys[i] + "',";
  34664. }
  34665. }
  34666. fieldValuesDisplayFilter = parameter.fieldValuesDisplayFilter;
  34667. if (fieldValuesDisplayFilter) {
  34668. jsonParameters += "'fieldValuesDisplayFilter':" + Util.toJSON(fieldValuesDisplayFilter) + ",";
  34669. }
  34670. if (parameter.joinItems && parameter.joinItems.length > 0 && parameter.joinItems[i]) {
  34671. jsonParameters += "'joinItems':[" + Util.toJSON(parameter.joinItems[i]) + "],";
  34672. }
  34673. if (parameter.datasetNames && parameter.dataSourceNames) {
  34674. var datasetID = parameter.datasetNames[i] ? i : parameter.datasetNames.length - 1;
  34675. var dataSourceID = parameter.dataSourceNames[i] ? i : parameter.dataSourceNames.length - 1;
  34676. jsonParameters += "'datasetInfo': {'name': '" + parameter.datasetNames[datasetID] + "','dataSourceName': '" + parameter.dataSourceNames[dataSourceID] + "'}},";
  34677. } else {
  34678. jsonParameters += "},";
  34679. }
  34680. } //去除多余的逗号
  34681. if (parameter.themes && parameter.themes.length > 0) {
  34682. jsonParameters = jsonParameters.substring(0, jsonParameters.length - 1);
  34683. }
  34684. jsonParameters += "]},";
  34685. var urlArray = this.url.split("/");
  34686. var jsonMapName = urlArray[urlArray.length - 2];
  34687. jsonParameters += "'name': '" + jsonMapName + "'}]";
  34688. return jsonParameters;
  34689. }
  34690. }]);
  34691. return ThemeService;
  34692. }(CommonServiceBase);
  34693. SuperMap.ThemeService = ThemeService_ThemeService;
  34694. ;// CONCATENATED MODULE: ./src/common/iServer/ThiessenAnalystService.js
  34695. function ThiessenAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThiessenAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { ThiessenAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThiessenAnalystService_typeof(obj); }
  34696. function ThiessenAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34697. 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); } }
  34698. function ThiessenAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThiessenAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThiessenAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  34699. function ThiessenAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThiessenAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThiessenAnalystService_get(target, property, receiver || target); }
  34700. function ThiessenAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThiessenAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  34701. 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 } }); if (superClass) ThiessenAnalystService_setPrototypeOf(subClass, superClass); }
  34702. function ThiessenAnalystService_setPrototypeOf(o, p) { ThiessenAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThiessenAnalystService_setPrototypeOf(o, p); }
  34703. 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); }; }
  34704. function ThiessenAnalystService_possibleConstructorReturn(self, call) { if (call && (ThiessenAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return ThiessenAnalystService_assertThisInitialized(self); }
  34705. function ThiessenAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34706. function ThiessenAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34707. function ThiessenAnalystService_getPrototypeOf(o) { ThiessenAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThiessenAnalystService_getPrototypeOf(o); }
  34708. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34709. * This program are made available under the terms of the Apache License, Version 2.0
  34710. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34711. /**
  34712. * @class SuperMap.ThiessenAnalystService
  34713. * @category iServer SpatialAnalyst ThiessenPolygonAnalyst
  34714. * @classdesc
  34715. * 泰森多边形分析服务类
  34716. * 该类负责将客户设置的泰森多边形分析参数传递给服务端,并接收服务端返回的分析结果数据。
  34717. * 泰森多边形分析结果通过该类支持的事件的监听函数参数获取
  34718. * 泰森多边形分析的参数支持两种,当参数为 {SuperMap.DatasetThiessenAnalystParameters} 类型
  34719. * 时,执行数据集泰森多边形分析,当参数为 {SuperMap.GeometryThiessenAnalystParameters} 类型时,
  34720. * 执行几何对象泰森多边形分析。
  34721. * @param url - {string} 服务的访问地址。
  34722. * 如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  34723. * @param {Object} options - 参数。</br>
  34724. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34725. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34726. * @param {Object} [options.headers] - 请求头。
  34727. * @extends {SuperMap.SpatialAnalystBase}
  34728. * @example 例如:
  34729. * (start code)
  34730. * var myThiessenAnalystService = new SuperMap.ThiessenAnalystService(url, {
  34731. * eventListeners: {
  34732. * "processCompleted": bufferCompleted,
  34733. * "processFailed": bufferFailed
  34734. * }
  34735. * });
  34736. * (end)
  34737. *
  34738. */
  34739. var ThiessenAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34740. ThiessenAnalystService_inherits(ThiessenAnalystService, _SpatialAnalystBase);
  34741. var _super = ThiessenAnalystService_createSuper(ThiessenAnalystService);
  34742. function ThiessenAnalystService(url, options) {
  34743. var _this;
  34744. ThiessenAnalystService_classCallCheck(this, ThiessenAnalystService);
  34745. _this = _super.call(this, url, options);
  34746. /**
  34747. * @member {string} SuperMap.ThiessenAnalystService.prototype.mode
  34748. * @description 缓冲区分析类型
  34749. */
  34750. _this.mode = null;
  34751. if (options) {
  34752. Util.extend(ThiessenAnalystService_assertThisInitialized(_this), options);
  34753. }
  34754. _this.CLASS_NAME = "SuperMap.ThiessenAnalystService";
  34755. return _this;
  34756. }
  34757. /**
  34758. * @override
  34759. */
  34760. ThiessenAnalystService_createClass(ThiessenAnalystService, [{
  34761. key: "destroy",
  34762. value: function destroy() {
  34763. ThiessenAnalystService_get(ThiessenAnalystService_getPrototypeOf(ThiessenAnalystService.prototype), "destroy", this).call(this);
  34764. this.mode = null;
  34765. }
  34766. /**
  34767. * @function SuperMap.ThiessenAnalystService.prototype.processAsync
  34768. * @description 负责将客户端的查询参数传递到服务端。
  34769. * @param {(SuperMap.DatasetThiessenAnalystParameters|GeometryThiessenAnalystParameters)} parameter - 泰森多边形分析参数基类。
  34770. */
  34771. }, {
  34772. key: "processAsync",
  34773. value: function processAsync(parameter) {
  34774. var parameterObject = {};
  34775. var me = this;
  34776. if (parameter instanceof DatasetThiessenAnalystParameters) {
  34777. me.mode = "datasets";
  34778. me.url = Util.urlPathAppend(me.url, 'datasets/' + parameter.dataset + '/thiessenpolygon');
  34779. DatasetThiessenAnalystParameters.toObject(parameter, parameterObject);
  34780. } else if (parameter instanceof GeometryThiessenAnalystParameters) {
  34781. me.mode = "geometry";
  34782. me.url = Util.urlPathAppend(me.url, 'geometry/thiessenpolygon');
  34783. GeometryThiessenAnalystParameters.toObject(parameter, parameterObject);
  34784. }
  34785. var jsonParameters = Util.toJSON(parameterObject);
  34786. me.url = Util.urlAppend(me.url, 'returnContent=true');
  34787. me.request({
  34788. method: "POST",
  34789. data: jsonParameters,
  34790. scope: me,
  34791. success: me.serviceProcessCompleted,
  34792. failure: me.serviceProcessFailed
  34793. });
  34794. }
  34795. }]);
  34796. return ThiessenAnalystService;
  34797. }(SpatialAnalystBase);
  34798. SuperMap.ThiessenAnalystService = ThiessenAnalystService;
  34799. ;// CONCATENATED MODULE: ./src/common/iServer/GeometryBatchAnalystService.js
  34800. function GeometryBatchAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeometryBatchAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { GeometryBatchAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeometryBatchAnalystService_typeof(obj); }
  34801. function GeometryBatchAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34802. 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); } }
  34803. function GeometryBatchAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeometryBatchAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeometryBatchAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  34804. function GeometryBatchAnalystService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GeometryBatchAnalystService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return GeometryBatchAnalystService_get(target, property, receiver || target); }
  34805. function GeometryBatchAnalystService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GeometryBatchAnalystService_getPrototypeOf(object); if (object === null) break; } return object; }
  34806. 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 } }); if (superClass) GeometryBatchAnalystService_setPrototypeOf(subClass, superClass); }
  34807. function GeometryBatchAnalystService_setPrototypeOf(o, p) { GeometryBatchAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeometryBatchAnalystService_setPrototypeOf(o, p); }
  34808. 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); }; }
  34809. function GeometryBatchAnalystService_possibleConstructorReturn(self, call) { if (call && (GeometryBatchAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return GeometryBatchAnalystService_assertThisInitialized(self); }
  34810. function GeometryBatchAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34811. function GeometryBatchAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34812. function GeometryBatchAnalystService_getPrototypeOf(o) { GeometryBatchAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeometryBatchAnalystService_getPrototypeOf(o); }
  34813. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34814. * This program are made available under the terms of the Apache License, Version 2.0
  34815. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34816. /**
  34817. * @class SuperMap.GeometryBatchAnalystService
  34818. * @category iServer SpatialAnalyst BatchAnalyst
  34819. * @classdesc 批量空间分析服务类
  34820. * @description 该类负责将客户设置的叠加分析参数传递给服务端,并接收服务端返回的叠加分析结果数据。
  34821. * 叠加分析结果通过该类支持的事件的监听函数参数获取,参数类型为 {<SuperMap.REST.OverlayAnalystEventArgs>}; 获取的结果数据包括 originResult 、result 两种,
  34822. * 其中,originResult 为服务端返回的用 JSON 对象表示的量算结果数据,result 为服务端返回的量算结果数据。
  34823. * @extends {SuperMap.SpatialAnalystBase}
  34824. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。
  34825. * @param {Object} options - 参数。
  34826. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  34827. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34828. * @param {Object} [options.headers] - 请求头。
  34829. * @example
  34830. * var myOverlayAnalystService = new SuperMap.REST.GeometryBatchAnalystService(url, {
  34831. * eventListeners: {
  34832. * "processCompleted": OverlayCompleted,
  34833. * "processFailed": OverlayFailed
  34834. * }
  34835. * });
  34836. */
  34837. var GeometryBatchAnalystService = /*#__PURE__*/function (_SpatialAnalystBase) {
  34838. GeometryBatchAnalystService_inherits(GeometryBatchAnalystService, _SpatialAnalystBase);
  34839. var _super = GeometryBatchAnalystService_createSuper(GeometryBatchAnalystService);
  34840. function GeometryBatchAnalystService(url, options) {
  34841. var _this;
  34842. GeometryBatchAnalystService_classCallCheck(this, GeometryBatchAnalystService);
  34843. _this = _super.call(this, url, options);
  34844. if (options) {
  34845. Util.extend(GeometryBatchAnalystService_assertThisInitialized(_this), options);
  34846. }
  34847. _this.CLASS_NAME = "SuperMap.GeometryBatchAnalystService";
  34848. return _this;
  34849. }
  34850. /**
  34851. * @function SuperMap.GeometryBatchAnalystService.prototype.processAsync
  34852. * @description 负责将客户端的查询参数传递到服务端。
  34853. * @param {SuperMap.GeometryBatchOverlayAnalystParameters} parameter - 批量几何对象叠加分析参数类
  34854. *
  34855. */
  34856. GeometryBatchAnalystService_createClass(GeometryBatchAnalystService, [{
  34857. key: "processAsync",
  34858. value: function processAsync(parameters) {
  34859. var me = this;
  34860. me.url = Util.urlPathAppend(me.url, 'geometry/batchanalyst');
  34861. me.url = Util.urlAppend(me.url, 'returnContent=true&ignoreAnalystParam=true');
  34862. var parameterObjects = me._processParams(parameters);
  34863. var jsonParameters = Util.toJSON(parameterObjects);
  34864. me.request({
  34865. method: "POST",
  34866. data: jsonParameters,
  34867. scope: me,
  34868. success: me.serviceProcessCompleted,
  34869. failure: me.serviceProcessFailed
  34870. });
  34871. }
  34872. }, {
  34873. key: "_processParams",
  34874. value: function _processParams(parameters) {
  34875. var me = this;
  34876. if (!Util.isArray(parameters)) {
  34877. return;
  34878. }
  34879. var processParams = [];
  34880. parameters.map(function (item) {
  34881. processParams.push(me._toJSON(item));
  34882. return item;
  34883. });
  34884. return processParams;
  34885. }
  34886. }, {
  34887. key: "_toJSON",
  34888. value: function _toJSON(parameter) {
  34889. var tempObj = {};
  34890. if (parameter.analystName === "buffer") {
  34891. tempObj.analystName = "buffer";
  34892. tempObj.param = {}; //几何对象的批量空间分析,
  34893. GeometryBufferAnalystParameters.toObject(parameter.param, tempObj.param);
  34894. } else if (parameter.analystName === "overlay") {
  34895. tempObj.analystName = "overlay";
  34896. tempObj.param = {};
  34897. GeometryOverlayAnalystParameters.toObject(parameter.param, tempObj.param);
  34898. } else if (parameter.analystName === "interpolationDensity") {
  34899. tempObj.analystName = "interpolationDensity";
  34900. tempObj.param = {};
  34901. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  34902. } else if (parameter.analystName === "interpolationidw") {
  34903. tempObj.analystName = "interpolationidw";
  34904. tempObj.param = {};
  34905. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  34906. } else if (parameter.analystName === "interpolationRBF") {
  34907. tempObj.analystName = "interpolationRBF";
  34908. tempObj.param = {};
  34909. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  34910. } else if (parameter.analystName === "interpolationKriging") {
  34911. tempObj.analystName = "interpolationKriging";
  34912. tempObj.param = {};
  34913. InterpolationAnalystParameters.toObject(parameter.param, tempObj.param);
  34914. } else if (parameter.analystName === "thiessenpolygon") {
  34915. tempObj.analystName = "thiessenpolygon";
  34916. tempObj.param = {};
  34917. GeometryThiessenAnalystParameters.toObject(parameter.param, tempObj.param);
  34918. } else {
  34919. //isoline; isoregion; calculatemeasure; routelocator 四种分析不需要再处理参数
  34920. return parameter;
  34921. }
  34922. return tempObj;
  34923. }
  34924. /**
  34925. * @override
  34926. */
  34927. }, {
  34928. key: "destroy",
  34929. value: function destroy() {
  34930. GeometryBatchAnalystService_get(GeometryBatchAnalystService_getPrototypeOf(GeometryBatchAnalystService.prototype), "destroy", this).call(this);
  34931. }
  34932. }]);
  34933. return GeometryBatchAnalystService;
  34934. }(SpatialAnalystBase);
  34935. SuperMap.GeometryBatchAnalystService = GeometryBatchAnalystService;
  34936. ;// CONCATENATED MODULE: ./src/common/iServer/TilesetsService.js
  34937. function TilesetsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TilesetsService_typeof = function _typeof(obj) { return typeof obj; }; } else { TilesetsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TilesetsService_typeof(obj); }
  34938. function TilesetsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  34939. 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); } }
  34940. function TilesetsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TilesetsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TilesetsService_defineProperties(Constructor, staticProps); return Constructor; }
  34941. function TilesetsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TilesetsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TilesetsService_get(target, property, receiver || target); }
  34942. function TilesetsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TilesetsService_getPrototypeOf(object); if (object === null) break; } return object; }
  34943. 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 } }); if (superClass) TilesetsService_setPrototypeOf(subClass, superClass); }
  34944. function TilesetsService_setPrototypeOf(o, p) { TilesetsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TilesetsService_setPrototypeOf(o, p); }
  34945. 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); }; }
  34946. function TilesetsService_possibleConstructorReturn(self, call) { if (call && (TilesetsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TilesetsService_assertThisInitialized(self); }
  34947. function TilesetsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  34948. function TilesetsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  34949. function TilesetsService_getPrototypeOf(o) { TilesetsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TilesetsService_getPrototypeOf(o); }
  34950. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  34951. * This program are made available under the terms of the Apache License, Version 2.0
  34952. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  34953. /**
  34954. * @class SuperMap.TilesetsService
  34955. * @category iServer Map Tilesets
  34956. * @classdesc 切片列表信息查询服务类;即查询切片地图服务的切片列表,返回切片集名称、地图切片元数据信息、切片版本集信息。
  34957. * @extends {SuperMap.CommonServiceBase}
  34958. * @param {string} url - 地图服务地址。URL 应为:
  34959. * http://{服务器地址}:{服务端口号}/iserver/services/{服务名}/rest/maps/map;
  34960. * 例如: "http://localhost:8090/iserver/services/test/rest/maps/tianlocal"。
  34961. * @param {Object} options - 参数。
  34962. * @param {Object} options.eventListeners - 事件监听器对象。有 processCompleted 属性可传入处理完成后的回调函数。processFailed 属性传入处理失败后的回调函数。
  34963. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务器类型,ISERVER|IPORTAL|ONLINE。
  34964. * @param {SuperMap.DataFormat} [options.format=SuperMap.DataFormat.GEOJSON] - 查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式。参数格式为 "ISERVER","GEOJSON"。
  34965. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  34966. * @param {Object} [options.headers] - 请求头。
  34967. */
  34968. var TilesetsService = /*#__PURE__*/function (_CommonServiceBase) {
  34969. TilesetsService_inherits(TilesetsService, _CommonServiceBase);
  34970. var _super = TilesetsService_createSuper(TilesetsService);
  34971. function TilesetsService(url, options) {
  34972. var _this;
  34973. TilesetsService_classCallCheck(this, TilesetsService);
  34974. _this = _super.call(this, url, options);
  34975. _this.CLASS_NAME = "SuperMap.TilesetsService";
  34976. return _this;
  34977. }
  34978. /**
  34979. * @override
  34980. */
  34981. TilesetsService_createClass(TilesetsService, [{
  34982. key: "destroy",
  34983. value: function destroy() {
  34984. TilesetsService_get(TilesetsService_getPrototypeOf(TilesetsService.prototype), "destroy", this).call(this);
  34985. }
  34986. /**
  34987. * @function SuperMap.TilesetsService.prototype.processAsync
  34988. * @description 负责将客户端的查询参数传递到服务端。
  34989. */
  34990. }, {
  34991. key: "processAsync",
  34992. value: function processAsync() {
  34993. if (!this.url) {
  34994. return;
  34995. }
  34996. var me = this;
  34997. me.url = Util.urlPathAppend(me.url, 'tilesets');
  34998. me.request({
  34999. method: "GET",
  35000. scope: me,
  35001. success: me.serviceProcessCompleted,
  35002. failure: me.serviceProcessFailed
  35003. });
  35004. }
  35005. }]);
  35006. return TilesetsService;
  35007. }(CommonServiceBase);
  35008. SuperMap.TilesetsService = TilesetsService;
  35009. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsParameter.js
  35010. function TopologyValidatorJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35011. 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); } }
  35012. function TopologyValidatorJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  35013. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35014. * This program are made available under the terms of the Apache License, Version 2.0
  35015. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35016. /**
  35017. * @class SuperMap.TopologyValidatorJobsParameter
  35018. * @category iServer ProcessingService TopologyValidator
  35019. * @classdesc 拓扑检查分析任务参数类。
  35020. * @param {Object} options - 必填参数。
  35021. * @param {string} options.datasetName - 数据集名。
  35022. * @param {string} options.datasetTopology -检查对象所在的数据集名称。
  35023. * @param {SuperMap.TopologyValidatorRule} [options.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP] - 拓扑检查规则。
  35024. * @param {string} [options.tolerance] - 容限。
  35025. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  35026. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  35027. */
  35028. var TopologyValidatorJobsParameter = /*#__PURE__*/function () {
  35029. function TopologyValidatorJobsParameter(options) {
  35030. TopologyValidatorJobsParameter_classCallCheck(this, TopologyValidatorJobsParameter);
  35031. if (!options) {
  35032. return;
  35033. }
  35034. /**
  35035. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetName
  35036. * @description 数据集名。
  35037. */
  35038. this.datasetName = "";
  35039. /**
  35040. * @member {string} SuperMap.TopologyValidatorJobsParameter.prototype.datasetTopology
  35041. * @description 拓扑检查对象所在的数据集名称。
  35042. */
  35043. this.datasetTopology = "";
  35044. /**
  35045. * @member {string} [SuperMap.TopologyValidatorJobsParameter.prototype.tolerance]
  35046. * @description 容限,指定的拓扑错误检查时使用的容限。
  35047. */
  35048. this.tolerance = "";
  35049. /**
  35050. * @member {SuperMap.TopologyValidatorRule} [SuperMap.TopologyValidatorJobsParameter.prototype.rule=SuperMap.TopologyValidatorRule.REGIONNOOVERLAP]
  35051. * @description 拓扑检查模式。
  35052. */
  35053. this.rule = TopologyValidatorRule.REGIONNOOVERLAP;
  35054. /**
  35055. * @member {SuperMap.OutputSetting} [SuperMap.TopologyValidatorJobsParameter.prototype.output]
  35056. * @description 输出参数设置类。
  35057. */
  35058. this.output = null;
  35059. /**
  35060. * @member {SuperMap.MappingParameters} [SuperMap.TopologyValidatorJobsParameter.prototype.mappingParameters]
  35061. * @description 分析后结果可视化的参数类。
  35062. */
  35063. this.mappingParameters = null;
  35064. Util.extend(this, options);
  35065. this.CLASS_NAME = "SuperMap.TopologyValidatorJobsParameter";
  35066. }
  35067. /**
  35068. * @function SuperMap.TopologyValidatorJobsParameter.prototype.destroy
  35069. * @description 释放资源,将引用资源的属性置空。
  35070. */
  35071. TopologyValidatorJobsParameter_createClass(TopologyValidatorJobsParameter, [{
  35072. key: "destroy",
  35073. value: function destroy() {
  35074. this.datasetName = null;
  35075. this.datasetTopology = null;
  35076. this.tolerance = null;
  35077. this.rule = null;
  35078. if (this.output instanceof OutputSetting) {
  35079. this.output.destroy();
  35080. this.output = null;
  35081. }
  35082. if (this.mappingParameters instanceof MappingParameters) {
  35083. this.mappingParameters.destroy();
  35084. this.mappingParameters = null;
  35085. }
  35086. }
  35087. /**
  35088. * @function SuperMap.TopologyValidatorJobsParameter.toObject
  35089. * @param {Object} TopologyValidatorJobsParameter -拓扑检查分析任务参数。
  35090. * @param {Object} tempObj - 目标对象。
  35091. * @description 生成拓扑检查分析任务对象。
  35092. */
  35093. }], [{
  35094. key: "toObject",
  35095. value: function toObject(TopologyValidatorJobsParameter, tempObj) {
  35096. for (var name in TopologyValidatorJobsParameter) {
  35097. if (name === "datasetName") {
  35098. tempObj['input'] = tempObj['input'] || {};
  35099. tempObj['input'][name] = TopologyValidatorJobsParameter[name];
  35100. continue;
  35101. }
  35102. if (name === "output") {
  35103. tempObj['output'] = tempObj['output'] || {};
  35104. tempObj['output'] = TopologyValidatorJobsParameter[name];
  35105. continue;
  35106. }
  35107. tempObj['analyst'] = tempObj['analyst'] || {};
  35108. tempObj['analyst'][name] = TopologyValidatorJobsParameter[name];
  35109. if (name === 'mappingParameters') {
  35110. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  35111. tempObj['analyst']['mappingParameters'] = TopologyValidatorJobsParameter[name];
  35112. }
  35113. }
  35114. }
  35115. }]);
  35116. return TopologyValidatorJobsParameter;
  35117. }();
  35118. SuperMap.TopologyValidatorJobsParameter = TopologyValidatorJobsParameter;
  35119. ;// CONCATENATED MODULE: ./src/common/iServer/TopologyValidatorJobsService.js
  35120. function TopologyValidatorJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TopologyValidatorJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { TopologyValidatorJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TopologyValidatorJobsService_typeof(obj); }
  35121. function TopologyValidatorJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35122. 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); } }
  35123. function TopologyValidatorJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TopologyValidatorJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TopologyValidatorJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  35124. function TopologyValidatorJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TopologyValidatorJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TopologyValidatorJobsService_get(target, property, receiver || target); }
  35125. function TopologyValidatorJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TopologyValidatorJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  35126. 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 } }); if (superClass) TopologyValidatorJobsService_setPrototypeOf(subClass, superClass); }
  35127. function TopologyValidatorJobsService_setPrototypeOf(o, p) { TopologyValidatorJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TopologyValidatorJobsService_setPrototypeOf(o, p); }
  35128. 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); }; }
  35129. function TopologyValidatorJobsService_possibleConstructorReturn(self, call) { if (call && (TopologyValidatorJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return TopologyValidatorJobsService_assertThisInitialized(self); }
  35130. function TopologyValidatorJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35131. function TopologyValidatorJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35132. function TopologyValidatorJobsService_getPrototypeOf(o) { TopologyValidatorJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TopologyValidatorJobsService_getPrototypeOf(o); }
  35133. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35134. * This program are made available under the terms of the Apache License, Version 2.0
  35135. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35136. /**
  35137. * @class SuperMap.TopologyValidatorJobsService
  35138. * @category iServer ProcessingService TopologyValidator
  35139. * @classdesc 拓扑检查分析服务类
  35140. * @extends {SuperMap.ProcessingServiceBase}
  35141. * @param {string} url - 拓扑检查分析服务地址。
  35142. * @param {Object} options - 参数。
  35143. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35144. * @param {Object} [options.headers] - 请求头。
  35145. */
  35146. var TopologyValidatorJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  35147. TopologyValidatorJobsService_inherits(TopologyValidatorJobsService, _ProcessingServiceBas);
  35148. var _super = TopologyValidatorJobsService_createSuper(TopologyValidatorJobsService);
  35149. function TopologyValidatorJobsService(url, options) {
  35150. var _this;
  35151. TopologyValidatorJobsService_classCallCheck(this, TopologyValidatorJobsService);
  35152. _this = _super.call(this, url, options);
  35153. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/topologyvalidator');
  35154. _this.CLASS_NAME = "SuperMap.TopologyValidatorJobsService";
  35155. return _this;
  35156. }
  35157. /**
  35158. *@override
  35159. */
  35160. TopologyValidatorJobsService_createClass(TopologyValidatorJobsService, [{
  35161. key: "destroy",
  35162. value: function destroy() {
  35163. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "destroy", this).call(this);
  35164. }
  35165. /**
  35166. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJobs
  35167. * @description 获取拓扑检查分析所有任务
  35168. */
  35169. }, {
  35170. key: "getTopologyValidatorJobs",
  35171. value: function getTopologyValidatorJobs() {
  35172. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, this.url);
  35173. }
  35174. /**
  35175. * @function SuperMap.TopologyValidatorJobsService.protitype.getTopologyValidatorJob
  35176. * @description 获取指定id的拓扑检查分析服务
  35177. * @param {string} id - 指定要获取数据的id
  35178. */
  35179. }, {
  35180. key: "getTopologyValidatorJob",
  35181. value: function getTopologyValidatorJob(id) {
  35182. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  35183. }
  35184. /**
  35185. * @function SuperMap.TopologyValidatorJobsService.protitype.addTopologyValidatorJob
  35186. * @description 新建拓扑检查分析服务
  35187. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  35188. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  35189. */
  35190. }, {
  35191. key: "addTopologyValidatorJob",
  35192. value: function addTopologyValidatorJob(params, seconds) {
  35193. TopologyValidatorJobsService_get(TopologyValidatorJobsService_getPrototypeOf(TopologyValidatorJobsService.prototype), "addJob", this).call(this, this.url, params, TopologyValidatorJobsParameter, seconds);
  35194. }
  35195. }]);
  35196. return TopologyValidatorJobsService;
  35197. }(ProcessingServiceBase);
  35198. SuperMap.TopologyValidatorJobsService = TopologyValidatorJobsService;
  35199. ;// CONCATENATED MODULE: ./src/common/iServer/TransferLine.js
  35200. function TransferLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35201. 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); } }
  35202. function TransferLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferLine_defineProperties(Constructor, staticProps); return Constructor; }
  35203. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35204. * This program are made available under the terms of the Apache License, Version 2.0
  35205. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35206. /**
  35207. * @class SuperMap.TransferLine
  35208. * @category iServer TrafficTransferAnalyst TransferPath
  35209. * @classdesc 换乘路线信息类。
  35210. * @param {Object} options - 参数。
  35211. * @param {number} options.lineID - 乘车路线 ID。
  35212. * @param {string} options.lineName - 乘车路线名称。
  35213. * @param {string} options.lineAliasName - 乘车路线别名。
  35214. * @param {number} options.startStopIndex - 上车站点在本公交路线中的索引。
  35215. * @param {string} options.startStopName - 上车站点名称。
  35216. * @param {string} options.startStopAliasName - 上车站点别名。
  35217. * @param {number} options.endStopIndex - 下车站点在本公交路线中的索引。
  35218. * @param {string} options.endStopName - 下车站点名称。
  35219. * @param {string} options.endStopAliasName - 下车站点别名。
  35220. */
  35221. var TransferLine = /*#__PURE__*/function () {
  35222. function TransferLine(options) {
  35223. TransferLine_classCallCheck(this, TransferLine);
  35224. options = options || {};
  35225. /**
  35226. * @member {number} SuperMap.TransferLine.prototype.lineID
  35227. * @description 乘车路线 ID。
  35228. */
  35229. this.lineID = null;
  35230. /**
  35231. * @member {string} SuperMap.TransferLine.prototype.lineName
  35232. * @description 乘车路线名称。
  35233. */
  35234. this.lineName = null;
  35235. /**
  35236. * @member {string} SuperMap.TransferLine.prototype.lineAliasName
  35237. * @description 乘车路线别名。
  35238. */
  35239. this.lineAliasName = null;
  35240. /**
  35241. * @member {number} SuperMap.TransferLine.prototype.startStopIndex
  35242. * @description 上车站点在本公交路线中的索引。
  35243. */
  35244. this.startStopIndex = null;
  35245. /**
  35246. * @member {string} SuperMap.TransferLine.prototype.startStopName
  35247. * @description 上车站点名称。
  35248. */
  35249. this.startStopName = null;
  35250. /**
  35251. * @member {string} SuperMap.TransferLine.prototype.startStopAliasName
  35252. * @description 上车站点别名。
  35253. */
  35254. this.startStopAliasName = null;
  35255. /**
  35256. * @member {number} SuperMap.TransferLine.prototype.endStopIndex
  35257. * @description 下车站点在本公交路线中的索引。
  35258. */
  35259. this.endStopIndex = null;
  35260. /**
  35261. * @member {string} SuperMap.TransferLine.prototype.endStopName
  35262. * @description 下车站点名称。
  35263. */
  35264. this.endStopName = null;
  35265. /**
  35266. * @member {string} SuperMap.TransferLine.prototype.endStopAliasName
  35267. * @description 下车站点别名。
  35268. */
  35269. this.endStopAliasName = null;
  35270. Util.extend(this, options);
  35271. this.CLASS_NAME = "SuperMap.TransferLine";
  35272. }
  35273. /**
  35274. * @function SuperMap.TransferLine.prototype.destroy
  35275. * @description 释放资源,将引用资源的属性置空。
  35276. */
  35277. TransferLine_createClass(TransferLine, [{
  35278. key: "destroy",
  35279. value: function destroy() {
  35280. Util.reset(this);
  35281. }
  35282. /**
  35283. * @function SuperMap.TransferLine.fromJson
  35284. * @description 将返回结果转化为 {@link SuperMap.TransferLine} 对象。
  35285. * @param {Object} jsonObject - 新的返回结果。
  35286. * @returns {SuperMap.TransferLine} 转化后的 {@link SuperMap.TransferLine} 对象。
  35287. */
  35288. }], [{
  35289. key: "fromJson",
  35290. value: function fromJson(jsonObject) {
  35291. if (!jsonObject) {
  35292. return;
  35293. }
  35294. return new TransferLine({
  35295. lineID: jsonObject['lineID'],
  35296. lineName: jsonObject['lineName'],
  35297. lineAliasName: jsonObject['lineAliasName'],
  35298. startStopIndex: jsonObject['startStopIndex'],
  35299. startStopName: jsonObject['startStopName'],
  35300. startStopAliasName: jsonObject['startStopAliasName'],
  35301. endStopIndex: jsonObject['endStopIndex'],
  35302. endStopName: jsonObject['endStopName'],
  35303. endStopAliasName: jsonObject['endStopAliasName']
  35304. });
  35305. }
  35306. }]);
  35307. return TransferLine;
  35308. }();
  35309. SuperMap.TransferLine = TransferLine;
  35310. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathParameters.js
  35311. function TransferPathParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35312. 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); } }
  35313. function TransferPathParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35314. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35315. * This program are made available under the terms of the Apache License, Version 2.0
  35316. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35317. /**
  35318. * @class SuperMap.TransferPathParameters
  35319. * @category iServer TrafficTransferAnalyst TransferPaths
  35320. * @classdesc 交通换乘线路查询参数类。
  35321. * @param {Object} options - 参数。
  35322. * @param {Array.<SuperMap.TransferLine>} options.transferLines - 本换乘分段内可乘车的路线集合。
  35323. * @param {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} options.points - 两种查询方式:按照公交站点的起止 ID 进行查询和按照起止点的坐标进行查询。
  35324. *
  35325. */
  35326. var TransferPathParameters = /*#__PURE__*/function () {
  35327. function TransferPathParameters(options) {
  35328. TransferPathParameters_classCallCheck(this, TransferPathParameters);
  35329. options = options || {};
  35330. /**
  35331. * @member {Array.<SuperMap.TransferLine>} SuperMap.TransferPathParameters.prototype.transferLines
  35332. * @description 本换乘分段内可乘车的路线集合,通过交通换乘方案查询得到。
  35333. */
  35334. this.transferLines = null;
  35335. /**
  35336. * @member {Array.<(string|SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.TransferPathParameters.prototype.points
  35337. * @description 两种查询方式:<br>
  35338. * 1. 按照公交站点的起止ID进行查询,则 points 参数的类型为 int[],形如:[起点ID、终点ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  35339. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  35340. */
  35341. this.points = null;
  35342. Util.extend(this, options);
  35343. this.CLASS_NAME = "SuperMap.TransferPathParameters";
  35344. }
  35345. /**
  35346. * @function SuperMap.TransferPathParameters.prototype.destroy
  35347. * @description 释放资源,将引用资源的属性置空。
  35348. */
  35349. TransferPathParameters_createClass(TransferPathParameters, [{
  35350. key: "destroy",
  35351. value: function destroy() {
  35352. Util.reset(this);
  35353. }
  35354. /**
  35355. * @function SuperMap.TransferPathParameters.toJson
  35356. * @description 将 {@link SuperMap.TransferPathParameters} 对象参数转换为 JSON 字符串。
  35357. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  35358. * @returns {string} 转化后的 JSON 字符串。
  35359. */
  35360. }], [{
  35361. key: "toJson",
  35362. value: function toJson(params) {
  35363. if (params) {
  35364. return Util.toJSON(params);
  35365. }
  35366. }
  35367. }]);
  35368. return TransferPathParameters;
  35369. }();
  35370. SuperMap.TransferPathParameters = TransferPathParameters;
  35371. ;// CONCATENATED MODULE: ./src/common/iServer/TransferPathService.js
  35372. function TransferPathService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TransferPathService_typeof = function _typeof(obj) { return typeof obj; }; } else { TransferPathService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TransferPathService_typeof(obj); }
  35373. function TransferPathService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35374. 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); } }
  35375. function TransferPathService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferPathService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferPathService_defineProperties(Constructor, staticProps); return Constructor; }
  35376. function TransferPathService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TransferPathService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TransferPathService_get(target, property, receiver || target); }
  35377. function TransferPathService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferPathService_getPrototypeOf(object); if (object === null) break; } return object; }
  35378. 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 } }); if (superClass) TransferPathService_setPrototypeOf(subClass, superClass); }
  35379. function TransferPathService_setPrototypeOf(o, p) { TransferPathService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferPathService_setPrototypeOf(o, p); }
  35380. 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); }; }
  35381. function TransferPathService_possibleConstructorReturn(self, call) { if (call && (TransferPathService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferPathService_assertThisInitialized(self); }
  35382. function TransferPathService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35383. function TransferPathService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35384. function TransferPathService_getPrototypeOf(o) { TransferPathService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferPathService_getPrototypeOf(o); }
  35385. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35386. * This program are made available under the terms of the Apache License, Version 2.0
  35387. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35388. /**
  35389. * @class SuperMap.TransferPathService
  35390. * @category iServer TrafficTransferAnalyst TransferPath
  35391. * @classdesc 交通换乘线路查询服务类,根据交通换乘分析结果(TransferSolutionResult),获取某一条乘车路线的详细信息。
  35392. * 返回结果通过该类支持的事件的监听函数参数获取
  35393. * @extends {SuperMap.CommonServiceBase}
  35394. * @example 例如:
  35395. * var myService = new SuperMap.TransferPathService(url, {eventListeners: {
  35396. * "processCompleted": TrafficTransferCompleted,
  35397. * "processFailed": TrafficTransferError
  35398. * }
  35399. * };
  35400. * @param {string} url - 与客户端交互的交通换乘线路查询服务地址。
  35401. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  35402. * @param {Object} options - 参数。</br>
  35403. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35404. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35405. * @param {Object} [options.headers] - 请求头。
  35406. */
  35407. var TransferPathService = /*#__PURE__*/function (_CommonServiceBase) {
  35408. TransferPathService_inherits(TransferPathService, _CommonServiceBase);
  35409. var _super = TransferPathService_createSuper(TransferPathService);
  35410. function TransferPathService(url, options) {
  35411. var _this;
  35412. TransferPathService_classCallCheck(this, TransferPathService);
  35413. _this = _super.call(this, url, options);
  35414. _this.CLASS_NAME = "SuperMap.TransferPathService";
  35415. return _this;
  35416. }
  35417. /**
  35418. * @override
  35419. */
  35420. TransferPathService_createClass(TransferPathService, [{
  35421. key: "destroy",
  35422. value: function destroy() {
  35423. TransferPathService_get(TransferPathService_getPrototypeOf(TransferPathService.prototype), "destroy", this).call(this);
  35424. }
  35425. /**
  35426. * @function SuperMap.TransferPathService.prototype.processAsync
  35427. * @description 负责将客户端的更新参数传递到服务端。
  35428. * @param {SuperMap.TransferPathParameters} params - 交通换乘参数。
  35429. */
  35430. }, {
  35431. key: "processAsync",
  35432. value: function processAsync(params) {
  35433. if (!(params instanceof TransferPathParameters)) {
  35434. return;
  35435. }
  35436. var me = this,
  35437. method = "GET",
  35438. jsonParameters;
  35439. me.url = Util.urlPathAppend(me.url, 'path');
  35440. jsonParameters = {
  35441. points: Util.toJSON(params.points),
  35442. transferLines: Util.toJSON(params['transferLines'])
  35443. };
  35444. me.request({
  35445. method: method,
  35446. params: jsonParameters,
  35447. scope: me,
  35448. success: me.serviceProcessCompleted,
  35449. failure: me.serviceProcessFailed
  35450. });
  35451. }
  35452. }]);
  35453. return TransferPathService;
  35454. }(CommonServiceBase);
  35455. SuperMap.TransferPathService = TransferPathService;
  35456. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionParameters.js
  35457. function TransferSolutionParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35458. 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); } }
  35459. function TransferSolutionParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35460. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35461. * This program are made available under the terms of the Apache License, Version 2.0
  35462. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35463. /**
  35464. * @class SuperMap.TransferSolutionParameters
  35465. * @category iServer TrafficTransferAnalyst TransferSolutions
  35466. * @classdesc 交通换乘方案查询参数类。
  35467. * @param {Object} options - 参数。
  35468. * @param {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|number)>} options.points - 两种查询方式:按照公交站点的起止ID进行查询和按照起止点的坐标进行查询。
  35469. * @param {number} [options.solutionCount=6] - 乘车方案的数量。
  35470. * @param {SuperMap.TransferTactic} [options.transferTactic=SuperMap.TransferTactic.LESS_TIME] - 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  35471. * @param {SuperMap.TransferPreference} [options.transferPreference=SuperMap.TransferPreference.NONE] - 乘车偏好枚举。
  35472. * @param {number} [options.walkingRatio=10] - 步行与公交的消耗权重比。
  35473. * @param {Array.<number>} [options.evadeLines] - 避让路线的 ID。
  35474. * @param {Array.<number>} [options.evadeStops] - 避让站点的 ID。
  35475. * @param {Array.<number>} [options.priorLines] - 优先路线的 ID。
  35476. * @param {Array.<number>} [options.priorStops] - 优先站点的 ID。
  35477. * @param {string} [options.travelTime] - 出行的时间。
  35478. */
  35479. var TransferSolutionParameters = /*#__PURE__*/function () {
  35480. function TransferSolutionParameters(options) {
  35481. TransferSolutionParameters_classCallCheck(this, TransferSolutionParameters);
  35482. options = options || {};
  35483. /**
  35484. * @member {number} [SuperMap.TransferSolutionParameters.prototype.solutionCount=6]
  35485. * @description 乘车方案的数量。
  35486. */
  35487. this.solutionCount = 6;
  35488. /**
  35489. * @member {SuperMap.TransferPreference} [SuperMap.TransferSolutionParameters.prototype.transferPreference=SuperMap.TransferPreference.NONE]
  35490. * @description 乘车偏好枚举。
  35491. */
  35492. this.transferPreference = TransferPreference.NONE;
  35493. /**
  35494. * @member {SuperMap.TransferTactic} [SuperMap.TransferSolutionParameters.prototype.transferTactic=TransferTactic|SuperMap.TransferTactic.LESS_TIME]
  35495. * @description 交通换乘策略类型,包括时间最短、距离最短、最少换乘、最少步行四种选择。
  35496. */
  35497. this.transferTactic = TransferTactic.LESS_TIME;
  35498. /**
  35499. * @member {number} [SuperMap.TransferSolutionParameters.prototype.walkingRatio=10]
  35500. * @description 步行与公交的消耗权重比。此值越大,则步行因素对于方案选择的影响越大。例如:</br>
  35501. * 例如现在有两种换乘方案(在仅考虑消耗因素的情况下):</br>
  35502. * 方案1:坐车 10 公里,走路 1 公里;</br>
  35503. * 方案2:坐车 15 公里,走路 0.5 公里;</br>
  35504. * 1. 假设权重比为 15:</br>
  35505. * •方案 1 的总消耗为:10 + 1*15 = 25</br>
  35506. * •方案 2 的总消耗为:15 + 0.5*15 = 22.5</br>
  35507. * 此时方案 2 消耗更低。</br>
  35508. * 2. 假设权重比为2:</br>
  35509. * •方案 1 的总消耗为:10+1*2 = 12</br>
  35510. * •方案 2 的总消耗为:15+0.5*2 = 17</br>
  35511. * 此时方案 1 消耗更低。</br>
  35512. */
  35513. this.walkingRatio = null;
  35514. /**
  35515. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|string)>} SuperMap.TransferSolutionParameters.prototype.points
  35516. * @description 两种查询方式:</br>
  35517. * 1. 按照公交站点的起止 ID 进行查询,则 points 参数的类型为 int[],形如:[起点 ID、终点 ID],公交站点的 ID 对应服务提供者配置中的站点 ID 字段;
  35518. * 2. 按照起止点的坐标进行查询,则 points 参数的类型为 Point2D[],形如:[{"x":44,"y":39},{"x":45,"y":40}]。
  35519. */
  35520. this.points = false;
  35521. /**
  35522. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeLinesnull]
  35523. * @description 避让路线 ID。
  35524. * */
  35525. this.evadeLines = null;
  35526. /**
  35527. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.evadeStops=TransferLine]
  35528. * @description 避让站点 ID。
  35529. * */
  35530. this.evadeStops = null;
  35531. /**
  35532. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorLines]
  35533. * @description 优先路线 ID。
  35534. * */
  35535. this.priorLines = null;
  35536. /**
  35537. * @member {Array.<number>} [SuperMap.TransferSolutionParameters.prototype.priorStops]
  35538. * @description 优先站点 ID。
  35539. * */
  35540. this.priorStops = null;
  35541. /**
  35542. * @member {string} SuperMap.TransferSolutionParameters.prototype.travelTime
  35543. * @description 出行的时间; 格式是:"小时:分钟",如:"08:30"。如果设置了该参数,在分析时,则会考虑线路的首末班车时间的限制,即在返回的结果中会提示公交的首末班发车时间。
  35544. */
  35545. this.travelTime = null;
  35546. Util.extend(this, options);
  35547. this.CLASS_NAME = "SuperMap.TransferSolutionParameters";
  35548. }
  35549. /**
  35550. * @function SuperMap.TransferSolutionParameters.prototype.destroy
  35551. * @description 释放资源,将引用资源的属性置空。
  35552. */
  35553. TransferSolutionParameters_createClass(TransferSolutionParameters, [{
  35554. key: "destroy",
  35555. value: function destroy() {
  35556. Util.reset(this);
  35557. }
  35558. /**
  35559. * @function SuperMap.TransferSolutionParameters.toJsonParameters
  35560. * @description 将 {@link SuperMap.TransferSolutionParameters} 对象参数转换为 JSON 字符串。
  35561. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  35562. * @returns {string} 转化后的 JSON 字符串。
  35563. */
  35564. }], [{
  35565. key: "toJson",
  35566. value: function toJson(params) {
  35567. if (params) {
  35568. return Util.toJSON(params);
  35569. }
  35570. }
  35571. }]);
  35572. return TransferSolutionParameters;
  35573. }();
  35574. SuperMap.TransferSolutionParameters = TransferSolutionParameters;
  35575. ;// CONCATENATED MODULE: ./src/common/iServer/TransferSolutionService.js
  35576. function TransferSolutionService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TransferSolutionService_typeof = function _typeof(obj) { return typeof obj; }; } else { TransferSolutionService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TransferSolutionService_typeof(obj); }
  35577. function TransferSolutionService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35578. 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); } }
  35579. function TransferSolutionService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TransferSolutionService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TransferSolutionService_defineProperties(Constructor, staticProps); return Constructor; }
  35580. function TransferSolutionService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { TransferSolutionService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return TransferSolutionService_get(target, property, receiver || target); }
  35581. function TransferSolutionService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = TransferSolutionService_getPrototypeOf(object); if (object === null) break; } return object; }
  35582. 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 } }); if (superClass) TransferSolutionService_setPrototypeOf(subClass, superClass); }
  35583. function TransferSolutionService_setPrototypeOf(o, p) { TransferSolutionService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TransferSolutionService_setPrototypeOf(o, p); }
  35584. 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); }; }
  35585. function TransferSolutionService_possibleConstructorReturn(self, call) { if (call && (TransferSolutionService_typeof(call) === "object" || typeof call === "function")) { return call; } return TransferSolutionService_assertThisInitialized(self); }
  35586. function TransferSolutionService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35587. function TransferSolutionService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35588. function TransferSolutionService_getPrototypeOf(o) { TransferSolutionService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TransferSolutionService_getPrototypeOf(o); }
  35589. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35590. * This program are made available under the terms of the Apache License, Version 2.0
  35591. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35592. /**
  35593. * @class SuperMap.TransferSolutionService
  35594. * @category iServer TrafficTransferAnalyst TransferSolutions
  35595. * @classdesc 交通换乘方案查询服务类。
  35596. * 返回结果通过该类支持的事件的监听函数参数获取。
  35597. * @param {string} url - 与客户端交互的交通换乘方案查询服务地址。
  35598. * 例如:</br>"http://localhost:8090/iserver/services/traffictransferanalyst-sample/restjsr/traffictransferanalyst/Traffic-Changchun"。
  35599. * @param {Object} options - 参数。</br>
  35600. * @param {Object} options.eventListeners - 需要被注册的监听器对象。</br>
  35601. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35602. * @param {Object} [options.headers] - 请求头。
  35603. * @extends {SuperMap.CommonServiceBase}
  35604. * @example 例如:
  35605. * (start code)
  35606. * var myService = new SuperMap.TransferSolutionService(url, {eventListeners: {
  35607. * "processCompleted": trafficTransferCompleted,
  35608. * "processFailed": trafficTransferError
  35609. * }
  35610. * };
  35611. * (end)
  35612. *
  35613. */
  35614. var TransferSolutionService = /*#__PURE__*/function (_CommonServiceBase) {
  35615. TransferSolutionService_inherits(TransferSolutionService, _CommonServiceBase);
  35616. var _super = TransferSolutionService_createSuper(TransferSolutionService);
  35617. function TransferSolutionService(url, options) {
  35618. var _this;
  35619. TransferSolutionService_classCallCheck(this, TransferSolutionService);
  35620. _this = _super.call(this, url, options);
  35621. _this.CLASS_NAME = "SuperMap.TransferSolutionService";
  35622. return _this;
  35623. }
  35624. /**
  35625. * @override
  35626. */
  35627. TransferSolutionService_createClass(TransferSolutionService, [{
  35628. key: "destroy",
  35629. value: function destroy() {
  35630. TransferSolutionService_get(TransferSolutionService_getPrototypeOf(TransferSolutionService.prototype), "destroy", this).call(this);
  35631. }
  35632. /**
  35633. * @function SuperMap.TransferSolutionService.prototype.processAsync
  35634. * @description 负责将客户端的更新参数传递到服务端。
  35635. * @param {SuperMap.TransferSolutionParameters} params - 交通换乘参数。
  35636. */
  35637. }, {
  35638. key: "processAsync",
  35639. value: function processAsync(params) {
  35640. if (!(params instanceof TransferSolutionParameters)) {
  35641. return;
  35642. }
  35643. var me = this,
  35644. method = "GET",
  35645. jsonParameters;
  35646. me.url = Util.urlPathAppend(me.url, 'solutions');
  35647. jsonParameters = {
  35648. points: Util.toJSON(params.points),
  35649. walkingRatio: params['walkingRatio'],
  35650. transferTactic: params['transferTactic'],
  35651. solutionCount: params['solutionCount'],
  35652. transferPreference: params["transferPreference"]
  35653. };
  35654. if (params.evadeLines) {
  35655. jsonParameters["evadeLines"] = Util.toJSON(params.evadeLines);
  35656. }
  35657. if (params.evadeStops) {
  35658. jsonParameters["evadeStops"] = Util.toJSON(params.evadeStops);
  35659. }
  35660. if (params.priorLines) {
  35661. jsonParameters["priorLines"] = Util.toJSON(params.priorLines);
  35662. }
  35663. if (params.priorStops) {
  35664. jsonParameters["priorStops"] = Util.toJSON(params.priorStops);
  35665. }
  35666. if (params.travelTime) {
  35667. jsonParameters["travelTime"] = params.travelTime;
  35668. }
  35669. me.request({
  35670. method: method,
  35671. params: jsonParameters,
  35672. scope: me,
  35673. success: me.serviceProcessCompleted,
  35674. failure: me.serviceProcessFailed
  35675. });
  35676. }
  35677. }]);
  35678. return TransferSolutionService;
  35679. }(CommonServiceBase);
  35680. SuperMap.TransferSolutionService = TransferSolutionService;
  35681. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightParameters.js
  35682. function UpdateEdgeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35683. 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); } }
  35684. function UpdateEdgeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35685. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35686. * This program are made available under the terms of the Apache License, Version 2.0
  35687. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35688. /**
  35689. * @class SuperMap.UpdateEdgeWeightParameters
  35690. * @category iServer NetworkAnalyst EdgeWeight
  35691. * @classdesc 边的耗费权重更新服务参数类。
  35692. * @param {Object} options - 参数。
  35693. * @param {string} options.edgeId - 所在边的 ID。
  35694. * @param {string} options.fromNodeId - 起始转向点的 ID。
  35695. * @param {string} options.toNodeId - 终止转向点的 ID。
  35696. * @param {string} options.weightField - 边的耗费字段。
  35697. * @param {string} options.edgeWeight - 耗费权重。
  35698. */
  35699. var UpdateEdgeWeightParameters = /*#__PURE__*/function () {
  35700. function UpdateEdgeWeightParameters(options) {
  35701. UpdateEdgeWeightParameters_classCallCheck(this, UpdateEdgeWeightParameters);
  35702. if (!options) {
  35703. return;
  35704. }
  35705. /**
  35706. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeId
  35707. * @description 所在边的 ID。
  35708. */
  35709. this.edgeId = "";
  35710. /**
  35711. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.fromNodeId
  35712. * @description 起始转向点的 ID。
  35713. */
  35714. this.fromNodeId = "";
  35715. /**
  35716. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.toNodeId
  35717. * @description 终止转向点的 ID。
  35718. */
  35719. this.toNodeId = "";
  35720. /**
  35721. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.weightField
  35722. * @description 边的耗费字段。
  35723. */
  35724. this.weightField = "";
  35725. /**
  35726. * @member {string} SuperMap.UpdateEdgeWeightParameters.prototype.edgeWeight
  35727. * @description 耗费权重。
  35728. */
  35729. this.edgeWeight = "";
  35730. Util.extend(this, options);
  35731. this.CLASS_NAME = "SuperMap.UpdateEdgeWeightParameters";
  35732. }
  35733. /**
  35734. * @function SuperMap.UpdateEdgeWeightParameters.prototype.destroy
  35735. * @description 释放资源,将引用资源的属性置空。
  35736. */
  35737. UpdateEdgeWeightParameters_createClass(UpdateEdgeWeightParameters, [{
  35738. key: "destroy",
  35739. value: function destroy() {
  35740. this.edgeId = null;
  35741. this.fromNodeId = null;
  35742. this.toNodeId = null;
  35743. this.weightField = null;
  35744. this.edgeWeight = null;
  35745. }
  35746. }]);
  35747. return UpdateEdgeWeightParameters;
  35748. }();
  35749. SuperMap.UpdateEdgeWeightParameters = UpdateEdgeWeightParameters;
  35750. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateEdgeWeightService.js
  35751. function UpdateEdgeWeightService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UpdateEdgeWeightService_typeof = function _typeof(obj) { return typeof obj; }; } else { UpdateEdgeWeightService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UpdateEdgeWeightService_typeof(obj); }
  35752. function UpdateEdgeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35753. 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); } }
  35754. function UpdateEdgeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateEdgeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateEdgeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  35755. function UpdateEdgeWeightService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateEdgeWeightService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return UpdateEdgeWeightService_get(target, property, receiver || target); }
  35756. function UpdateEdgeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateEdgeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  35757. 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 } }); if (superClass) UpdateEdgeWeightService_setPrototypeOf(subClass, superClass); }
  35758. function UpdateEdgeWeightService_setPrototypeOf(o, p) { UpdateEdgeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateEdgeWeightService_setPrototypeOf(o, p); }
  35759. 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); }; }
  35760. function UpdateEdgeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateEdgeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateEdgeWeightService_assertThisInitialized(self); }
  35761. function UpdateEdgeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35762. function UpdateEdgeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35763. function UpdateEdgeWeightService_getPrototypeOf(o) { UpdateEdgeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateEdgeWeightService_getPrototypeOf(o); }
  35764. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35765. * This program are made available under the terms of the Apache License, Version 2.0
  35766. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35767. /**
  35768. * @class SuperMap.UpdateEdgeWeightService
  35769. * @category iServer NetworkAnalyst EdgeWeight
  35770. * @classdesc 更新边的边的耗费权重服务
  35771. * @extends {SuperMap.NetworkAnalystServiceBase}
  35772. * @example
  35773. *(start code)
  35774. * var updateEdgeWeightService = new SuperMap.UpdateEdgeWeightService(url, {
  35775. * eventListeners: {
  35776. * "processCompleted": UpdateEdgeWeightCompleted, //参数为SuperMap.UpdateEdgeWeightEventArgs
  35777. * "processFailed": UpdateEdgeWeightError //参数为SuperMap.ServiceFailedEventArgs
  35778. * }
  35779. * });
  35780. * (end)
  35781. * @param {string} url - 服务的访问地址。如:http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  35782. * @param {Object} options - 参数。
  35783. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35784. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35785. * @param {Object} [options.headers] - 请求头。
  35786. */
  35787. var UpdateEdgeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  35788. UpdateEdgeWeightService_inherits(UpdateEdgeWeightService, _NetworkAnalystServic);
  35789. var _super = UpdateEdgeWeightService_createSuper(UpdateEdgeWeightService);
  35790. function UpdateEdgeWeightService(url, options) {
  35791. var _this;
  35792. UpdateEdgeWeightService_classCallCheck(this, UpdateEdgeWeightService);
  35793. _this = _super.call(this, url, options);
  35794. _this.CLASS_NAME = "SuperMap.UpdateEdgeWeightService";
  35795. return _this;
  35796. }
  35797. /**
  35798. * @override
  35799. */
  35800. UpdateEdgeWeightService_createClass(UpdateEdgeWeightService, [{
  35801. key: "destroy",
  35802. value: function destroy() {
  35803. UpdateEdgeWeightService_get(UpdateEdgeWeightService_getPrototypeOf(UpdateEdgeWeightService.prototype), "destroy", this).call(this);
  35804. }
  35805. /**
  35806. * @function SuperMap.UpdateEdgeWeightService.prototype.processAsync
  35807. * @description 开始异步执行边的边的耗费权重的更新
  35808. * @param {SuperMap.UpdateEdgeWeightParameters} params - 边的耗费权重更新服务参数类
  35809. * @example
  35810. * (code)
  35811. * var updateEdgeWeightParam=new SuperMapUpdateEdgeWeightParameters({
  35812. * edgeId:"20",
  35813. * fromNodeId:"26",
  35814. * toNodeId:"109",
  35815. * weightField:"time",
  35816. * edgeWeight:"25"
  35817. * });
  35818. * updateEdgeWeightService.processAsync(updateEdgeWeightParam);
  35819. * (end)
  35820. */
  35821. }, {
  35822. key: "processAsync",
  35823. value: function processAsync(params) {
  35824. if (!(params instanceof UpdateEdgeWeightParameters)) {
  35825. return;
  35826. }
  35827. var me = this;
  35828. var paramStr = me.parse(params);
  35829. me.url = Util.urlPathAppend(me.url, paramStr);
  35830. var data = params.edgeWeight ? params.edgeWeight : null;
  35831. me.request({
  35832. method: "PUT",
  35833. scope: me,
  35834. data: data,
  35835. success: me.serviceProcessCompleted,
  35836. failure: me.serviceProcessFailed
  35837. });
  35838. }
  35839. /**
  35840. * @function SuperMap.UpdateEdgeWeightService.prototype.parse
  35841. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  35842. */
  35843. }, {
  35844. key: "parse",
  35845. value: function parse(params) {
  35846. if (!params) {
  35847. return;
  35848. }
  35849. var paramStr = "";
  35850. for (var attr in params) {
  35851. if (params[attr] === "" || params[attr] === "edgeWeight") {
  35852. continue;
  35853. }
  35854. switch (attr) {
  35855. case "edgeId":
  35856. paramStr += "/edgeweight/" + params[attr];
  35857. break;
  35858. case "fromNodeId":
  35859. paramStr += "/fromnode/" + params[attr];
  35860. break;
  35861. case "toNodeId":
  35862. paramStr += "/tonode/" + params[attr];
  35863. break;
  35864. case "weightField":
  35865. paramStr += "/weightfield/" + params[attr];
  35866. break;
  35867. default:
  35868. break;
  35869. }
  35870. }
  35871. return paramStr;
  35872. }
  35873. }]);
  35874. return UpdateEdgeWeightService;
  35875. }(NetworkAnalystServiceBase);
  35876. SuperMap.UpdateEdgeWeightService = UpdateEdgeWeightService;
  35877. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightParameters.js
  35878. function UpdateTurnNodeWeightParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35879. 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); } }
  35880. function UpdateTurnNodeWeightParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightParameters_defineProperties(Constructor, staticProps); return Constructor; }
  35881. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35882. * This program are made available under the terms of the Apache License, Version 2.0
  35883. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35884. /**
  35885. * @class SuperMap.UpdateTurnNodeWeightParameters
  35886. * @category iServer NetworkAnalyst TurnNodeWeight
  35887. * @classdesc 转向耗费权重更新服务参数类。
  35888. * @param {Object} options - 参数。
  35889. * @param {string} options.nodeId - 转向结点的 ID。
  35890. * @param {string} options.fromEdgeId - 起始边的 ID。
  35891. * @param {string} options.toEdgeId - 终止边的 ID。
  35892. * @param {string} options.weightField - 转向结点的耗费字段。
  35893. * @param {string} options.turnNodeWeight - 耗费权重。
  35894. */
  35895. var UpdateTurnNodeWeightParameters = /*#__PURE__*/function () {
  35896. function UpdateTurnNodeWeightParameters(options) {
  35897. UpdateTurnNodeWeightParameters_classCallCheck(this, UpdateTurnNodeWeightParameters);
  35898. if (!options) {
  35899. return;
  35900. }
  35901. /**
  35902. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.nodeId
  35903. * @description 转向结点的 ID。
  35904. */
  35905. this.nodeId = "";
  35906. /**
  35907. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.fromEdgeId
  35908. * @description 起始边的 ID。
  35909. */
  35910. this.fromEdgeId = "";
  35911. /**
  35912. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.toEdgeId
  35913. * @description 终止边的 ID。
  35914. */
  35915. this.toEdgeId = "";
  35916. /**
  35917. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.weightField
  35918. * @description 转向结点的耗费字段。
  35919. */
  35920. this.weightField = "";
  35921. /**
  35922. * @member {string} SuperMap.UpdateTurnNodeWeightParameters.prototype.turnNodeWeight
  35923. * @description 耗费权重。
  35924. */
  35925. this.turnNodeWeight = "";
  35926. Util.extend(this, options);
  35927. this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightParameters";
  35928. }
  35929. /**
  35930. * @function SuperMap.UpdateTurnNodeWeightParameters.prototype.destroy
  35931. * @description 释放资源,将引用资源的属性置空。
  35932. */
  35933. UpdateTurnNodeWeightParameters_createClass(UpdateTurnNodeWeightParameters, [{
  35934. key: "destroy",
  35935. value: function destroy() {
  35936. this.nodeId = null;
  35937. this.fromEdgeId = null;
  35938. this.toEdgeId = null;
  35939. this.weightField = null;
  35940. this.turnNodeWeight = null;
  35941. }
  35942. }]);
  35943. return UpdateTurnNodeWeightParameters;
  35944. }();
  35945. SuperMap.UpdateTurnNodeWeightParameters = UpdateTurnNodeWeightParameters;
  35946. ;// CONCATENATED MODULE: ./src/common/iServer/UpdateTurnNodeWeightService.js
  35947. function UpdateTurnNodeWeightService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UpdateTurnNodeWeightService_typeof = function _typeof(obj) { return typeof obj; }; } else { UpdateTurnNodeWeightService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UpdateTurnNodeWeightService_typeof(obj); }
  35948. function UpdateTurnNodeWeightService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  35949. 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); } }
  35950. function UpdateTurnNodeWeightService_createClass(Constructor, protoProps, staticProps) { if (protoProps) UpdateTurnNodeWeightService_defineProperties(Constructor.prototype, protoProps); if (staticProps) UpdateTurnNodeWeightService_defineProperties(Constructor, staticProps); return Constructor; }
  35951. function UpdateTurnNodeWeightService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { UpdateTurnNodeWeightService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return UpdateTurnNodeWeightService_get(target, property, receiver || target); }
  35952. function UpdateTurnNodeWeightService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = UpdateTurnNodeWeightService_getPrototypeOf(object); if (object === null) break; } return object; }
  35953. 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 } }); if (superClass) UpdateTurnNodeWeightService_setPrototypeOf(subClass, superClass); }
  35954. function UpdateTurnNodeWeightService_setPrototypeOf(o, p) { UpdateTurnNodeWeightService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UpdateTurnNodeWeightService_setPrototypeOf(o, p); }
  35955. 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); }; }
  35956. function UpdateTurnNodeWeightService_possibleConstructorReturn(self, call) { if (call && (UpdateTurnNodeWeightService_typeof(call) === "object" || typeof call === "function")) { return call; } return UpdateTurnNodeWeightService_assertThisInitialized(self); }
  35957. function UpdateTurnNodeWeightService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  35958. function UpdateTurnNodeWeightService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  35959. function UpdateTurnNodeWeightService_getPrototypeOf(o) { UpdateTurnNodeWeightService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UpdateTurnNodeWeightService_getPrototypeOf(o); }
  35960. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  35961. * This program are made available under the terms of the Apache License, Version 2.0
  35962. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  35963. /**
  35964. * @class SuperMap.UpdateTurnNodeWeightService
  35965. * @category iServer NetworkAnalyst TurnNodeWeight
  35966. * @classdesc 转向耗费权重更新服务类
  35967. * @extends {SuperMap.NetworkAnalystServiceBase}
  35968. * @example
  35969. * var UpdateTurnNodeWeightService = new SuperMap.UpdateTurnNodeWeightService(url, {
  35970. * eventListeners: {
  35971. * "processCompleted": UpdateTurnNodeWeightCompleted, //参数为SuperMap.UpdateTurnNodeWeightEventArgs
  35972. * "processFailed": UpdateTurnNodeWeightError //参数为SuperMap.ServiceFailedEventArgs
  35973. * }
  35974. * });
  35975. * @param {string} url - 服务的访问地址。如:
  35976. * http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun 。
  35977. * @param {Object} options - 参数。
  35978. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  35979. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  35980. * @param {Object} [options.headers] - 请求头。
  35981. */
  35982. var UpdateTurnNodeWeightService = /*#__PURE__*/function (_NetworkAnalystServic) {
  35983. UpdateTurnNodeWeightService_inherits(UpdateTurnNodeWeightService, _NetworkAnalystServic);
  35984. var _super = UpdateTurnNodeWeightService_createSuper(UpdateTurnNodeWeightService);
  35985. function UpdateTurnNodeWeightService(url, options) {
  35986. var _this;
  35987. UpdateTurnNodeWeightService_classCallCheck(this, UpdateTurnNodeWeightService);
  35988. _this = _super.call(this, url, options);
  35989. _this.CLASS_NAME = "SuperMap.UpdateTurnNodeWeightService";
  35990. return _this;
  35991. }
  35992. /**
  35993. * @override
  35994. */
  35995. UpdateTurnNodeWeightService_createClass(UpdateTurnNodeWeightService, [{
  35996. key: "destroy",
  35997. value: function destroy() {
  35998. UpdateTurnNodeWeightService_get(UpdateTurnNodeWeightService_getPrototypeOf(UpdateTurnNodeWeightService.prototype), "destroy", this).call(this);
  35999. }
  36000. /**
  36001. * @function SuperMap.UpdateTurnNodeWeightService.prototype.processAsync
  36002. * @description 开始异步执行转向耗费权重的更新
  36003. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类
  36004. * @example
  36005. * (code)
  36006. * var updateTurnNodeWeightParam=new SuperMap.UpdateTurnNodeWeightParameters({
  36007. * nodeId:"106",
  36008. * fromEdgeId:"6508",
  36009. * toEdgeId:"6504",
  36010. * weightField:"TurnCost",
  36011. * turnNodeWeight:"50"
  36012. * });
  36013. * updateTurnNodeWeightService.processAsync(updateTurnNodeWeightParam);
  36014. * (end)
  36015. **/
  36016. }, {
  36017. key: "processAsync",
  36018. value: function processAsync(params) {
  36019. if (!(params instanceof UpdateTurnNodeWeightParameters)) {
  36020. return;
  36021. }
  36022. var me = this;
  36023. var paramStr = me.parse(params);
  36024. me.url = Util.urlPathAppend(me.url, paramStr);
  36025. var data = params.turnNodeWeight ? params.turnNodeWeight : null;
  36026. me.request({
  36027. method: "PUT",
  36028. scope: me,
  36029. data: data,
  36030. success: me.serviceProcessCompleted,
  36031. failure: me.serviceProcessFailed
  36032. });
  36033. }
  36034. /**
  36035. * @function SuperMap.UpdateTurnNodeWeightService.prototype.parse
  36036. * @description 将更新服务参数解析为用‘/’做分隔的字符串
  36037. */
  36038. }, {
  36039. key: "parse",
  36040. value: function parse(params) {
  36041. if (!params) {
  36042. return;
  36043. }
  36044. var paramStr = "";
  36045. for (var attr in params) {
  36046. if (params[attr] === "" || params[attr] === "turnNodeWeight") {
  36047. continue;
  36048. }
  36049. switch (attr) {
  36050. case "nodeId":
  36051. paramStr += "/turnnodeweight/" + params[attr];
  36052. break;
  36053. case "fromEdgeId":
  36054. paramStr += "/fromedge/" + params[attr];
  36055. break;
  36056. case "toEdgeId":
  36057. paramStr += "/toedge/" + params[attr];
  36058. break;
  36059. case "weightField":
  36060. paramStr += "/weightfield/" + params[attr];
  36061. break;
  36062. default:
  36063. break;
  36064. }
  36065. }
  36066. return paramStr;
  36067. }
  36068. }]);
  36069. return UpdateTurnNodeWeightService;
  36070. }(NetworkAnalystServiceBase);
  36071. SuperMap.UpdateTurnNodeWeightService = UpdateTurnNodeWeightService;
  36072. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsParameter.js
  36073. function VectorClipJobsParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36074. 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); } }
  36075. function VectorClipJobsParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36076. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36077. * This program are made available under the terms of the Apache License, Version 2.0
  36078. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36079. /**
  36080. * @class SuperMap.VectorClipJobsParameter
  36081. * @category iServer ProcessingService VectorClip
  36082. * @classdesc 矢量裁剪分析任务参数类。
  36083. * @param {Object} options - 参数。
  36084. * @param {string} options.datasetName - 数据集名。
  36085. * @param {string} options.datasetOverlay - 裁剪对象数据集。
  36086. * @param {SuperMap.ClipAnalystMode} [options.mode=SuperMap.ClipAnalystMode.CLIP] - 裁剪分析模式。
  36087. * @param {SuperMap.OutputSetting} [options.output] - 输出参数设置。
  36088. * @param {SuperMap.MappingParameters} [options.mappingParameters] - 分析后结果可视化的参数类。
  36089. */
  36090. var VectorClipJobsParameter = /*#__PURE__*/function () {
  36091. function VectorClipJobsParameter(options) {
  36092. VectorClipJobsParameter_classCallCheck(this, VectorClipJobsParameter);
  36093. options = options || {};
  36094. /**
  36095. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetName
  36096. * @description 数据集名。
  36097. */
  36098. this.datasetName = "";
  36099. /**
  36100. * @member {string} SuperMap.VectorClipJobsParameter.prototype.datasetOverlay
  36101. * @description 裁剪对象数据集。
  36102. */
  36103. this.datasetVectorClip = "";
  36104. /**
  36105. * @member {string} SuperMap.VectorClipJobsParameter.prototype.geometryClip
  36106. * @description 裁剪几何对象。
  36107. */
  36108. this.geometryClip = "";
  36109. /**
  36110. * @member {SuperMap.ClipAnalystMode} [SuperMap.VectorClipJobsParameter.prototype.mode=ClipAnalystMode.CLIP]
  36111. * @description 裁剪分析模式 。
  36112. */
  36113. this.mode = ClipAnalystMode.CLIP;
  36114. /**
  36115. * @member {SuperMap.OutputSetting} SuperMap.VectorClipJobsParameter.prototype.output
  36116. * @description 输出参数设置类。
  36117. */
  36118. this.output = null;
  36119. /**
  36120. * @member {SuperMap.MappingParameters} [SuperMap.VectorClipJobsParameter.prototype.mappingParameters]
  36121. * @description 分析后结果可视化的参数类。
  36122. */
  36123. this.mappingParameters = null;
  36124. Util.extend(this, options);
  36125. this.CLASS_NAME = "SuperMap.VectorClipJobsParameter";
  36126. }
  36127. /**
  36128. * @function SuperMap.VectorClipJobsParameter.prototype.destroy
  36129. * @description 释放资源,将引用资源的属性置空。
  36130. */
  36131. VectorClipJobsParameter_createClass(VectorClipJobsParameter, [{
  36132. key: "destroy",
  36133. value: function destroy() {
  36134. this.datasetName = null;
  36135. this.datasetVectorClip = null;
  36136. this.geometryClip = null;
  36137. this.mode = null;
  36138. if (this.output instanceof OutputSetting) {
  36139. this.output.destroy();
  36140. this.output = null;
  36141. }
  36142. if (this.mappingParameters instanceof MappingParameters) {
  36143. this.mappingParameters.destroy();
  36144. this.mappingParameters = null;
  36145. }
  36146. }
  36147. /**
  36148. * @function SuperMap.VectorClipJobsParameter.toObject
  36149. * @param {Object} vectorClipJobsParameter - 区域汇总分析服务参数。
  36150. * @param {Object} tempObj - 目标对象。
  36151. * @description 矢量裁剪分析任务对象。
  36152. */
  36153. }], [{
  36154. key: "toObject",
  36155. value: function toObject(vectorClipJobsParameter, tempObj) {
  36156. for (var name in vectorClipJobsParameter) {
  36157. if (name === "datasetName") {
  36158. tempObj['input'] = tempObj['input'] || {};
  36159. tempObj['input'][name] = vectorClipJobsParameter[name];
  36160. continue;
  36161. }
  36162. if (name === "output") {
  36163. tempObj['output'] = tempObj['output'] || {};
  36164. tempObj['output'] = vectorClipJobsParameter[name];
  36165. continue;
  36166. }
  36167. tempObj['analyst'] = tempObj['analyst'] || {};
  36168. tempObj['analyst'][name] = vectorClipJobsParameter[name];
  36169. if (name === 'mappingParameters') {
  36170. tempObj['analyst'][name] = tempObj['analyst'][name] || {};
  36171. tempObj['analyst']['mappingParameters'] = vectorClipJobsParameter[name];
  36172. }
  36173. }
  36174. }
  36175. }]);
  36176. return VectorClipJobsParameter;
  36177. }();
  36178. SuperMap.VectorClipJobsParameter = VectorClipJobsParameter;
  36179. ;// CONCATENATED MODULE: ./src/common/iServer/VectorClipJobsService.js
  36180. function VectorClipJobsService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { VectorClipJobsService_typeof = function _typeof(obj) { return typeof obj; }; } else { VectorClipJobsService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return VectorClipJobsService_typeof(obj); }
  36181. function VectorClipJobsService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36182. 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); } }
  36183. function VectorClipJobsService_createClass(Constructor, protoProps, staticProps) { if (protoProps) VectorClipJobsService_defineProperties(Constructor.prototype, protoProps); if (staticProps) VectorClipJobsService_defineProperties(Constructor, staticProps); return Constructor; }
  36184. function VectorClipJobsService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { VectorClipJobsService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return VectorClipJobsService_get(target, property, receiver || target); }
  36185. function VectorClipJobsService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = VectorClipJobsService_getPrototypeOf(object); if (object === null) break; } return object; }
  36186. 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 } }); if (superClass) VectorClipJobsService_setPrototypeOf(subClass, superClass); }
  36187. function VectorClipJobsService_setPrototypeOf(o, p) { VectorClipJobsService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return VectorClipJobsService_setPrototypeOf(o, p); }
  36188. 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); }; }
  36189. function VectorClipJobsService_possibleConstructorReturn(self, call) { if (call && (VectorClipJobsService_typeof(call) === "object" || typeof call === "function")) { return call; } return VectorClipJobsService_assertThisInitialized(self); }
  36190. function VectorClipJobsService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36191. function VectorClipJobsService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36192. function VectorClipJobsService_getPrototypeOf(o) { VectorClipJobsService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return VectorClipJobsService_getPrototypeOf(o); }
  36193. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36194. * This program are made available under the terms of the Apache License, Version 2.0
  36195. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36196. /**
  36197. * @class SuperMap.VectorClipJobsService
  36198. * @category iServer ProcessingService VectorClip
  36199. * @classdesc 矢量裁剪分析服务类
  36200. * @extends {SuperMap.ProcessingServiceBase}
  36201. * @param {string} url -矢量裁剪分析服务地址。
  36202. * @param {Object} options - 交互服务时所需可选参数。
  36203. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  36204. * @param {Object} [options.headers] - 请求头。
  36205. */
  36206. var VectorClipJobsService = /*#__PURE__*/function (_ProcessingServiceBas) {
  36207. VectorClipJobsService_inherits(VectorClipJobsService, _ProcessingServiceBas);
  36208. var _super = VectorClipJobsService_createSuper(VectorClipJobsService);
  36209. function VectorClipJobsService(url, options) {
  36210. var _this;
  36211. VectorClipJobsService_classCallCheck(this, VectorClipJobsService);
  36212. _this = _super.call(this, url, options);
  36213. _this.url = Util.urlPathAppend(_this.url, 'spatialanalyst/vectorclip');
  36214. _this.CLASS_NAME = 'SuperMap.VectorClipJobsService';
  36215. return _this;
  36216. }
  36217. /**
  36218. *@override
  36219. */
  36220. VectorClipJobsService_createClass(VectorClipJobsService, [{
  36221. key: "destroy",
  36222. value: function destroy() {
  36223. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "destroy", this).call(this);
  36224. }
  36225. /**
  36226. * @function SuperMap.VectorClipJobsService.protitype.getVectorClipJobs
  36227. * @description 获取矢量裁剪分析所有任务
  36228. */
  36229. }, {
  36230. key: "getVectorClipJobs",
  36231. value: function getVectorClipJobs() {
  36232. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, this.url);
  36233. }
  36234. /**
  36235. * @function SuperMap.KernelDensityJobsService.protitype.getVectorClipJob
  36236. * @description 获取指定id的矢量裁剪分析服务
  36237. * @param {string} id - 指定要获取数据的id
  36238. */
  36239. }, {
  36240. key: "getVectorClipJob",
  36241. value: function getVectorClipJob(id) {
  36242. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "getJobs", this).call(this, Util.urlPathAppend(this.url, id));
  36243. }
  36244. /**
  36245. * @function SuperMap.VectorClipJobsService.protitype.addVectorClipJob
  36246. * @description 新建矢量裁剪分析服务
  36247. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  36248. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  36249. */
  36250. }, {
  36251. key: "addVectorClipJob",
  36252. value: function addVectorClipJob(params, seconds) {
  36253. VectorClipJobsService_get(VectorClipJobsService_getPrototypeOf(VectorClipJobsService.prototype), "addJob", this).call(this, this.url, params, VectorClipJobsParameter, seconds);
  36254. }
  36255. }]);
  36256. return VectorClipJobsService;
  36257. }(ProcessingServiceBase);
  36258. SuperMap.VectorClipJobsService = VectorClipJobsService;
  36259. ;// CONCATENATED MODULE: ./src/common/iServer/RasterFunctionParameter.js
  36260. function RasterFunctionParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36261. 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); } }
  36262. function RasterFunctionParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) RasterFunctionParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) RasterFunctionParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36263. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36264. * This program are made available under the terms of the Apache License, Version 2.0
  36265. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36266. /**
  36267. * @class SuperMap.RasterFunctionParameter
  36268. * @category iServer Map
  36269. * @classdesc iServer 地图服务栅格分析参数基类
  36270. * @param {Object} options - 参数。
  36271. * @param {SuperMap.RasterFunctionType} options.type - 栅格分析方法。
  36272. */
  36273. var RasterFunctionParameter = /*#__PURE__*/function () {
  36274. function RasterFunctionParameter(options) {
  36275. RasterFunctionParameter_classCallCheck(this, RasterFunctionParameter);
  36276. options = options || {};
  36277. /**
  36278. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  36279. * @description 栅格分析方法。
  36280. */
  36281. this.type = null;
  36282. Util.extend(this, options);
  36283. this.CLASS_NAME = 'SuperMap.RasterFunctionParameter';
  36284. }
  36285. /**
  36286. * @function SuperMap.RasterFunctionParameter.prototype.destroy
  36287. * @description 释放资源,将资源的属性置空。
  36288. */
  36289. RasterFunctionParameter_createClass(RasterFunctionParameter, [{
  36290. key: "destroy",
  36291. value: function destroy() {
  36292. this.type = null;
  36293. }
  36294. }]);
  36295. return RasterFunctionParameter;
  36296. }();
  36297. SuperMap.RasterFunctionParameter = RasterFunctionParameter;
  36298. ;// CONCATENATED MODULE: ./src/common/iServer/NDVIParameter.js
  36299. function NDVIParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NDVIParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { NDVIParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NDVIParameter_typeof(obj); }
  36300. function NDVIParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36301. 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); } }
  36302. function NDVIParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NDVIParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NDVIParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36303. function NDVIParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { NDVIParameter_get = Reflect.get; } 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(receiver); } return desc.value; }; } return NDVIParameter_get(target, property, receiver || target); }
  36304. function NDVIParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = NDVIParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  36305. 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 } }); if (superClass) NDVIParameter_setPrototypeOf(subClass, superClass); }
  36306. function NDVIParameter_setPrototypeOf(o, p) { NDVIParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NDVIParameter_setPrototypeOf(o, p); }
  36307. 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); }; }
  36308. function NDVIParameter_possibleConstructorReturn(self, call) { if (call && (NDVIParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return NDVIParameter_assertThisInitialized(self); }
  36309. function NDVIParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36310. function NDVIParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36311. function NDVIParameter_getPrototypeOf(o) { NDVIParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NDVIParameter_getPrototypeOf(o); }
  36312. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36313. * This program are made available under the terms of the Apache License, Version 2.0
  36314. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36315. /**
  36316. * @class SuperMap.NDVIParameter
  36317. * @category iServer Map
  36318. * @classdesc 归一化植被指数参数类
  36319. * @param {Object} options - 参数。
  36320. * @param {number} [options.redIndex=0] - 红光谱波段索引。
  36321. * @param {number} [options.nirIndex=1] - 近红外光谱波段索引。
  36322. * @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。仅单波段数据时设定。
  36323. * @extends {SuperMap.RasterFunctionParameter}
  36324. */
  36325. var NDVIParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  36326. NDVIParameter_inherits(NDVIParameter, _RasterFunctionParame);
  36327. var _super = NDVIParameter_createSuper(NDVIParameter);
  36328. function NDVIParameter(options) {
  36329. var _this;
  36330. NDVIParameter_classCallCheck(this, NDVIParameter);
  36331. _this = _super.call(this, options);
  36332. /**
  36333. * @member {number} [SuperMap.NDVIParameter.prototype.redIndex=0]
  36334. * @description 红光谱波段索引。
  36335. */
  36336. _this.redIndex = 0;
  36337. /**
  36338. * @member {number} [SuperMap.NDVIParameter.prototype.nirIndex=1]
  36339. * @description 近红外光谱波段索引。
  36340. */
  36341. _this.nirIndex = 1;
  36342. /**
  36343. * @member {string} [SuperMap.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"]
  36344. * @description 颜色表。由栅格的中断值和颜色停止之间的映射组成的,如0.3->d9f0a3ff 指的是[0,0.3)显示d9f0a3ff。仅单波段数据时设定。
  36345. */
  36346. _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';
  36347. /**
  36348. * @member {SuperMap.RasterFunctionType} [SuperMap.RasterFunctionParameter.prototype.type]
  36349. * @description 栅格分析方法。
  36350. */
  36351. _this.type = RasterFunctionType.NDVI;
  36352. Util.extend(NDVIParameter_assertThisInitialized(_this), options);
  36353. _this.CLASS_NAME = 'SuperMap.NDVIParameter';
  36354. return _this;
  36355. }
  36356. /**
  36357. * @function SuperMap.NDVIParameter.prototype.destroy
  36358. * @override
  36359. */
  36360. NDVIParameter_createClass(NDVIParameter, [{
  36361. key: "destroy",
  36362. value: function destroy() {
  36363. NDVIParameter_get(NDVIParameter_getPrototypeOf(NDVIParameter.prototype), "destroy", this).call(this);
  36364. this.redIndex = null;
  36365. this.nirIndex = null;
  36366. this.colorMap = null;
  36367. }
  36368. /**
  36369. * @function SuperMap.NDVIParameter.prototype.toJSON
  36370. * @description 将 NDVIParameter 对象转化为 JSON 字符串。
  36371. * @returns {string} 返回转换后的 JSON 字符串。
  36372. */
  36373. }, {
  36374. key: "toJSON",
  36375. value: function toJSON() {
  36376. return {
  36377. redIndex: this.redIndex,
  36378. nirIndex: this.nirIndex,
  36379. colorMap: this.colorMap,
  36380. type: this.type
  36381. };
  36382. }
  36383. }]);
  36384. return NDVIParameter;
  36385. }(RasterFunctionParameter);
  36386. SuperMap.NDVIParameter = NDVIParameter;
  36387. ;// CONCATENATED MODULE: ./src/common/iServer/HillshadeParameter.js
  36388. function HillshadeParameter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HillshadeParameter_typeof = function _typeof(obj) { return typeof obj; }; } else { HillshadeParameter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HillshadeParameter_typeof(obj); }
  36389. function HillshadeParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36390. 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); } }
  36391. function HillshadeParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) HillshadeParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) HillshadeParameter_defineProperties(Constructor, staticProps); return Constructor; }
  36392. function HillshadeParameter_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { HillshadeParameter_get = Reflect.get; } 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(receiver); } return desc.value; }; } return HillshadeParameter_get(target, property, receiver || target); }
  36393. function HillshadeParameter_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = HillshadeParameter_getPrototypeOf(object); if (object === null) break; } return object; }
  36394. 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 } }); if (superClass) HillshadeParameter_setPrototypeOf(subClass, superClass); }
  36395. function HillshadeParameter_setPrototypeOf(o, p) { HillshadeParameter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HillshadeParameter_setPrototypeOf(o, p); }
  36396. 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); }; }
  36397. function HillshadeParameter_possibleConstructorReturn(self, call) { if (call && (HillshadeParameter_typeof(call) === "object" || typeof call === "function")) { return call; } return HillshadeParameter_assertThisInitialized(self); }
  36398. function HillshadeParameter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  36399. function HillshadeParameter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  36400. function HillshadeParameter_getPrototypeOf(o) { HillshadeParameter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HillshadeParameter_getPrototypeOf(o); }
  36401. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36402. * This program are made available under the terms of the Apache License, Version 2.0
  36403. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36404. /**
  36405. * @class SuperMap.HillshadeParameter
  36406. * @category iServer Map
  36407. * @classdesc 阴影面分析参数类
  36408. * @param {Object} options - 参数。
  36409. * @param {number} [options.altitude=45] - 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  36410. * @param {number} [options.azimuth=315] - 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  36411. * @param {number} [options.zFactor=1] - 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  36412. * z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  36413. * 如果 x,y 单位和 z 单位采用相同的测量单位,则 z 因子为 1。这是默认设置。
  36414. * 如果 x,y 单位和 z 单位采用不同的测量单位,则必须将 z 因子设置为适当的因子,否则会得到错误的结果。例如,如果 z 单位是英尺而 x,y 单位是米,则应使用 z 因子 0.3048 将 z 单位从英尺转换为米(1 英尺 = 0.3048 米)。
  36415. * 如果输入栅格位于球面坐标系中(如十进制度球面坐标系),则生成的山体阴影可能看起来很独特。这是因为水平地面单位与高程 z 单位之间的测量值存在差异。由于经度的长度随着纬度而变化,因此需要为该纬度指定一个适当的 z 因子。如果 x,y 单位是十进制度而 Z 单位是米,特定纬度的一些合适的 Z 因子为:
  36416. * Latitude Z-factor
  36417. * 0 0.00000898
  36418. * 10 0.00000912
  36419. * 20 0.00000956
  36420. * 30 0.00001036
  36421. * 40 0.00001171
  36422. * 50 0.00001395
  36423. * 60 0.00001792
  36424. * 70 0.00002619
  36425. * 80 0.00005156
  36426. * @extends {SuperMap.RasterFunctionParameter}
  36427. */
  36428. var HillshadeParameter = /*#__PURE__*/function (_RasterFunctionParame) {
  36429. HillshadeParameter_inherits(HillshadeParameter, _RasterFunctionParame);
  36430. var _super = HillshadeParameter_createSuper(HillshadeParameter);
  36431. function HillshadeParameter(options) {
  36432. var _this;
  36433. HillshadeParameter_classCallCheck(this, HillshadeParameter);
  36434. _this = _super.call(this, options);
  36435. /**
  36436. * @member {number} [SuperMap.HillshadeParameter.prototype.altitude = 45]
  36437. * @description 高于地平线的光源高度角。高度角由正度数表示,0 度代表地平线,而 90 度代表头顶正上方。
  36438. */
  36439. _this.altitude = 45;
  36440. /**
  36441. * @member {number} [SuperMap.HillshadeParameter.prototype.azimuth = 315]
  36442. * @description 光源的方位角。方位角由0到360度之间的正度数表示,以北为基准方向按顺时针进行测量。
  36443. */
  36444. _this.azimuth = 315;
  36445. /**
  36446. * @member {number} [SuperMap.HillshadeParameter.prototype.zFactor = 1]
  36447. * @description 一个表面 z 单位中地面 x,y 单位的数量。z 单位与输入表面的 x,y 单位不同时,可使用 z 因子调整 z 单位的测量单位。计算最终输出表面时,将用 z 因子乘以输入表面的 z 值。
  36448. */
  36449. _this.zFactor = 1;
  36450. /**
  36451. * @member {SuperMap.RasterFunctionType} SuperMap.RasterFunctionParameter.prototype.type
  36452. * @description 栅格分析方法。
  36453. */
  36454. _this.type = RasterFunctionType.HILLSHADE;
  36455. Util.extend(HillshadeParameter_assertThisInitialized(_this), options);
  36456. _this.CLASS_NAME = 'SuperMap.HillshadeParameter';
  36457. return _this;
  36458. }
  36459. /**
  36460. * @function SuperMap.HillshadeParameter.prototype.destroy
  36461. * @override
  36462. */
  36463. HillshadeParameter_createClass(HillshadeParameter, [{
  36464. key: "destroy",
  36465. value: function destroy() {
  36466. HillshadeParameter_get(HillshadeParameter_getPrototypeOf(HillshadeParameter.prototype), "destroy", this).call(this);
  36467. this.altitude = null;
  36468. this.azimuth = null;
  36469. this.zFactor = null;
  36470. }
  36471. /**
  36472. * @function SuperMap.HillshadeParameter.prototype.toJSON
  36473. * @description 将 HillshadeParameter 对象转化为 JSON 字符串。
  36474. * @returns {string} 返回转换后的 JSON 字符串。
  36475. */
  36476. }, {
  36477. key: "toJSON",
  36478. value: function toJSON() {
  36479. return {
  36480. altitude: this.altitude,
  36481. azimuth: this.azimuth,
  36482. zFactor: this.zFactor,
  36483. type: this.type
  36484. };
  36485. }
  36486. }]);
  36487. return HillshadeParameter;
  36488. }(RasterFunctionParameter);
  36489. SuperMap.HillshadeParameter = HillshadeParameter;
  36490. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobCustomItems.js
  36491. function WebPrintingJobCustomItems_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36492. 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); } }
  36493. function WebPrintingJobCustomItems_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobCustomItems_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobCustomItems_defineProperties(Constructor, staticProps); return Constructor; }
  36494. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36495. * This program are made available under the terms of the Apache License, Version 2.0
  36496. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36497. /**
  36498. * @class SuperMap.WebPrintingJobCustomItems
  36499. * @classdesc Web 打印图例元素参数类。
  36500. * @version 10.1.0
  36501. * @category iServer WebPrintingJob
  36502. * @param {Object} option - 初始化参数。
  36503. * @param {string} option.name - 图例元素的名称。
  36504. * @param {string} [option.picAsUrl] - 图例元素 Base64 格式图片。
  36505. * @param {string} [option.picAsBase64] - 图例元素图片的获取地址。
  36506. */
  36507. var WebPrintingJobCustomItems = /*#__PURE__*/function () {
  36508. function WebPrintingJobCustomItems(option) {
  36509. WebPrintingJobCustomItems_classCallCheck(this, WebPrintingJobCustomItems);
  36510. /**
  36511. * @member {string} SuperMap.WebPrintingJobCustomItems.prototype.name
  36512. * @description 图例元素的名称。
  36513. */
  36514. this.name = null;
  36515. /**
  36516. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsUrl]
  36517. * @description 图例元素 Base64 格式图片。
  36518. */
  36519. this.picAsUrl = null;
  36520. /**
  36521. * @member {string} [SuperMap.WebPrintingJobCustomItems.prototype.picAsBase64]
  36522. * @description 图例元素图片的获取地址。
  36523. */
  36524. this.picAsBase64 = null;
  36525. this.CLASS_NAME = 'SuperMap.WebPrintingJobCustomItems';
  36526. Util.extend(this, option);
  36527. }
  36528. /**
  36529. * @function SuperMap.WebPrintingJobCustomItems.prototype.destroy
  36530. * @description 释放资源,将引用资源的属性置空。
  36531. */
  36532. WebPrintingJobCustomItems_createClass(WebPrintingJobCustomItems, [{
  36533. key: "destroy",
  36534. value: function destroy() {
  36535. var me = this;
  36536. me.name = null;
  36537. me.picAsUrl = null;
  36538. me.picAsBase64 = null;
  36539. }
  36540. /**
  36541. * @function SuperMap.WebPrintingJobCustomItems.prototype.toJSON
  36542. * @description 将 SuperMap.WebPrintingJobCustomItems 对象转化为 JSON 字符串。
  36543. * @returns {string} 返回转换后的 JSON 字符串。
  36544. */
  36545. }, {
  36546. key: "toJSON",
  36547. value: function toJSON() {
  36548. var params = {
  36549. name: this.name
  36550. };
  36551. if (this.title) {
  36552. params.title = this.title;
  36553. }
  36554. if (this.picAsUrl) {
  36555. params.picAsUrl = this.picAsUrl;
  36556. } else if (this.picAsBase64) {
  36557. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  36558. }
  36559. return Util.toJSON(params);
  36560. }
  36561. }]);
  36562. return WebPrintingJobCustomItems;
  36563. }();
  36564. SuperMap.WebPrintingJobCustomItems = WebPrintingJobCustomItems;
  36565. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobImage.js
  36566. function WebPrintingJobImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36567. 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); } }
  36568. function WebPrintingJobImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobImage_defineProperties(Constructor, staticProps); return Constructor; }
  36569. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36570. * This program are made available under the terms of the Apache License, Version 2.0
  36571. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36572. /**
  36573. * @class SuperMap.WebPrintingJobImage
  36574. * @classdesc 表达小地图的静态图片参数类。
  36575. * @version 10.1.0
  36576. * @category iServer WebPrintingJob
  36577. * @param {Object} option - 初始化参数。
  36578. * @param {string} [option.picAsUrl] - 小地图的图片 url 地址。
  36579. * @param {string} [option.picAsBase64] - 小地图的base64位图片信息。
  36580. */
  36581. var WebPrintingJobImage = /*#__PURE__*/function () {
  36582. function WebPrintingJobImage(option) {
  36583. WebPrintingJobImage_classCallCheck(this, WebPrintingJobImage);
  36584. /**
  36585. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsUrl]
  36586. * @description 小地图的图片 url 地址。
  36587. */
  36588. this.picAsUrl = null;
  36589. /**
  36590. * @member {string} [SuperMap.WebPrintingJobImage.prototype.picAsBase64]
  36591. * @description 小地图的base64位图片信息。
  36592. */
  36593. this.picAsBase64 = null;
  36594. this.CLASS_NAME = 'SuperMap.WebPrintingJobImage';
  36595. Util.extend(this, option);
  36596. }
  36597. /**
  36598. * @function SuperMap.WebPrintingJobImage.prototype.destroy
  36599. * @description 释放资源,将引用资源的属性置空。
  36600. */
  36601. WebPrintingJobImage_createClass(WebPrintingJobImage, [{
  36602. key: "destroy",
  36603. value: function destroy() {
  36604. this.picAsUrl = null;
  36605. this.picAsBase64 = null;
  36606. }
  36607. /**
  36608. * @function SuperMap.WebPrintingJobImage.prototype.toJSON
  36609. * @description 将 SuperMap.WebPrintingJobImage 对象转化为 JSON 字符串。
  36610. * @returns {string} 返回转换后的 JSON 字符串。
  36611. */
  36612. }, {
  36613. key: "toJSON",
  36614. value: function toJSON() {
  36615. var params = {};
  36616. if (this.picAsUrl) {
  36617. params.picAsUrl = this.picAsUrl;
  36618. }
  36619. if (this.picAsBase64) {
  36620. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  36621. }
  36622. return Util.toJSON(params);
  36623. }
  36624. }]);
  36625. return WebPrintingJobImage;
  36626. }();
  36627. SuperMap.WebPrintingJobImage = WebPrintingJobImage;
  36628. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayers.js
  36629. function WebPrintingJobLayers_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36630. 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); } }
  36631. function WebPrintingJobLayers_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayers_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayers_defineProperties(Constructor, staticProps); return Constructor; }
  36632. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36633. * This program are made available under the terms of the Apache License, Version 2.0
  36634. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36635. /**
  36636. * @class SuperMap.WebPrintingJobLayers
  36637. * @classdesc 将图例添加到布局的业务图层参数类。
  36638. * @version 10.1.0
  36639. * @category iServer WebPrintingJob
  36640. * @param {Object} option - 初始化参数。
  36641. * @param {string} [option.name] - 表示图层 name 的字符串。此 name 必须唯一,并且必须与定义业务图层的 LegendOptions_layers 元素中的图层 name 匹配。
  36642. */
  36643. var WebPrintingJobLayers = /*#__PURE__*/function () {
  36644. function WebPrintingJobLayers(option) {
  36645. WebPrintingJobLayers_classCallCheck(this, WebPrintingJobLayers);
  36646. /**
  36647. * @member {string} SuperMap.WebPrintingJobLayers.prototype.name
  36648. * @description 图层 name。
  36649. */
  36650. this.name = null;
  36651. /**
  36652. * @member {string} SuperMap.WebPrintingJobLayers.prototype.layerType
  36653. * @description 图层 type。
  36654. */
  36655. this.layerType = null;
  36656. /**
  36657. * @member {string} SuperMap.WebPrintingJobLayers.prototype.url
  36658. * @description 图层 url。
  36659. */
  36660. this.url = null;
  36661. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayers';
  36662. Util.extend(this, option);
  36663. }
  36664. /**
  36665. * @function SuperMap.WebPrintingJobLayers.prototype.destroy
  36666. * @description 释放资源,将引用资源的属性置空。
  36667. */
  36668. WebPrintingJobLayers_createClass(WebPrintingJobLayers, [{
  36669. key: "destroy",
  36670. value: function destroy() {
  36671. this.name = null;
  36672. this.layerType = null;
  36673. this.url = null;
  36674. }
  36675. }]);
  36676. return WebPrintingJobLayers;
  36677. }();
  36678. SuperMap.WebPrintingJobLayers = WebPrintingJobLayers;
  36679. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLegendOptions.js
  36680. function WebPrintingJobLegendOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36681. 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); } }
  36682. function WebPrintingJobLegendOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLegendOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLegendOptions_defineProperties(Constructor, staticProps); return Constructor; }
  36683. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36684. * This program are made available under the terms of the Apache License, Version 2.0
  36685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36686. /**
  36687. * @class SuperMap.WebPrintingJobLegendOptions
  36688. * @classdesc Web 打印图例参数类。
  36689. * @version 10.1.0
  36690. * @category iServer WebPrintingJob
  36691. * @param {Object} option - 初始化参数。
  36692. * @param {string} [option.title] - 图例名称。
  36693. * @param {string} [option.picAsUrl] - 图例的图片 url 地址。
  36694. * @param {string} [option.picAsBase64] - 图例的 base64 位图片信息。
  36695. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 图例的布局业务图层参数类。
  36696. * @param {SuperMap.WebPrintingJobCustomItems} [option.customItems] - 自定义图例元素参数类。
  36697. */
  36698. var WebPrintingJobLegendOptions = /*#__PURE__*/function () {
  36699. function WebPrintingJobLegendOptions(option) {
  36700. WebPrintingJobLegendOptions_classCallCheck(this, WebPrintingJobLegendOptions);
  36701. /**
  36702. * @member {string} SuperMap.WebPrintingJobLegendOptions.prototype.title
  36703. * @description 图例名称。
  36704. */
  36705. this.title = null;
  36706. /**
  36707. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsUrl]
  36708. * @description 图例的图片 url 地址。
  36709. */
  36710. this.picAsUrl = null;
  36711. /**
  36712. * @member {string} [SuperMap.WebPrintingJobLegendOptions.prototype.picAsBase64]
  36713. * @description 图例的 base64 位图片信息。
  36714. */
  36715. this.picAsBase64 = null;
  36716. /**
  36717. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLegendOptions.prototype.layers]
  36718. * @description 图例的布局业务图层参数类。
  36719. */
  36720. this.layers = null;
  36721. /**
  36722. * @member {SuperMap.WebPrintingJobCustomItems} [SuperMap.WebPrintingJobLegendOptions.prototype.customItems]
  36723. * @description 自定义图例元素参数类。
  36724. */
  36725. this.customItems = null;
  36726. this.CLASS_NAME = 'SuperMap.WebPrintingJobLegendOptions';
  36727. Util.extend(this, option);
  36728. }
  36729. /**
  36730. * @function SuperMap.WebPrintingJobLegendOptions.prototype.destroy
  36731. * @description 释放资源,将引用资源的属性置空。
  36732. */
  36733. WebPrintingJobLegendOptions_createClass(WebPrintingJobLegendOptions, [{
  36734. key: "destroy",
  36735. value: function destroy() {
  36736. this.title = null;
  36737. this.picAsUrl = null;
  36738. this.picAsBase64 = null;
  36739. if (this.layers instanceof WebPrintingJobLayers) {
  36740. this.layers.destroy();
  36741. this.layers = null;
  36742. }
  36743. if (this.customItems instanceof WebPrintingJobCustomItems) {
  36744. this.customItems.destroy();
  36745. this.customItems = null;
  36746. }
  36747. }
  36748. /**
  36749. * @function SuperMap.WebPrintingJobLegendOptions.prototype.toJSON
  36750. * @description 将 SuperMap.WebPrintingJobLegendOptions 对象转化为 JSON 字符串。
  36751. * @returns {string} 返回转换后的 JSON 字符串。
  36752. */
  36753. }, {
  36754. key: "toJSON",
  36755. value: function toJSON() {
  36756. var params = {
  36757. title: this.title || ""
  36758. };
  36759. if (this.picAsUrl) {
  36760. params.picAsUrl = this.picAsUrl;
  36761. } else if (this.picAsBase64) {
  36762. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  36763. } else if (this.customItems) {
  36764. params.customItems = this.customItems;
  36765. }
  36766. return Util.toJSON(params);
  36767. }
  36768. }]);
  36769. return WebPrintingJobLegendOptions;
  36770. }();
  36771. SuperMap.WebPrintingJobLegendOptions = WebPrintingJobLegendOptions;
  36772. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLittleMapOptions.js
  36773. function WebPrintingJobLittleMapOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36774. 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); } }
  36775. function WebPrintingJobLittleMapOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLittleMapOptions_defineProperties(Constructor, staticProps); return Constructor; }
  36776. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36777. * This program are made available under the terms of the Apache License, Version 2.0
  36778. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36779. /**
  36780. * @class SuperMap.WebPrintingJobLittleMapOptions
  36781. * @classdesc Web 打印小地图参数类。
  36782. * @version 10.1.0
  36783. * @category iServer WebPrintingJob
  36784. * @param {Object} option - 初始化参数。
  36785. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} option.center - 小地图的中心点。
  36786. * @param {number} [option.scale] - 小地图的比例尺。
  36787. * @param {Array.<string>} [option.layerNames] - 指定 WebMap中图层名称的列表,用于渲染小地图。
  36788. * @param {SuperMap.WebPrintingJobImage} [option.image] - 表达小地图的静态图类。
  36789. * @param {SuperMap.WebPrintingJobLayers} [option.layers] - 指定 WebMap 中的 layers 图层类。
  36790. */
  36791. var WebPrintingJobLittleMapOptions = /*#__PURE__*/function () {
  36792. function WebPrintingJobLittleMapOptions(option) {
  36793. WebPrintingJobLittleMapOptions_classCallCheck(this, WebPrintingJobLittleMapOptions);
  36794. /**
  36795. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} SuperMap.WebPrintingJobLittleMapOptions.prototype.center
  36796. * @description 小地图的中心点。
  36797. */
  36798. this.center = null;
  36799. /**
  36800. * @member {number} [SuperMap.WebPrintingJobLittleMapOptions.prototype.scale]
  36801. * @description 小地图的比例尺。
  36802. */
  36803. this.scale = null;
  36804. /**
  36805. * @member {Array.<string>} SuperMap.WebPrintingJobLittleMapOptions.prototype.layerNames
  36806. * @description 指定 WebMap中图层名称的列表,用于渲染小地图。
  36807. */
  36808. this.layerNames = null;
  36809. /**
  36810. * @member {SuperMap.WebPrintingJobImage} [SuperMap.WebPrintingJobLittleMapOptions.prototype.image]
  36811. * @description 表达小地图的静态图类。暂不支持
  36812. */
  36813. this.image = null;
  36814. /**
  36815. * @member {SuperMap.WebPrintingJobLayers} [SuperMap.WebPrintingJobLittleMapOptions.prototype.layers]
  36816. * @description 指定 WebMap 中的 layers 图层类。
  36817. */
  36818. this.layers = null;
  36819. this.CLASS_NAME = 'SuperMap.WebPrintingJobLittleMapOptions';
  36820. Util.extend(this, option);
  36821. }
  36822. /**
  36823. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.destroy
  36824. * @description 释放资源,将引用资源的属性置空。
  36825. */
  36826. WebPrintingJobLittleMapOptions_createClass(WebPrintingJobLittleMapOptions, [{
  36827. key: "destroy",
  36828. value: function destroy() {
  36829. this.center = null;
  36830. this.scale = null;
  36831. this.layerNames = null;
  36832. if (this.image instanceof WebPrintingJobImage) {
  36833. this.image.destroy();
  36834. this.image = null;
  36835. }
  36836. if (this.layers instanceof WebPrintingJobLayers) {
  36837. this.layers.destroy();
  36838. this.layers = null;
  36839. }
  36840. }
  36841. /**
  36842. * @function SuperMap.WebPrintingJobLittleMapOptions.prototype.toJSON
  36843. * @description 将 SuperMap.WebPrintingJobLittleMapOptions 对象转化为 JSON 字符串。
  36844. * @returns {string} 返回转换后的 JSON 字符串。
  36845. */
  36846. }, {
  36847. key: "toJSON",
  36848. value: function toJSON() {
  36849. var params = {
  36850. scale: this.scale,
  36851. center: this.center
  36852. };
  36853. if (this.layerNames) {
  36854. params.layerNames = this.layerNames;
  36855. } else if (this.layers) {
  36856. params.layers = this.layers;
  36857. }
  36858. if (this.image) {
  36859. params.image = this.image;
  36860. }
  36861. return Util.toJSON(params);
  36862. }
  36863. }]);
  36864. return WebPrintingJobLittleMapOptions;
  36865. }();
  36866. SuperMap.WebPrintingJobLittleMapOptions = WebPrintingJobLittleMapOptions;
  36867. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobNorthArrowOptions.js
  36868. function WebPrintingJobNorthArrowOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36869. 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); } }
  36870. function WebPrintingJobNorthArrowOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobNorthArrowOptions_defineProperties(Constructor, staticProps); return Constructor; }
  36871. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36872. * This program are made available under the terms of the Apache License, Version 2.0
  36873. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36874. /**
  36875. * @class SuperMap.WebPrintingJobNorthArrowOptions
  36876. * @classdesc Web 打印地图指北针参数类。
  36877. * @version 10.1.0
  36878. * @category iServer WebPrintingJob
  36879. * @param {Object} option - 初始化参数。
  36880. * @param {string} option.picAsUrl - 指北针的图片 url 地址。
  36881. * @param {string} [option.picAsBase64] - 指北针的base64位图片信息。
  36882. */
  36883. var WebPrintingJobNorthArrowOptions = /*#__PURE__*/function () {
  36884. function WebPrintingJobNorthArrowOptions(option) {
  36885. WebPrintingJobNorthArrowOptions_classCallCheck(this, WebPrintingJobNorthArrowOptions);
  36886. /**
  36887. * @member {string} SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsUrl
  36888. * @description 指北针的图片 url 地址。
  36889. */
  36890. this.picAsUrl = null;
  36891. /**
  36892. * @member {string} [SuperMap.WebPrintingJobNorthArrowOptions.prototype.picAsBase64]
  36893. * @description 指北针的base64位图片信息。
  36894. */
  36895. this.picAsBase64 = null;
  36896. this.CLASS_NAME = 'SuperMap.WebPrintingJobNorthArrowOptions';
  36897. Util.extend(this, option);
  36898. }
  36899. /**
  36900. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.destroy
  36901. * @description 释放资源,将引用资源的属性置空。
  36902. */
  36903. WebPrintingJobNorthArrowOptions_createClass(WebPrintingJobNorthArrowOptions, [{
  36904. key: "destroy",
  36905. value: function destroy() {
  36906. this.picAsUrl = null;
  36907. this.picAsBase64 = null;
  36908. }
  36909. /**
  36910. * @function SuperMap.WebPrintingJobNorthArrowOptions.prototype.toJSON
  36911. * @description 将 SuperMap.WebPrintingJobNorthArrowOptions 对象转化为 JSON 字符串。
  36912. * @returns {string} 返回转换后的 JSON 字符串。
  36913. */
  36914. }, {
  36915. key: "toJSON",
  36916. value: function toJSON() {
  36917. var params = {};
  36918. if (this.picAsUrl) {
  36919. params.picAsUrl = this.picAsUrl;
  36920. } else if (this.picAsBase64) {
  36921. params.picAsBase64 = this.picAsBase64.replace(/^data:.+;base64,/, '');
  36922. }
  36923. return Util.toJSON(params);
  36924. }
  36925. }]);
  36926. return WebPrintingJobNorthArrowOptions;
  36927. }();
  36928. SuperMap.WebPrintingJobNorthArrowOptions = WebPrintingJobNorthArrowOptions;
  36929. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobScaleBarOptions.js
  36930. function WebPrintingJobScaleBarOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  36931. 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); } }
  36932. function WebPrintingJobScaleBarOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobScaleBarOptions_defineProperties(Constructor, staticProps); return Constructor; }
  36933. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  36934. * This program are made available under the terms of the Apache License, Version 2.0
  36935. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  36936. /**
  36937. * @class SuperMap.WebPrintingJobScaleBarOptions
  36938. * @classdesc Web 打印比例尺参数类。
  36939. * @category iServer WebPrintingJob
  36940. * @version 10.1.0
  36941. * @param {Object} option - 初始化参数。
  36942. * @param {string} [option.scaleText] - 比例尺文本信息。例如:1:1000000
  36943. * @param {SuperMap.WebScaleOrientationType} [option.orientation] - 比例尺的方位样式。
  36944. * @param {SuperMap.WebScaleType} [option.type] - 比例尺的样式。
  36945. * @param {number} [option.intervals] - 比例尺条的段数。
  36946. * @param {SuperMap.WebScaleUnit} [option.unit] - 比例尺的单位制。
  36947. */
  36948. var WebPrintingJobScaleBarOptions = /*#__PURE__*/function () {
  36949. function WebPrintingJobScaleBarOptions(option) {
  36950. WebPrintingJobScaleBarOptions_classCallCheck(this, WebPrintingJobScaleBarOptions);
  36951. /**
  36952. * @member {string} SuperMap.WebPrintingJobScaleBarOptions.prototype.scaleText
  36953. * @description 比例尺文本信息。
  36954. */
  36955. this.scaleText = null;
  36956. /**
  36957. * @member {SuperMap.WebScaleOrientationType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.orientation]
  36958. * @description 比例尺的方位样式。
  36959. */
  36960. this.orientation = null;
  36961. /**
  36962. * @member {SuperMap.WebScaleType} [SuperMap.WebPrintingJobScaleBarOptions.prototype.type]
  36963. * @description 比例尺的样式。
  36964. */
  36965. this.type = null;
  36966. /**
  36967. * @member {object} [SuperMap.WebPrintingJobScaleBarOptions.prototype.intervals]
  36968. * @description 比例尺条的段数。
  36969. */
  36970. this.intervals = null;
  36971. /**
  36972. * @member {SuperMap.WebScaleUnit} [SuperMap.WebPrintingJobScaleBarOptions.prototype.unit]
  36973. * @description 比例尺的单位制。
  36974. */
  36975. this.unit = null;
  36976. this.CLASS_NAME = 'SuperMap.WebPrintingJobScaleBarOptions';
  36977. Util.extend(this, option);
  36978. }
  36979. /**
  36980. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.destroy
  36981. * @description 释放资源,将引用资源的属性置空。
  36982. */
  36983. WebPrintingJobScaleBarOptions_createClass(WebPrintingJobScaleBarOptions, [{
  36984. key: "destroy",
  36985. value: function destroy() {
  36986. this.scaleText = null;
  36987. this.orientation = null;
  36988. this.type = null;
  36989. this.intervals = null;
  36990. this.unit = null;
  36991. }
  36992. /**
  36993. * @function SuperMap.WebPrintingJobScaleBarOptions.prototype.toJSON
  36994. * @description 将 SuperMap.WebPrintingJobScaleBarOptions 对象转化为 JSON 字符串。
  36995. * @returns {string} 返回转换后的 JSON 字符串。
  36996. */
  36997. }, {
  36998. key: "toJSON",
  36999. value: function toJSON() {
  37000. var params = {
  37001. scaleText: this.scaleText || "",
  37002. type: this.type || "BAR",
  37003. intervals: this.intervals || "",
  37004. unit: this.unit || "METER"
  37005. };
  37006. if (this.orientation) {
  37007. params.orientation = this.orientation;
  37008. }
  37009. return Util.toJSON(params);
  37010. }
  37011. }]);
  37012. return WebPrintingJobScaleBarOptions;
  37013. }();
  37014. SuperMap.WebPrintingJobScaleBarOptions = WebPrintingJobScaleBarOptions;
  37015. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobContent.js
  37016. function WebPrintingJobContent_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37017. 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); } }
  37018. function WebPrintingJobContent_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobContent_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobContent_defineProperties(Constructor, staticProps); return Constructor; }
  37019. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37020. * This program are made available under the terms of the Apache License, Version 2.0
  37021. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37022. /**
  37023. * @class SuperMap.WebPrintingJobContent
  37024. * @classdesc Web 打印内容参数类。
  37025. * @version 10.1.0
  37026. * @category iServer WebPrintingJob
  37027. * @param {Object} option - 初始化参数。
  37028. * @param {string} option.type - Web 打印内容支持的类型。目前支持的类型:WEBMAP
  37029. * @param {string} [option.url] - 待打印的 SuperMap iPortal WebMap 的 url 地址。例如:http://supermapiportal:8190/iportal/web/maps/{mapid}/map.rjson
  37030. * @param {string} [option.token] - 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  37031. * @param {WebMapSummaryObject} [option.value] - 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。如果已填了 url 参数,此参数可不传
  37032. */
  37033. var WebPrintingJobContent = /*#__PURE__*/function () {
  37034. function WebPrintingJobContent(option) {
  37035. WebPrintingJobContent_classCallCheck(this, WebPrintingJobContent);
  37036. /**
  37037. * @member {string} SuperMap.WebPrintingJobContent.prototype.type
  37038. * @description Web 打印内容支持的类型。
  37039. */
  37040. this.type = null;
  37041. /**
  37042. * @member {string} [SuperMap.WebPrintingJobContent.prototype.url]
  37043. * @description 待打印的 SuperMap iPortal WebMap 的 url 地址。
  37044. */
  37045. this.url = null;
  37046. /**
  37047. * @member {string} [SuperMap.WebPrintingJobContent.prototype.token]
  37048. * @description 如果待打印的是 SuperMap iPortal 用户私有的 WebMap,需要提供 SuperMap iPortal 用户的 token。
  37049. */
  37050. this.token = null;
  37051. /**
  37052. * @member {WebMapSummaryObject} [SuperMap.WebPrintingJobContent.prototype.value]
  37053. * @description 传递的是一个符合 SuperMap WebMap 规范的 WebMap 的 JSON 表达,也可以是一个完整的 SuperMap iPortal 数据上图制作的 WebMap 的 json 表达。
  37054. */
  37055. this.value = null;
  37056. this.CLASS_NAME = 'SuperMap.WebPrintingJobContent';
  37057. Util.extend(this, option);
  37058. }
  37059. /**
  37060. * @function SuperMap.WebPrintingJobContent.prototype.destroy
  37061. * @description 释放资源,将引用资源的属性置空。
  37062. */
  37063. WebPrintingJobContent_createClass(WebPrintingJobContent, [{
  37064. key: "destroy",
  37065. value: function destroy() {
  37066. this.type = false || "WEBMAP";
  37067. this.url = null;
  37068. this.token = null;
  37069. this.value = null;
  37070. }
  37071. /**
  37072. * @function SuperMap.WebPrintingJobContent.prototype.toJSON
  37073. * @description 将 SuperMap.WebPrintingJobContent 对象转化为 JSON 字符串。
  37074. * @returns {string} 返回转换后的 JSON 字符串。
  37075. */
  37076. }, {
  37077. key: "toJSON",
  37078. value: function toJSON() {
  37079. var params = {
  37080. type: this.type
  37081. };
  37082. if (this.token) {
  37083. params.token = this.token;
  37084. }
  37085. if (this.url) {
  37086. params.url = this.url;
  37087. } else if (this.value) {
  37088. params.value = this.value;
  37089. }
  37090. return Util.toJSON(params);
  37091. }
  37092. }]);
  37093. return WebPrintingJobContent;
  37094. }();
  37095. SuperMap.WebPrintingJobContent = WebPrintingJobContent;
  37096. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobLayoutOptions.js
  37097. function WebPrintingJobLayoutOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37098. 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); } }
  37099. function WebPrintingJobLayoutOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobLayoutOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobLayoutOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37100. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37101. * This program are made available under the terms of the Apache License, Version 2.0
  37102. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37103. /**
  37104. * @class SuperMap.WebPrintingJobLayoutOptions
  37105. * @classdesc Web 打印的布局参数类。
  37106. * @version 10.1.0
  37107. * @category iServer WebPrintingJob
  37108. * @param {Object} option - 初始化参数。
  37109. * @param {string} option.templateName - 布局模板的名称。
  37110. * @param {string} option.title - 地图主标题名称。
  37111. * @param {string} option.subTitle - 地图副标题名称。
  37112. * @param {string} option.author - 地图作者名称。
  37113. * @param {string} option.copyright - 地图版权信息。
  37114. * @param {SuperMap.WebPrintingJobLittleMapOptions} option.littleMapOptions - 小地图参数类。
  37115. * @param {SuperMap.WebPrintingJobLegendOptions} option.legendOptions - 图例参数类。
  37116. * @param {SuperMap.WebPrintingJobScaleBarOptions} [option.scaleBarOptions] - 地图比例尺参数类。
  37117. * @param {SuperMap.WebPrintingJobNorthArrowOptions} [option.northArrowOptions] - 地图指北针参数类。
  37118. */
  37119. var WebPrintingJobLayoutOptions = /*#__PURE__*/function () {
  37120. function WebPrintingJobLayoutOptions(option) {
  37121. WebPrintingJobLayoutOptions_classCallCheck(this, WebPrintingJobLayoutOptions);
  37122. /**
  37123. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.templateName
  37124. * @description 布局模板的名称。
  37125. */
  37126. this.templateName = null;
  37127. /**
  37128. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.title
  37129. * @description 地图主标题名称。
  37130. */
  37131. this.title = null;
  37132. /**
  37133. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.subTitle
  37134. * @description 地图副标题名称。
  37135. */
  37136. this.subTitle = null;
  37137. /**
  37138. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.author
  37139. * @description 地图作者名称。
  37140. */
  37141. this.author = null;
  37142. /**
  37143. * @member {string} SuperMap.WebPrintingJobLayoutOptions.prototype.copyright
  37144. * @description 地图版权信息。
  37145. */
  37146. this.copyright = null;
  37147. /**
  37148. * @member {SuperMap.WebPrintingJobScaleBarOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.scaleBarOptions]
  37149. * @description 地图比例尺参数类。
  37150. */
  37151. this.scaleBarOptions = null;
  37152. /**
  37153. * @member {SuperMap.WebPrintingJobNorthArrowOptions} [SuperMap.WebPrintingJobLayoutOptions.prototype.northArrowOptions]
  37154. * @description 地图指北针参数类。
  37155. */
  37156. this.northArrowOptions = null;
  37157. /**
  37158. * @member {SuperMap.WebPrintingJobLittleMapOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.littleMapOptions
  37159. * @description 小地图参数类。
  37160. */
  37161. this.littleMapOptions = null;
  37162. /**
  37163. * @member {SuperMap.WebPrintingJobLegendOptions} SuperMap.WebPrintingJobLayoutOptions.prototype.legendOptions
  37164. * @description 图例参数类。
  37165. */
  37166. this.legendOptions = null;
  37167. this.CLASS_NAME = 'SuperMap.WebPrintingJobLayoutOptions';
  37168. Util.extend(this, option);
  37169. }
  37170. /**
  37171. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.destroy
  37172. * @description 释放资源,将引用资源的属性置空。
  37173. */
  37174. WebPrintingJobLayoutOptions_createClass(WebPrintingJobLayoutOptions, [{
  37175. key: "destroy",
  37176. value: function destroy() {
  37177. this.templateName = null;
  37178. this.title = null;
  37179. this.subTitle = null;
  37180. this.author = null;
  37181. this.copyright = null;
  37182. if (this.scaleBarOptions instanceof WebPrintingJobScaleBarOptions) {
  37183. this.scaleBarOptions.destroy();
  37184. this.scaleBarOptions = null;
  37185. }
  37186. if (this.northArrowOptions instanceof WebPrintingJobNorthArrowOptions) {
  37187. this.northArrowOptions.destroy();
  37188. this.northArrowOptions = null;
  37189. }
  37190. if (this.littleMapOptions instanceof WebPrintingJobLittleMapOptions) {
  37191. this.littleMapOptions.destroy();
  37192. this.littleMapOptions = null;
  37193. }
  37194. if (this.legendOptions instanceof WebPrintingJobLegendOptions) {
  37195. this.legendOptions.destroy();
  37196. this.legendOptions = null;
  37197. }
  37198. }
  37199. /**
  37200. * @function SuperMap.WebPrintingJobLayoutOptions.prototype.toJSON
  37201. * @description 将 SuperMap.WebPrintingJobLayoutOptions 对象转化为 JSON 字符串。
  37202. * @returns {string} 返回转换后的 JSON 字符串。
  37203. */
  37204. }, {
  37205. key: "toJSON",
  37206. value: function toJSON() {
  37207. var params = {
  37208. templateName: this.templateName,
  37209. title: this.title,
  37210. subTitle: this.subTitle,
  37211. author: this.author,
  37212. copyright: this.copyright
  37213. };
  37214. if (this.scaleBarOptions) {
  37215. params.scaleBarOptions = this.scaleBarOptions;
  37216. }
  37217. if (this.northArrowOptions) {
  37218. params.northArrowOptions = this.northArrowOptions;
  37219. }
  37220. if (this.littleMapOptions) {
  37221. params.littleMapOptions = this.littleMapOptions;
  37222. }
  37223. if (this.legendOptions) {
  37224. params.legendOptions = this.legendOptions;
  37225. }
  37226. return Util.toJSON(params);
  37227. }
  37228. }]);
  37229. return WebPrintingJobLayoutOptions;
  37230. }();
  37231. SuperMap.WebPrintingJobLayoutOptions = WebPrintingJobLayoutOptions;
  37232. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobExportOptions.js
  37233. function WebPrintingJobExportOptions_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37234. 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); } }
  37235. function WebPrintingJobExportOptions_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobExportOptions_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobExportOptions_defineProperties(Constructor, staticProps); return Constructor; }
  37236. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37237. * This program are made available under the terms of the Apache License, Version 2.0
  37238. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37239. /**
  37240. * @class SuperMap.WebPrintingJobExportOptions
  37241. * @classdesc Web 打印的输出参数类。
  37242. * @version 10.1.0
  37243. * @category iServer WebPrintingJob
  37244. * @param {Object} option - 初始化参数。
  37245. * @param {SuperMap.WebExportFormatType} option.format - Web 打印输出的格式,目前支持:PNG、PDF。
  37246. * @param {number} [option.dpi=96] - Web 打印输出的分辨率,单位为每英寸点数。默认值为 96 dpi。
  37247. * @param {number} [option.scale] - Web 打印输出的地图比例尺。
  37248. * @param {number} [option.rotation] - Web 打印输出的地图角度。
  37249. * @param {SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point|mapboxgl.LngLat|mapboxgl.Point|Array.<number>} [option.center] - Web 打印输出的地图中心点。
  37250. */
  37251. var WebPrintingJobExportOptions = /*#__PURE__*/function () {
  37252. function WebPrintingJobExportOptions(option) {
  37253. WebPrintingJobExportOptions_classCallCheck(this, WebPrintingJobExportOptions);
  37254. /**
  37255. * @member {SuperMap.WebExportFormatType} SuperMap.WebPrintingJobExportOptions.prototype.format
  37256. * @description Web 打印输出的格式。
  37257. */
  37258. this.format = null;
  37259. /**
  37260. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.dpi=96]
  37261. * @description Web 打印输出的分辨率,单位为每英寸点数。
  37262. */
  37263. this.dpi = 96;
  37264. /**
  37265. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.scale]
  37266. * @description Web 打印输出的地图比例尺。
  37267. */
  37268. this.scale = null;
  37269. /**
  37270. * @member {number} [SuperMap.WebPrintingJobExportOptions.prototype.rotation]
  37271. * @description Web 打印输出的地图角度。
  37272. */
  37273. this.rotation = null;
  37274. /**
  37275. * @member {Array.<(SuperMap.Geometry.Point|L.Point|L.LatLng|ol.geom.Point)>} [SuperMap.WebPrintingJobExportOptions.prototype.center]
  37276. * @description Web 打印输出的地图中心点。
  37277. */
  37278. this.center = null;
  37279. this.CLASS_NAME = 'SuperMap.WebPrintingJobExportOptions';
  37280. Util.extend(this, option);
  37281. }
  37282. /**
  37283. * @function SuperMap.WebPrintingJobExportOptions.prototype.destroy
  37284. * @description 释放资源,将引用资源的属性置空。
  37285. */
  37286. WebPrintingJobExportOptions_createClass(WebPrintingJobExportOptions, [{
  37287. key: "destroy",
  37288. value: function destroy() {
  37289. this.format = null;
  37290. this.dpi = null;
  37291. this.scale = null;
  37292. this.rotation = null;
  37293. this.center = null;
  37294. this.outputSize = null;
  37295. }
  37296. /**
  37297. * @function SuperMap.WebPrintingJobExportOptions.prototype.toJSON
  37298. * @description 将 SuperMap.WebPrintingJobExportOptions 对象转化为 JSON 字符串。
  37299. * @returns {string} 返回转换后的 JSON 字符串。
  37300. */
  37301. }, {
  37302. key: "toJSON",
  37303. value: function toJSON() {
  37304. var params = {
  37305. format: this.format || "PDF",
  37306. dpi: this.dpi,
  37307. scale: this.scale,
  37308. center: this.center
  37309. };
  37310. if (this.rotation) {
  37311. params.rotation = this.rotation;
  37312. }
  37313. if (this.outputSize) {
  37314. params.outputSize = this.outputSize;
  37315. }
  37316. return Util.toJSON(params);
  37317. }
  37318. }]);
  37319. return WebPrintingJobExportOptions;
  37320. }();
  37321. SuperMap.WebPrintingJobExportOptions = WebPrintingJobExportOptions;
  37322. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingJobParameters.js
  37323. function WebPrintingJobParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37324. 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); } }
  37325. function WebPrintingJobParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobParameters_defineProperties(Constructor, staticProps); return Constructor; }
  37326. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37327. * This program are made available under the terms of the Apache License, Version 2.0
  37328. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37329. /**
  37330. * @class SuperMap.WebPrintingJobParameters
  37331. * @category iServer WebPrintingJob
  37332. * @version 10.1.0
  37333. * @classdesc Web 打印参数类
  37334. * @param {Object} options - 初始化参数。
  37335. * @param {SuperMap.WebPrintingJobContent} options.content - Web 打印的内容类。
  37336. * @param {SuperMap.WebPrintingJobLayoutOptions} options.layoutOptions - Web 打印的布局类,包含各种布局元素的设置。
  37337. * @param {SuperMap.WebPrintingJobExportOptions} options.exportOptions - Web 打印的输出类,包含 DPI、页面大小等。
  37338. */
  37339. var WebPrintingJobParameters = /*#__PURE__*/function () {
  37340. function WebPrintingJobParameters(options) {
  37341. WebPrintingJobParameters_classCallCheck(this, WebPrintingJobParameters);
  37342. if (!options) {
  37343. return;
  37344. }
  37345. /**
  37346. * @member {SuperMap.WebPrintingJobContent} SuperMap.WebPrintingJobParameters.prototype.content
  37347. * @description Web 打印的内容类。
  37348. */
  37349. this.content = null;
  37350. /**
  37351. * @member {SuperMap.WebPrintingJobLayoutOptions} SuperMap.WebPrintingJobParameters.prototype.layoutOptions
  37352. * @description Web 打印的布局类,包含各种布局元素的设置。
  37353. */
  37354. this.layoutOptions = null;
  37355. /**
  37356. * @member {SuperMap.WebPrintingJobExportOptions} SuperMap.WebPrintingJobParameters.prototype.exportOptions
  37357. * @description Web 打印的输出类,包含 DPI、页面大小等。
  37358. */
  37359. this.exportOptions = null;
  37360. Util.extend(this, options);
  37361. this.CLASS_NAME = 'SuperMap.WebPrintingJobParameters';
  37362. }
  37363. /**
  37364. * @function SuperMap.WebPrintingJobParameters.prototype.destroy
  37365. * @description 释放资源,将引用资源的属性置空。
  37366. */
  37367. WebPrintingJobParameters_createClass(WebPrintingJobParameters, [{
  37368. key: "destroy",
  37369. value: function destroy() {
  37370. if (this.content instanceof WebPrintingJobContent) {
  37371. this.content.destroy();
  37372. this.content = null;
  37373. }
  37374. if (this.layoutOptions instanceof WebPrintingJobLayoutOptions) {
  37375. this.layoutOptions.destroy();
  37376. this.layoutOptions = null;
  37377. }
  37378. if (this.exportOptions instanceof WebPrintingJobExportOptions) {
  37379. this.exportOptions.destroy();
  37380. this.exportOptions = null;
  37381. }
  37382. }
  37383. }]);
  37384. return WebPrintingJobParameters;
  37385. }();
  37386. SuperMap.WebPrintingJobParameters = WebPrintingJobParameters;
  37387. ;// CONCATENATED MODULE: ./src/common/iServer/WebPrintingService.js
  37388. function WebPrintingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebPrintingService_typeof = function _typeof(obj) { return typeof obj; }; } else { WebPrintingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebPrintingService_typeof(obj); }
  37389. function WebPrintingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37390. 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); } }
  37391. function WebPrintingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingService_defineProperties(Constructor, staticProps); return Constructor; }
  37392. function WebPrintingService_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { WebPrintingService_get = Reflect.get; } 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(receiver); } return desc.value; }; } return WebPrintingService_get(target, property, receiver || target); }
  37393. function WebPrintingService_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = WebPrintingService_getPrototypeOf(object); if (object === null) break; } return object; }
  37394. 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 } }); if (superClass) WebPrintingService_setPrototypeOf(subClass, superClass); }
  37395. function WebPrintingService_setPrototypeOf(o, p) { WebPrintingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingService_setPrototypeOf(o, p); }
  37396. 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); }; }
  37397. function WebPrintingService_possibleConstructorReturn(self, call) { if (call && (WebPrintingService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingService_assertThisInitialized(self); }
  37398. function WebPrintingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37399. function WebPrintingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37400. function WebPrintingService_getPrototypeOf(o) { WebPrintingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingService_getPrototypeOf(o); }
  37401. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37402. * This program are made available under the terms of the Apache License, Version 2.0
  37403. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37404. /**
  37405. * @class SuperMap.WebPrintingService
  37406. * @category iServer WebPrintingJob
  37407. * @version 10.1.0
  37408. * @classdesc 打印地图服务基类。
  37409. * @extends {SuperMap.CommonServiceBase}
  37410. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  37411. * @param {Object} options - 参数。
  37412. * @param {Object} options.eventListeners - 事件监听器对象。有processCompleted属性可传入处理完成后的回调函数。processFailed属性传入处理失败后的回调函数。
  37413. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37414. * @param {Object} [options.headers] - 请求头。
  37415. */
  37416. var WebPrintingService = /*#__PURE__*/function (_CommonServiceBase) {
  37417. WebPrintingService_inherits(WebPrintingService, _CommonServiceBase);
  37418. var _super = WebPrintingService_createSuper(WebPrintingService);
  37419. /**
  37420. * @function SuperMap.WebPrintingService.prototype.constructor
  37421. * @description 打印地图服务基类。
  37422. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  37423. * @param {Object} options -参数。
  37424. * @param {Object} options.eventListeners - 需要被注册的监听器对象。
  37425. */
  37426. function WebPrintingService(url, options) {
  37427. var _this;
  37428. WebPrintingService_classCallCheck(this, WebPrintingService);
  37429. _this = _super.call(this, url, options);
  37430. if (options) {
  37431. Util.extend(WebPrintingService_assertThisInitialized(_this), options);
  37432. }
  37433. _this.CLASS_NAME = 'SuperMap.WebPrintingService';
  37434. if (!_this.url) {
  37435. return WebPrintingService_possibleConstructorReturn(_this);
  37436. }
  37437. return _this;
  37438. }
  37439. /**
  37440. * @function SuperMap.WebPrintingService.prototype.destroy
  37441. * @description 释放资源,将引用资源的属性置空。
  37442. */
  37443. WebPrintingService_createClass(WebPrintingService, [{
  37444. key: "destroy",
  37445. value: function destroy() {
  37446. WebPrintingService_get(WebPrintingService_getPrototypeOf(WebPrintingService.prototype), "destroy", this).call(this);
  37447. }
  37448. /**
  37449. * @function SuperMap.WebPrintingService.prototype.createWebPrintingJob
  37450. * @description 创建 Web 打印任务。
  37451. * @param {SuperMap.WebPrintingJobParameters} params - Web 打印的请求参数。
  37452. */
  37453. }, {
  37454. key: "createWebPrintingJob",
  37455. value: function createWebPrintingJob(params) {
  37456. if (!params) {
  37457. return;
  37458. }
  37459. if (params.layoutOptions) {
  37460. if (params.layoutOptions.legendOptions) {
  37461. !params.layoutOptions.legendOptions.title && (params.layoutOptions.legendOptions.title = '');
  37462. params.layoutOptions.legendOptions.picAsBase64 = params.layoutOptions.legendOptions.picAsBase64 && params.layoutOptions.legendOptions.picAsBase64.replace(/^data:.+;base64,/, '');
  37463. if (params.layoutOptions.legendOptions.customItems && params.layoutOptions.legendOptions.customItems.hasOwnProperty('picAsBase64')) {
  37464. params.layoutOptions.legendOptions.customItems.picAsBase64 = params.layoutOptions.legendOptions.customItems.picAsBase64.replace(/^data:.+;base64,/, '');
  37465. }
  37466. }
  37467. }
  37468. var me = this;
  37469. me.request({
  37470. url: me._processUrl('jobs'),
  37471. method: 'POST',
  37472. data: Util.toJSON(params),
  37473. scope: me,
  37474. success: me.serviceProcessCompleted,
  37475. failure: me.serviceProcessFailed
  37476. });
  37477. }
  37478. /**
  37479. * @function SuperMap.WebPrintingService.prototype.getPrintingJob
  37480. * @description 获取 Web 打印输出文档任务。
  37481. * @param {String} jobId - Web 打印任务 ID
  37482. */
  37483. }, {
  37484. key: "getPrintingJob",
  37485. value: function getPrintingJob(jobId) {
  37486. var me = this;
  37487. var url = me._processUrl("jobs/".concat(jobId));
  37488. me.request({
  37489. url: url,
  37490. method: 'GET',
  37491. scope: me,
  37492. success: function success(result) {
  37493. me.rollingProcess(result, url);
  37494. },
  37495. failure: me.serviceProcessFailed
  37496. });
  37497. }
  37498. /**
  37499. * @function SuperMap.WebPrintingService.prototype.getPrintingJobResult
  37500. * @description 获取 Web 打印任务的输出文档。
  37501. * @param {String} jobId - Web 打印输入文档任务 ID。
  37502. */
  37503. }, {
  37504. key: "getPrintingJobResult",
  37505. value: function getPrintingJobResult(jobId) {
  37506. var me = this;
  37507. me.request({
  37508. url: me._processUrl("jobs/".concat(jobId, "/result")),
  37509. method: 'GET',
  37510. scope: me,
  37511. success: me.serviceProcessCompleted,
  37512. failure: me.serviceProcessFailed
  37513. });
  37514. }
  37515. /**
  37516. * @function SuperMap.WebPrintingService.prototype.getLayoutTemplates
  37517. * @description 查询 Web 打印服务所有可用的模板信息。
  37518. */
  37519. }, {
  37520. key: "getLayoutTemplates",
  37521. value: function getLayoutTemplates() {
  37522. var me = this;
  37523. me.request({
  37524. url: me._processUrl('layouts'),
  37525. method: 'GET',
  37526. scope: me,
  37527. success: me.serviceProcessCompleted,
  37528. failure: me.serviceProcessFailed
  37529. });
  37530. }
  37531. /**
  37532. * @function SuperMap.WebPrintingService.prototype.rollingProcess
  37533. * @description 轮询查询 Web 打印任务。
  37534. * @param {Object} result - 服务器返回的结果对象。
  37535. */
  37536. }, {
  37537. key: "rollingProcess",
  37538. value: function rollingProcess(result, url) {
  37539. var me = this;
  37540. if (!result) {
  37541. return;
  37542. }
  37543. var id = setInterval(function () {
  37544. me.request({
  37545. url: url,
  37546. method: 'GET',
  37547. scope: me,
  37548. success: function success(result) {
  37549. switch (result.status) {
  37550. case 'FINISHED':
  37551. clearInterval(id);
  37552. me.serviceProcessCompleted(result);
  37553. break;
  37554. case 'ERROR':
  37555. clearInterval(id);
  37556. me.serviceProcessFailed(result);
  37557. break;
  37558. case 'RUNNING':
  37559. me.events.triggerEvent('processRunning', result);
  37560. break;
  37561. }
  37562. },
  37563. failure: me.serviceProcessFailed
  37564. });
  37565. }, 1000);
  37566. }
  37567. }, {
  37568. key: "_processUrl",
  37569. value: function _processUrl(appendContent) {
  37570. if (appendContent) {
  37571. return Util.urlPathAppend(this.url, appendContent);
  37572. }
  37573. return this.url;
  37574. }
  37575. }]);
  37576. return WebPrintingService;
  37577. }(CommonServiceBase);
  37578. SuperMap.WebPrintingService = WebPrintingService;
  37579. ;// CONCATENATED MODULE: ./src/common/iServer/index.js
  37580. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37581. * This program are made available under the terms of the Apache License, Version 2.0
  37582. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37583. ;// CONCATENATED MODULE: ./src/common/online/OnlineResources.js
  37584. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37585. * This program are made available under the terms of the Apache License, Version 2.0
  37586. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37587. /**
  37588. * @enum ServiceStatus
  37589. * @memberOf SuperMap
  37590. * @category iPortal/Online
  37591. * @description 服务发布状态。
  37592. */
  37593. var ServiceStatus = SuperMap.ServiceStatus = {
  37594. /** 不涉及,不可发布。 */
  37595. DOES_NOT_INVOLVE: "DOES_NOT_INVOLVE",
  37596. /** 发布失败。 */
  37597. PUBLISH_FAILED: "PUBLISH_FAILED",
  37598. /** 已发布。 */
  37599. PUBLISHED: "PUBLISHED",
  37600. /** 正在发布。 */
  37601. PUBLISHING: "PUBLISHING",
  37602. /** 未发布。 */
  37603. UNPUBLISHED: "UNPUBLISHED",
  37604. /** 取消服务失败。 */
  37605. UNPUBLISHED_FAILED: "UNPUBLISHED_FAILED"
  37606. };
  37607. /**
  37608. *
  37609. * @enum DataItemType
  37610. * @memberOf SuperMap
  37611. * @category iPortal/Online
  37612. * @description 数据项类型。
  37613. */
  37614. var OnlineResources_DataItemType = SuperMap.DataItemType = {
  37615. /** AUDIO */
  37616. AUDIO: "AUDIO",
  37617. /** COLOR */
  37618. COLOR: "COLOR",
  37619. /** COLORSCHEME */
  37620. COLORSCHEME: "COLORSCHEME",
  37621. /** CSV */
  37622. CSV: "CSV",
  37623. /** EXCEL */
  37624. EXCEL: "EXCEL",
  37625. /** FILLSYMBOL */
  37626. FILLSYMBOL: "FILLSYMBOL",
  37627. /** IMAGE */
  37628. IMAGE: "IMAGE",
  37629. /** LAYERTEMPLATE */
  37630. LAYERTEMPLATE: "LAYERTEMPLATE",
  37631. /** LAYOUTTEMPLATE */
  37632. LAYOUTTEMPLATE: "LAYOUTTEMPLATE",
  37633. /** LINESYMBOL */
  37634. LINESYMBOL: "LINESYMBOL",
  37635. /** MAPTEMPLATE */
  37636. MAPTEMPLATE: "MAPTEMPLATE",
  37637. /** MARKERSYMBOL */
  37638. MARKERSYMBOL: "MARKERSYMBOL",
  37639. /** MBTILES */
  37640. MBTILES: "MBTILES",
  37641. /** PHOTOS */
  37642. PHOTOS: "PHOTOS",
  37643. /** SHP */
  37644. SHP: "SHP",
  37645. /** SMTILES */
  37646. SMTILES: "SMTILES",
  37647. /** SVTILES */
  37648. SVTILES: "SVTILES",
  37649. /** THEMETEMPLATE */
  37650. THEMETEMPLATE: "THEMETEMPLATE",
  37651. /** TPK */
  37652. TPK: "TPK",
  37653. /** UDB */
  37654. UDB: "UDB",
  37655. /** UGCV5 */
  37656. UGCV5: "UGCV5",
  37657. /** UNKNOWN */
  37658. UNKNOWN: "UNKNOWN",
  37659. /** VIDEO */
  37660. VIDEO: "VIDEO",
  37661. /** WORKENVIRONMENT */
  37662. WORKENVIRONMENT: "WORKENVIRONMENT",
  37663. /** WORKSPACE */
  37664. WORKSPACE: "WORKSPACE"
  37665. };
  37666. /**
  37667. * @enum DataItemOrderBy
  37668. * @memberOf SuperMap
  37669. * @category iPortal/Online
  37670. * @description 数据排序字段。
  37671. */
  37672. var DataItemOrderBy = SuperMap.DataItemOrderBy = {
  37673. /** FILENAME */
  37674. FILENAME: "FILENAME",
  37675. /** ID */
  37676. ID: "ID",
  37677. /** LASTMODIFIEDTIME */
  37678. LASTMODIFIEDTIME: "LASTMODIFIEDTIME",
  37679. /** NICKNAME */
  37680. NICKNAME: "NICKNAME",
  37681. /** SERVICESTATUS */
  37682. SERVICESTATUS: "SERVICESTATUS",
  37683. /** SIZE */
  37684. SIZE: "SIZE",
  37685. /** STATUS */
  37686. STATUS: "STATUS",
  37687. /** TYPE */
  37688. TYPE: "TYPE",
  37689. /** UPDATETIME */
  37690. UPDATETIME: "UPDATETIME",
  37691. /** USERNAME */
  37692. USERNAME: "USERNAME"
  37693. };
  37694. /**
  37695. * @enum FilterField
  37696. * @memberOf SuperMap
  37697. * @category iPortal/Online
  37698. * @description 关键字查询时的过滤字段。
  37699. */
  37700. var FilterField = SuperMap.FilterField = {
  37701. /** LINKPAGE */
  37702. LINKPAGE: "LINKPAGE",
  37703. /** LINKPAGE */
  37704. MAPTITLE: "MAPTITLE",
  37705. /** LINKPAGE */
  37706. NICKNAME: "NICKNAME",
  37707. /** LINKPAGE */
  37708. RESTITLE: "RESTITLE",
  37709. /** LINKPAGE */
  37710. USERNAME: "USERNAME"
  37711. };
  37712. ;// CONCATENATED MODULE: ./src/common/online/OnlineServiceBase.js
  37713. function OnlineServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37714. 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); } }
  37715. function OnlineServiceBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineServiceBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineServiceBase_defineProperties(Constructor, staticProps); return Constructor; }
  37716. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37717. * This program are made available under the terms of the Apache License, Version 2.0
  37718. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37719. // import {SecurityManager} from '../security/SecurityManager';
  37720. /**
  37721. * @class SuperMap.OnlineServiceBase
  37722. * @classdesc Online 服务基类(使用 key 作为权限限制的类需要实现此类)。
  37723. * @category iPortal/Online
  37724. * @param {Object} options - 服务参数。
  37725. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37726. * @param {Object} [options.headers] - 请求头。
  37727. */
  37728. var OnlineServiceBase = /*#__PURE__*/function () {
  37729. function OnlineServiceBase(options) {
  37730. OnlineServiceBase_classCallCheck(this, OnlineServiceBase);
  37731. options = options || {};
  37732. Util.extend(this, options);
  37733. this.serverType = ServerType.ONLINE;
  37734. this.CLASS_NAME = "SuperMap.OnlineServiceBase";
  37735. }
  37736. /**
  37737. * @function SuperMap.OnlineServiceBase.prototype.request
  37738. * @description 请求 online 服务
  37739. * @param {string} [method='GET'] - 请求方式, 'GET', 'PUT', 'POST', 'DELETE'。
  37740. * @param {string} url - 服务地址。
  37741. * @param {Object} param - URL 查询参数。
  37742. * @param {Object} [requestOptions] - http 请求参数, 比如请求头,超时时间等。
  37743. * @returns {Promise} 返回包含请求结果的 Promise 对象。
  37744. */
  37745. OnlineServiceBase_createClass(OnlineServiceBase, [{
  37746. key: "request",
  37747. value: function request(method, url, param) {
  37748. var requestOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  37749. url = this.createCredentialUrl(url);
  37750. requestOptions['crossOrigin'] = this.options.crossOrigin;
  37751. requestOptions['headers'] = this.options.headers;
  37752. return FetchRequest.commit(method, url, param, requestOptions).then(function (response) {
  37753. return response.json();
  37754. });
  37755. }
  37756. /**
  37757. * @function SuperMap.OnlineServiceBase.prototype.createCredentialUrl
  37758. * @description 追加授权信息。
  37759. * @param {string} url - 对接的 online 服务地址。
  37760. */
  37761. }, {
  37762. key: "createCredentialUrl",
  37763. value: function createCredentialUrl(url) {
  37764. var newUrl = url,
  37765. key = this.getCredential();
  37766. if (key) {
  37767. var paramStr = "key=" + key;
  37768. var endStr = newUrl.substring(newUrl.length - 1, newUrl.length);
  37769. if (newUrl.indexOf("?") > -1 && endStr === "?") {
  37770. newUrl += paramStr;
  37771. } else if (newUrl.indexOf("?") > -1 && endStr !== "?") {
  37772. newUrl += "&" + paramStr;
  37773. } else {
  37774. newUrl += "?" + paramStr;
  37775. }
  37776. }
  37777. return newUrl;
  37778. } //其子类需要重写该方法,修改其中获取key的字段
  37779. //存储key可能是服务id字段,可能是url,或者是WebAPI类型
  37780. }, {
  37781. key: "getCredential",
  37782. value: function getCredential() {//return SecurityManager.getKey(this.id);
  37783. //或
  37784. //return SecurityManager.getKey(this.serviceUrl);
  37785. }
  37786. }]);
  37787. return OnlineServiceBase;
  37788. }();
  37789. SuperMap.OnlineServiceBase = OnlineServiceBase;
  37790. ;// CONCATENATED MODULE: ./src/common/online/OnlineData.js
  37791. function OnlineData_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { OnlineData_typeof = function _typeof(obj) { return typeof obj; }; } else { OnlineData_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return OnlineData_typeof(obj); }
  37792. function OnlineData_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37793. 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); } }
  37794. function OnlineData_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineData_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineData_defineProperties(Constructor, staticProps); return Constructor; }
  37795. 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 } }); if (superClass) OnlineData_setPrototypeOf(subClass, superClass); }
  37796. function OnlineData_setPrototypeOf(o, p) { OnlineData_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return OnlineData_setPrototypeOf(o, p); }
  37797. 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); }; }
  37798. function OnlineData_possibleConstructorReturn(self, call) { if (call && (OnlineData_typeof(call) === "object" || typeof call === "function")) { return call; } return OnlineData_assertThisInitialized(self); }
  37799. function OnlineData_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  37800. function OnlineData_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  37801. function OnlineData_getPrototypeOf(o) { OnlineData_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return OnlineData_getPrototypeOf(o); }
  37802. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37803. * This program are made available under the terms of the Apache License, Version 2.0
  37804. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37805. /**
  37806. * @class SuperMap.OnlineData
  37807. * @classdesc Online myData 服务。
  37808. * @category iPortal/Online
  37809. * @param {string} serviceRootUrl - 服务根地址。
  37810. * @param {Object} options - 服务相关参数。
  37811. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  37812. * @param {Object} [options.headers] - 请求头。
  37813. */
  37814. var OnlineData = /*#__PURE__*/function (_OnlineServiceBase) {
  37815. OnlineData_inherits(OnlineData, _OnlineServiceBase);
  37816. var _super = OnlineData_createSuper(OnlineData);
  37817. //TODO 目前并没有对接服务支持的所有操作,日后需要补充完整
  37818. function OnlineData(serviceRootUrl, options) {
  37819. var _this;
  37820. OnlineData_classCallCheck(this, OnlineData);
  37821. _this = _super.call(this, serviceRootUrl);
  37822. options = options || {}; //MD5
  37823. _this.MD5 = null; //文件类型。
  37824. _this.type = null; //数据上传者名称。
  37825. _this.userName = null; //文件名称。
  37826. _this.fileName = null; //文件大小,单位为 B 。
  37827. _this.size = null; //服务发布状态。
  37828. _this.serviceStatus = null; //服务 id 。
  37829. _this.serviceId = null; //数据项 id 。
  37830. _this.id = null; //最后修改时间。
  37831. _this.lastModfiedTime = null; //文件状态。
  37832. _this.status = null; //数据文件存储 id 。
  37833. _this.storageId = null; //数据的发布信息。
  37834. _this.publishInfo = null; //数据的权限信息。
  37835. _this.authorizeSetting = null; //用户的昵称。
  37836. _this.nickname = null; //数据的标签。
  37837. _this.tags = []; //数据的描述信息。
  37838. _this.description = null; //数据发布的服务信息集合。
  37839. _this.dataItemServices = null; //数据坐标类型。
  37840. _this.coordType = null; //数据审核信息
  37841. _this.dataCheckResult = null; //数据元数据信息
  37842. _this.dataMetaInfo = null; //数据的缩略图路径。
  37843. _this.thumbnail = null;
  37844. Util.extend(OnlineData_assertThisInitialized(_this), options);
  37845. if (_this.id) {
  37846. _this.serviceUrl = serviceRootUrl + "/" + _this.id;
  37847. }
  37848. _this.CLASS_NAME = "SuperMap.OnlineData";
  37849. return _this;
  37850. }
  37851. /**
  37852. * @function SuperMap.OnlineData.prototype.load
  37853. * @description 通过 URL 请求获取该服务完整信息。
  37854. * @returns {Promise} 返回不包含请求结果的 Promise 对象,请求返回结果自动填充到该类属性中。
  37855. */
  37856. OnlineData_createClass(OnlineData, [{
  37857. key: "load",
  37858. value: function load() {
  37859. if (!this.serviceUrl) {
  37860. return;
  37861. }
  37862. var me = this;
  37863. return me.request("GET", this.serviceUrl).then(function (result) {
  37864. Util.extend(me, result);
  37865. });
  37866. }
  37867. /**
  37868. * @function SuperMap.OnlineData.prototype.getPublishedServices
  37869. * @description 获取数据发布的所有服务。
  37870. * @returns {Object} 数据发布的所有服务。
  37871. */
  37872. }, {
  37873. key: "getPublishedServices",
  37874. value: function getPublishedServices() {
  37875. return this.dataItemServices;
  37876. }
  37877. /**
  37878. * @function SuperMap.OnlineData.prototype.getAuthorizeSetting
  37879. * @description 获取数据的权限信息。
  37880. * @returns {Object} 权限信息。
  37881. */
  37882. }, {
  37883. key: "getAuthorizeSetting",
  37884. value: function getAuthorizeSetting() {
  37885. return this.authorizeSetting;
  37886. }
  37887. }]);
  37888. return OnlineData;
  37889. }(OnlineServiceBase);
  37890. SuperMap.OnlineData = OnlineData;
  37891. ;// CONCATENATED MODULE: ./src/common/online/Online.js
  37892. function Online_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37893. 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); } }
  37894. function Online_createClass(Constructor, protoProps, staticProps) { if (protoProps) Online_defineProperties(Constructor.prototype, protoProps); if (staticProps) Online_defineProperties(Constructor, staticProps); return Constructor; }
  37895. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37896. * This program are made available under the terms of the Apache License, Version 2.0
  37897. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37898. /**
  37899. * @class SuperMap.Online
  37900. * @classdesc 对接 SuperMap Online 所有基础服务。
  37901. * @category iPortal/Online
  37902. * @example
  37903. * var online=new SuperMap.Online();
  37904. * var services = online.queryDatas(param);
  37905. * service.then(function(services){
  37906. * var service= services[0];
  37907. * service.updateDataInfo();
  37908. * })
  37909. */
  37910. var Online = /*#__PURE__*/function () {
  37911. //TODO 目前并没有对接Online的所有操作,需要补充完整
  37912. //所有查询返回的是一个Promise,在外部使用的时候通过Promise的then方法获取异步结果
  37913. function Online() {
  37914. Online_classCallCheck(this, Online);
  37915. this.rootUrl = "https://www.supermapol.com";
  37916. this.webUrl = this.rootUrl + "/web";
  37917. var mContentUrl = this.webUrl + "/mycontent";
  37918. this.mDatasUrl = mContentUrl + "/datas";
  37919. this.CLASS_NAME = "SuperMap.Online";
  37920. }
  37921. /**
  37922. * @function SuperMap.Online.prototype.load
  37923. * @description 加载 online,验证 online 是否可用。
  37924. * @returns {Promise} 返回包含网络请求结果的 Promise 对象。
  37925. */
  37926. Online_createClass(Online, [{
  37927. key: "load",
  37928. value: function load() {
  37929. return FetchRequest.get(this.rootUrl).then(function (response) {
  37930. return response;
  37931. });
  37932. }
  37933. /**
  37934. * @function SuperMap.Online.prototype.login
  37935. * @description 登录Online
  37936. */
  37937. }, {
  37938. key: "login",
  37939. value: function login() {
  37940. SecurityManager.loginOnline(this.rootUrl, true);
  37941. }
  37942. /**
  37943. * @function SuperMap.Online.prototype.queryDatas
  37944. * @description 查询 Online “我的内容” 下 “我的数据” 服务(需要登录状态获取),并返回可操作的服务对象。
  37945. * @param {SuperMap.OnlineQueryDatasParameter} parameter - myDatas 服务资源查询参数。
  37946. * @returns {Promise} 返回包含所有数据服务信息的 Promise 对象。
  37947. */
  37948. }, {
  37949. key: "queryDatas",
  37950. value: function queryDatas(parameter) {
  37951. var me = this,
  37952. url = me.mDatasUrl;
  37953. if (parameter) {
  37954. parameter = parameter.toJSON();
  37955. }
  37956. return FetchRequest.get(url, parameter).then(function (json) {
  37957. if (!json || !json.content || json.content.length < 1) {
  37958. return;
  37959. }
  37960. var services = [],
  37961. contents = json.content,
  37962. len = contents.length;
  37963. for (var i = 0; i < len; i++) {
  37964. var content = contents[i];
  37965. var service = new OnlineData(me.mDatasUrl, content);
  37966. services.push(service);
  37967. }
  37968. return services;
  37969. });
  37970. }
  37971. }]);
  37972. return Online;
  37973. }();
  37974. SuperMap.Online = Online;
  37975. ;// CONCATENATED MODULE: ./src/common/online/OnlineQueryDatasParameter.js
  37976. function OnlineQueryDatasParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  37977. 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); } }
  37978. function OnlineQueryDatasParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) OnlineQueryDatasParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) OnlineQueryDatasParameter_defineProperties(Constructor, staticProps); return Constructor; }
  37979. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  37980. * This program are made available under the terms of the Apache License, Version 2.0
  37981. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  37982. /**
  37983. * @class SuperMap.OnlineQueryDatasParameter
  37984. * @classdesc myDatas 服务资源查询参数。
  37985. * @category iPortal/Online
  37986. * @param {Object} options - 查询参数。
  37987. */
  37988. var OnlineQueryDatasParameter = /*#__PURE__*/function () {
  37989. function OnlineQueryDatasParameter(options) {
  37990. OnlineQueryDatasParameter_classCallCheck(this, OnlineQueryDatasParameter);
  37991. options = options || {};
  37992. /**
  37993. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.userNames
  37994. * @description 数据作者名。可以根据数据作者名查询,默认查询全部。
  37995. */
  37996. this.userNames = null;
  37997. /**
  37998. * @member {Array.<Object>} SuperMap.OnlineQueryDatasParameter.prototype.types
  37999. * @description 数据类型。
  38000. */
  38001. this.types = null;
  38002. /**
  38003. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.fileName
  38004. * @description 文件名称。
  38005. */
  38006. this.fileName = null;
  38007. /**
  38008. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceStatuses
  38009. * @description 服务发布状态。
  38010. */
  38011. this.serviceStatuses = null;
  38012. /**
  38013. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.serviceId
  38014. * @description 服务 ID。
  38015. */
  38016. this.serviceId = null;
  38017. /**
  38018. * @member {Array.<integer>} SuperMap.OnlineQueryDatasParameter.prototype.ids
  38019. * @description 由数据项 ID 组成的整型数组。
  38020. */
  38021. this.ids = null;
  38022. /**
  38023. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.keywords
  38024. * @description 关键字。
  38025. */
  38026. this.keywords = null;
  38027. /**
  38028. * @member {string} SuperMap.OnlineQueryDatasParameter.prototype.orderBy
  38029. * @description 排序字段。
  38030. */
  38031. this.orderBy = null;
  38032. /**
  38033. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.tags
  38034. * @description 数据的标签。
  38035. */
  38036. this.tags = null;
  38037. /**
  38038. * @member {Array.<string>} SuperMap.OnlineQueryDatasParameter.prototype.filterFields
  38039. * @description 用于关键字查询时的过滤字段。
  38040. */
  38041. this.filterFields = null;
  38042. Util.extend(this, options);
  38043. this.CLASS_NAME = "SuperMap.OnlineQueryDatasParameter";
  38044. }
  38045. /**
  38046. * @function SuperMap.OnlineQueryDatasParameter.prototype.toJSON
  38047. * @description 返回对应的 JSON 对象。
  38048. * @returns {Object} 对应的 JSON 对象。
  38049. */
  38050. OnlineQueryDatasParameter_createClass(OnlineQueryDatasParameter, [{
  38051. key: "toJSON",
  38052. value: function toJSON() {
  38053. var me = this;
  38054. var jsonObj = {
  38055. "types": me.types,
  38056. "fileName": me.fileName,
  38057. "serviceStatuses": me.serviceStatuses,
  38058. "serviceId": me.serviceId,
  38059. "ids": me.ids,
  38060. "keywords": me.keywords,
  38061. "orderBy": me.orderBy,
  38062. "tags": me.tags,
  38063. "filterFields": me.filterFields
  38064. };
  38065. for (var key in jsonObj) {
  38066. if (jsonObj[key] == null) {
  38067. delete jsonObj[key];
  38068. }
  38069. }
  38070. return jsonObj;
  38071. }
  38072. }]);
  38073. return OnlineQueryDatasParameter;
  38074. }();
  38075. SuperMap.OnlineQueryDatasParameter = OnlineQueryDatasParameter;
  38076. ;// CONCATENATED MODULE: ./src/common/online/index.js
  38077. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38078. * This program are made available under the terms of the Apache License, Version 2.0
  38079. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38080. ;// CONCATENATED MODULE: ./src/common/security/KeyServiceParameter.js
  38081. function KeyServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38082. 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); } }
  38083. function KeyServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) KeyServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) KeyServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38084. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38085. * This program are made available under the terms of the Apache License, Version 2.0
  38086. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38087. /**
  38088. * @class SuperMap.KeyServiceParameter
  38089. * @classdesc key申请参数
  38090. * @category Security
  38091. * @param {Object} options - 参数。
  38092. * @param {string} options.name - 申请服务名称。
  38093. * @param {number} options.serviceIds - 服务 ID。
  38094. * @param {SuperMap.ClientType} [options.clientType=SuperMap.ClientType.SERVER] - 服务端类型。
  38095. * @param {number} options.limitation - 有效期
  38096. */
  38097. var KeyServiceParameter = /*#__PURE__*/function () {
  38098. function KeyServiceParameter(options) {
  38099. KeyServiceParameter_classCallCheck(this, KeyServiceParameter);
  38100. this.name = null;
  38101. this.serviceIds = null;
  38102. this.clientType = ClientType.SERVER;
  38103. this.limitation = null;
  38104. Util.extend(this, options);
  38105. this.CLASS_NAME = "SuperMap.KeyServiceParameter";
  38106. }
  38107. /**
  38108. * @function SuperMap.KeyServiceParameter.prototype.toJSON
  38109. * @description 转换成 JSON 对象
  38110. * @returns {Object} 参数的 JSON 对象
  38111. */
  38112. KeyServiceParameter_createClass(KeyServiceParameter, [{
  38113. key: "toJSON",
  38114. value: function toJSON() {
  38115. return {
  38116. name: this.name,
  38117. serviceIds: this.serviceIds,
  38118. clientType: this.clientType,
  38119. limitation: this.limitation
  38120. };
  38121. }
  38122. }]);
  38123. return KeyServiceParameter;
  38124. }();
  38125. SuperMap.KeyServiceParameter = KeyServiceParameter;
  38126. ;// CONCATENATED MODULE: ./src/common/security/ServerInfo.js
  38127. function ServerInfo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38128. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38129. * This program are made available under the terms of the Apache License, Version 2.0
  38130. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38131. /**
  38132. * @class SuperMap.ServerInfo
  38133. * @classdesc 服务器信息(安全相关),包含服务器类型,服务地址,token服务地址等
  38134. * @category Security
  38135. * @param {string} type - 服务器类型
  38136. * @param {Object} options - 服务器信息相关可选参数。
  38137. * @param {string} options.server - 服务器地址,如:http://supermapiserver:8090/iserver
  38138. * @param {string} [options.tokenServiceUrl] - 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  38139. * @param {string} [options.keyServiceUrl] - 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  38140. */
  38141. var ServerInfo = function ServerInfo(type, options) {
  38142. ServerInfo_classCallCheck(this, ServerInfo);
  38143. /**
  38144. * @member {SuperMap.ServerType} SuperMap.ServerInfo.prototype.type
  38145. * @description 服务器类型
  38146. */
  38147. this.type = type;
  38148. /**
  38149. * @member {string} SuperMap.ServerInfo.prototype.server
  38150. * @description 服务器地址
  38151. */
  38152. this.server = null;
  38153. /**
  38154. * @member {string} [SuperMap.ServerInfo.prototype.tokenServiceUrl]
  38155. * @description 如:http://supermapiserver:8090/iserver/services/security/tokens.json
  38156. */
  38157. this.tokenServiceUrl = null;
  38158. /**
  38159. * @member {string} [SuperMap.ServerInfo.prototype.keyServiceUrl]
  38160. * @description 如:http://supermapiserver:8092/web/mycontent/keys/register.json
  38161. */
  38162. this.keyServiceUrl = null;
  38163. Util.extend(this, options);
  38164. this.CLASS_NAME = "SuperMap.ServerInfo";
  38165. this.type = this.type || ServerType.ISERVER;
  38166. if (!this.server) {
  38167. console.error('server url require is not undefined');
  38168. } // var patten = /http:\/\/([^\/]+)/i;
  38169. //this.server = this.server.match(patten)[0];
  38170. var tokenServiceSuffix = "/services/security/tokens";
  38171. if (this.type === ServerType.ISERVER && this.server.indexOf("iserver") < 0) {
  38172. tokenServiceSuffix = "/iserver" + tokenServiceSuffix;
  38173. }
  38174. if (!this.tokenServiceUrl) {
  38175. this.tokenServiceUrl = Util.urlPathAppend(this.server, tokenServiceSuffix);
  38176. }
  38177. if (!this.keyServiceUrl) {
  38178. if (this.type === ServerType.IPORTAL) {
  38179. this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys/register");
  38180. } else if (this.type === ServerType.ONLINE) {
  38181. this.keyServiceUrl = Util.urlPathAppend(this.server, "/web/mycontent/keys");
  38182. }
  38183. }
  38184. };
  38185. SuperMap.ServerInfo = ServerInfo;
  38186. ;// CONCATENATED MODULE: ./src/common/security/TokenServiceParameter.js
  38187. function TokenServiceParameter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38188. 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); } }
  38189. function TokenServiceParameter_createClass(Constructor, protoProps, staticProps) { if (protoProps) TokenServiceParameter_defineProperties(Constructor.prototype, protoProps); if (staticProps) TokenServiceParameter_defineProperties(Constructor, staticProps); return Constructor; }
  38190. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38191. * This program are made available under the terms of the Apache License, Version 2.0
  38192. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38193. /**
  38194. * @class SuperMap.TokenServiceParameter
  38195. * @classdesc token 申请参数。
  38196. * @category Security
  38197. * @param {Object} options - token 申请参数。
  38198. * @param {string} options.username - 用户名。
  38199. * @param {string} options.password - 密码。
  38200. * @param {SuperMap.ClientType} [options.clientType='SuperMap.ClientType.NONE'] - token 申请的客户端标识类型。
  38201. * @param {string} [options.ip] - clientType=IP 时,必选。
  38202. * @param {string} [options.referer] -clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  38203. * @param {number} [options.expiration=60] - 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  38204. *
  38205. *
  38206. */
  38207. var TokenServiceParameter = /*#__PURE__*/function () {
  38208. function TokenServiceParameter(options) {
  38209. TokenServiceParameter_classCallCheck(this, TokenServiceParameter);
  38210. /**
  38211. * @member {string} SuperMap.TokenServiceParameter.prototype.userName
  38212. * @description 用户名。
  38213. */
  38214. this.userName = null;
  38215. /**
  38216. * @member {string} SuperMap.TokenServiceParameter.prototype.password
  38217. * @description 密码。
  38218. */
  38219. this.password = null;
  38220. /**
  38221. * @member {SuperMap.ClientType} SuperMap.TokenServiceParameter.prototype.clientType
  38222. * @description token 申请的客户端标识类型。
  38223. */
  38224. this.clientType = ClientType.NONE;
  38225. /**
  38226. * @member {string} [SuperMap.TokenServiceParameter.prototype.ip]
  38227. * @description clientType=IP 时,必选。
  38228. */
  38229. this.ip = null;
  38230. /**
  38231. * @member {string} [SuperMap.TokenServiceParameter.prototype.referer]
  38232. * @description clientType=Referer 时,必选。如果按照指定 URL 的方式申请令牌,则设置相应的 URL。
  38233. */
  38234. this.referer = null;
  38235. /**
  38236. * @member {number} SuperMap.TokenServiceParameter.prototype.expiration
  38237. * @description 申请令牌的有效期,从发布令牌的时间开始计算,单位为分钟。
  38238. */
  38239. this.expiration = 60;
  38240. Util.extend(this, options);
  38241. this.CLASS_NAME = "SuperMap.TokenServiceParameter";
  38242. }
  38243. /**
  38244. * @function SuperMap.TokenServiceParameter.prototype.toJSON
  38245. * @description 将所有信息转成 JSON 字符串
  38246. * @returns {string} 参数的 JSON 字符串
  38247. */
  38248. TokenServiceParameter_createClass(TokenServiceParameter, [{
  38249. key: "toJSON",
  38250. value: function toJSON() {
  38251. return {
  38252. userName: this.userName,
  38253. password: this.password,
  38254. clientType: this.clientType,
  38255. ip: this.ip,
  38256. referer: this.referer,
  38257. expiration: this.expiration
  38258. };
  38259. }
  38260. }]);
  38261. return TokenServiceParameter;
  38262. }();
  38263. SuperMap.TokenServiceParameter = TokenServiceParameter;
  38264. ;// CONCATENATED MODULE: ./src/common/security/index.js
  38265. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38266. * This program are made available under the terms of the Apache License, Version 2.0
  38267. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38268. ;// CONCATENATED MODULE: external "function(){try{return elasticsearch}catch(e){return {}}}()"
  38269. var external_function_try_return_elasticsearch_catch_e_return_namespaceObject = function(){try{return elasticsearch}catch(e){return {}}}();
  38270. var external_function_try_return_elasticsearch_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_elasticsearch_catch_e_return_namespaceObject);
  38271. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/ElasticSearch.js
  38272. function ElasticSearch_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38273. 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); } }
  38274. function ElasticSearch_createClass(Constructor, protoProps, staticProps) { if (protoProps) ElasticSearch_defineProperties(Constructor.prototype, protoProps); if (staticProps) ElasticSearch_defineProperties(Constructor, staticProps); return Constructor; }
  38275. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38276. * This program are made available under the terms of the Apache License, Version 2.0
  38277. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38278. /**
  38279. * @class SuperMap.ElasticSearch
  38280. * @classdesc ElasticSearch服务类。
  38281. * @category ElasticSearch
  38282. * @param {string} url - ElasticSearch服务地址。
  38283. * @param {Object} options - 参数。
  38284. * @param {function} [options.change] - 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  38285. * @param {boolean} [options.openGeoFence=false] - 是否开启地理围栏验证,默认为不开启。
  38286. * @param {function} [options.outOfGeoFence] - 数据超出地理围栏后执行的函数。
  38287. * @param {Object} [options.geoFence] - 地理围栏。
  38288. */
  38289. var ElasticSearch = /*#__PURE__*/function () {
  38290. function ElasticSearch(url, options) {
  38291. ElasticSearch_classCallCheck(this, ElasticSearch);
  38292. options = options || {};
  38293. /**
  38294. * @member {string} SuperMap.ElasticSearch.prototype.url
  38295. * @description ElasticSearch服务地址
  38296. */
  38297. this.url = url;
  38298. /**
  38299. * @member {Object} SuperMap.ElasticSearch.prototype.client
  38300. * @description client ES客户端
  38301. */
  38302. this.client = new (external_function_try_return_elasticsearch_catch_e_return_default()).Client({
  38303. host: this.url
  38304. });
  38305. /**
  38306. * @deprecated
  38307. * @member {function} [SuperMap.ElasticSearch.prototype.change]
  38308. * @description 服务器返回数据后执行的函数。废弃,不建议使用。使用search或msearch方法。
  38309. */
  38310. this.change = null;
  38311. /**
  38312. * @member {boolean} [SuperMap.ElasticSearch.prototype.openGeoFence=false]
  38313. * @description 是否开启地理围栏验证,默认为不开启。
  38314. */
  38315. this.openGeoFence = false;
  38316. /**
  38317. * @member {function} [SuperMap.ElasticSearch.prototype.outOfGeoFence]
  38318. * @description 数据超出地理围栏后执行的函数
  38319. */
  38320. this.outOfGeoFence = null;
  38321. /**
  38322. * @member {Object} [SuperMap.ElasticSearch.prototype.geoFence]
  38323. * @description 地理围栏
  38324. * @example {
  38325. * radius: 1000,//单位是m
  38326. * center: [104.40, 30.43],
  38327. * unit: 'meter|degree'
  38328. * }
  38329. */
  38330. this.geoFence = null;
  38331. /*
  38332. * Constant: EVENT_TYPES
  38333. * {Array.<String>}
  38334. * 此类支持的事件类型。
  38335. *
  38336. */
  38337. this.EVENT_TYPES = ['change', 'error', 'outOfGeoFence'];
  38338. /**
  38339. * @member {SuperMap.Events} SuperMap.ElasticSearch.prototype.events
  38340. * @description 事件
  38341. */
  38342. this.events = new Events(this, null, this.EVENT_TYPES);
  38343. /**
  38344. * @member {Object} SuperMap.ElasticSearch.prototype.eventListeners
  38345. * @description 听器对象,在构造函数中设置此参数(可选),对 MapService 支持的两个事件 processCompleted 、processFailed 进行监听,
  38346. * 相当于调用 SuperMap.Events.on(eventListeners)。
  38347. */
  38348. this.eventListeners = null;
  38349. Util.extend(this, options);
  38350. if (this.eventListeners instanceof Object) {
  38351. this.events.on(this.eventListeners);
  38352. }
  38353. }
  38354. /**
  38355. * @function SuperMap.ElasticSearch.prototype.setGeoFence
  38356. * @description 设置地理围栏,openGeoFence参数为true的时候,设置的地理围栏才生效。
  38357. * @param {SuperMap.Geometry} geoFence - 地理围栏。
  38358. */
  38359. ElasticSearch_createClass(ElasticSearch, [{
  38360. key: "setGeoFence",
  38361. value: function setGeoFence(geoFence) {
  38362. this.geoFence = geoFence;
  38363. }
  38364. /**
  38365. * @function SuperMap.ElasticSearch.prototype.bulk
  38366. * @description 批量操作API,允许执行多个索引/删除操作。
  38367. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-bulk}</br>
  38368. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html}</br>
  38369. * @param {Object} params - 参数。
  38370. * @param {function} callback - 回调函数。
  38371. */
  38372. }, {
  38373. key: "bulk",
  38374. value: function bulk(params, callback) {
  38375. return this.client.bulk(params, callback);
  38376. }
  38377. /**
  38378. * @function SuperMap.ElasticSearch.prototype.clearScroll
  38379. * @description 通过指定scroll参数进行查询来清除已经创建的scroll请求。
  38380. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-clearscroll}</br>
  38381. *更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  38382. * @param {Object} params - 参数。
  38383. * @param {function} callback - 回调函数。
  38384. */
  38385. }, {
  38386. key: "clearScroll",
  38387. value: function clearScroll(params, callback) {
  38388. return this.client.clearScroll(params, callback);
  38389. }
  38390. /**
  38391. * @function SuperMap.ElasticSearch.prototype.count
  38392. * @description 获取集群、索引、类型或查询的文档个数。
  38393. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-count}</br>
  38394. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html}</br>
  38395. * @param {Object} params - 参数。
  38396. * @param {function} callback - 回调函数。
  38397. */
  38398. }, {
  38399. key: "count",
  38400. value: function count(params, callback) {
  38401. return this.client.count(params, callback);
  38402. }
  38403. /**
  38404. * @function SuperMap.ElasticSearch.prototype.count
  38405. * @description 在特定索引中添加一个类型化的JSON文档,使其可搜索。如果具有相同index,type且id已经存在的文档将发生错误。</br>
  38406. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-create}
  38407. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}
  38408. * @param {Object} params - 参数。
  38409. * @param {function} callback - 回调函数。
  38410. */
  38411. }, {
  38412. key: "create",
  38413. value: function create(params, callback) {
  38414. return this.client.create(params, callback);
  38415. }
  38416. /**
  38417. * @function SuperMap.ElasticSearch.prototype.delete
  38418. * @description 根据其ID从特定索引中删除键入的JSON文档。
  38419. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-delete}</br>
  38420. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html}</br>
  38421. * @param {Object} params - 参数。
  38422. * @param {function} callback - 回调函数。
  38423. */
  38424. }, {
  38425. key: "delete",
  38426. value: function _delete(params, callback) {
  38427. return this.client["delete"](params, callback);
  38428. }
  38429. /**
  38430. * @function SuperMap.ElasticSearch.prototype.delete
  38431. * @description 根据其ID从特定索引中删除键入的JSON文档。
  38432. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletebyquery}</br>
  38433. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html}</br>
  38434. * @param {Object} params - 参数。
  38435. * @param {function} callback - 回调函数。
  38436. */
  38437. }, {
  38438. key: "deleteByQuery",
  38439. value: function deleteByQuery(params, callback) {
  38440. return this.client.deleteByQuery(params, callback);
  38441. }
  38442. /**
  38443. * @function SuperMap.ElasticSearch.prototype.delete
  38444. * @description 根据其ID删除脚本。</br>
  38445. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletescript}</br>
  38446. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  38447. * @param {Object} params - 参数。
  38448. * @param {function} callback - 回调函数。
  38449. */
  38450. }, {
  38451. key: "deleteScript",
  38452. value: function deleteScript(params, callback) {
  38453. return this.client.deleteScript(params, callback);
  38454. }
  38455. /**
  38456. * @function SuperMap.ElasticSearch.prototype.deleteTemplate
  38457. * @description 根据其ID删除模板。</br>
  38458. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-deletetemplate}</br>
  38459. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  38460. * @param {Object} params - 参数。
  38461. * @param {function} callback - 回调函数。
  38462. */
  38463. }, {
  38464. key: "deleteTemplate",
  38465. value: function deleteTemplate(params, callback) {
  38466. return this.client.deleteTemplate(params, callback);
  38467. }
  38468. /**
  38469. * @function SuperMap.ElasticSearch.prototype.exists
  38470. * @description 检查给定文档是否存在。</br>
  38471. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-exists}</br>
  38472. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  38473. * @param {Object} params - 参数。
  38474. * @param {function} callback - 回调函数。
  38475. */
  38476. }, {
  38477. key: "exists",
  38478. value: function exists(params, callback) {
  38479. return this.client.exists(params, callback);
  38480. }
  38481. /**
  38482. * @function SuperMap.ElasticSearch.prototype.existsSource
  38483. * @description 检查资源是否存在。</br>
  38484. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-existssource}</br>
  38485. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  38486. * @param {Object} params - 参数。
  38487. * @param {function} callback - 回调函数。
  38488. */
  38489. }, {
  38490. key: "existsSource",
  38491. value: function existsSource(params, callback) {
  38492. return this.client.existsSource(params, callback);
  38493. }
  38494. /**
  38495. * @function SuperMap.ElasticSearch.prototype.explain
  38496. * @description 提供与特定查询相关的特定文档分数的详细信息。它还会告诉您文档是否与指定的查询匹配。</br>
  38497. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-explain}</br>
  38498. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html}</br>
  38499. * @param {Object} params - 参数。
  38500. * @param {function} callback - 回调函数。
  38501. */
  38502. }, {
  38503. key: "explain",
  38504. value: function explain(params, callback) {
  38505. return this.client.explain(params, callback);
  38506. }
  38507. /**
  38508. * @function SuperMap.ElasticSearch.prototype.fieldCaps
  38509. * @description 允许检索多个索引之间的字段的功能。(实验性API,可能会在未来版本中删除)</br>
  38510. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-fieldcaps}</br>
  38511. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html}</br>
  38512. * @param {Object} params - 参数。
  38513. * @param {function} callback - 回调函数。
  38514. */
  38515. }, {
  38516. key: "fieldCaps",
  38517. value: function fieldCaps(params, callback) {
  38518. return this.client.fieldCaps(params, callback);
  38519. }
  38520. /**
  38521. * @function SuperMap.ElasticSearch.prototype.get
  38522. * @description 从索引获取一个基于其id的类型的JSON文档。</br>
  38523. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-get}</br>
  38524. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  38525. * @param {Object} params - 参数。
  38526. * @param {function} callback - 回调函数。
  38527. */
  38528. }, {
  38529. key: "get",
  38530. value: function get(params, callback) {
  38531. return this.client.get(params, callback);
  38532. }
  38533. /**
  38534. * @function SuperMap.ElasticSearch.prototype.getScript
  38535. * @description 获取脚本。</br>
  38536. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getscript}</br>
  38537. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  38538. * @param {Object} params - 参数。
  38539. * @param {function} callback - 回调函数。
  38540. */
  38541. }, {
  38542. key: "getScript",
  38543. value: function getScript(params, callback) {
  38544. return this.client.getScript(params, callback);
  38545. }
  38546. /**
  38547. * @function SuperMap.ElasticSearch.prototype.getSource
  38548. * @description 通过索引,类型和ID获取文档的源。</br>
  38549. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-getsource}</br>
  38550. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html}</br>
  38551. * @param {Object} params - 参数。
  38552. * @param {function} callback - 回调函数。
  38553. */
  38554. }, {
  38555. key: "getSource",
  38556. value: function getSource(params, callback) {
  38557. return this.client.getSource(params, callback);
  38558. }
  38559. /**
  38560. * @function SuperMap.ElasticSearch.prototype.getTemplate
  38561. * @description 获取模板。</br>
  38562. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-gettemplate}</br>
  38563. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  38564. * @param {Object} params - 参数。
  38565. * @param {function} callback - 回调函数。
  38566. */
  38567. }, {
  38568. key: "getTemplate",
  38569. value: function getTemplate(params, callback) {
  38570. return this.client.getTemplate(params, callback);
  38571. }
  38572. /**
  38573. * @function SuperMap.ElasticSearch.prototype.index
  38574. * @description 在索引中存储一个键入的JSON文档,使其可搜索。</br>
  38575. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-index}</br>
  38576. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html}</br>
  38577. * @param {Object} params - 参数。
  38578. * @param {function} callback - 回调函数。
  38579. */
  38580. }, {
  38581. key: "index",
  38582. value: function index(params, callback) {
  38583. return this.client.index(params, callback);
  38584. }
  38585. /**
  38586. * @function SuperMap.ElasticSearch.prototype.info
  38587. * @description 从当前集群获取基本信息。</br>
  38588. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-info}</br>
  38589. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  38590. * @param {Object} params - 参数。
  38591. * @param {function} callback - 回调函数。
  38592. */
  38593. }, {
  38594. key: "info",
  38595. value: function info(params, callback) {
  38596. return this.client.info(params, callback);
  38597. }
  38598. /**
  38599. * @function SuperMap.ElasticSearch.prototype.mget
  38600. * @description 根据索引,类型(可选)和ids来获取多个文档。mget所需的主体可以采用两种形式:文档位置数组或文档ID数组。</br>
  38601. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mget}</br>
  38602. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html}</br>
  38603. * @param {Object} params - 参数。
  38604. * @param {function} callback - 回调函数。
  38605. */
  38606. }, {
  38607. key: "mget",
  38608. value: function mget(params, callback) {
  38609. return this.client.mget(params, callback);
  38610. }
  38611. /**
  38612. * @function SuperMap.ElasticSearch.prototype.msearch
  38613. * @description 在同一请求中执行多个搜索请求。</br>
  38614. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearch}</br>
  38615. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html}</br>
  38616. * @param {Object} params - 参数。
  38617. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  38618. * 回调参数:error,response。结果存储在response.responses中
  38619. */
  38620. }, {
  38621. key: "msearch",
  38622. value: function msearch(params, callback) {
  38623. var me = this;
  38624. return me.client.msearch(params).then(function (resp) {
  38625. me._update(resp.responses, callback);
  38626. return resp;
  38627. }, function (err) {
  38628. callback(err);
  38629. me.events.triggerEvent('error', {
  38630. error: err
  38631. });
  38632. return err;
  38633. });
  38634. }
  38635. /**
  38636. * @function SuperMap.ElasticSearch.prototype.msearchTemplate
  38637. * @description 在同一请求中执行多个搜索模板请求。</br>
  38638. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-msearchtemplate}</br>
  38639. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  38640. * @param {Object} params - 参数。
  38641. * @param {function} callback - 回调函数。
  38642. */
  38643. }, {
  38644. key: "msearchTemplate",
  38645. value: function msearchTemplate(params, callback) {
  38646. return this.client.msearchTemplate(params, callback);
  38647. }
  38648. /**
  38649. * @function SuperMap.ElasticSearch.prototype.mtermvectors
  38650. * @description 多termvectors API允许一次获得多个termvectors。</br>
  38651. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-mtermvectors}</br>
  38652. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html}</br>
  38653. * @param {Object} params - 参数。
  38654. * @param {function} callback - 回调函数。
  38655. */
  38656. }, {
  38657. key: "mtermvectors",
  38658. value: function mtermvectors(params, callback) {
  38659. return this.client.mtermvectors(params, callback);
  38660. }
  38661. /**
  38662. * @function SuperMap.ElasticSearch.prototype.ping
  38663. * @description 测试连接。</br>
  38664. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-ping}</br>
  38665. * 更多信息参考 {@link https://www.elastic.co/guide/index.html}</br>
  38666. * @param {Object} params - 参数。
  38667. * @param {function} callback - 回调函数。
  38668. */
  38669. }, {
  38670. key: "ping",
  38671. value: function ping(params, callback) {
  38672. return this.client.ping(params, callback);
  38673. }
  38674. /**
  38675. * @function SuperMap.ElasticSearch.prototype.putScript
  38676. * @description 添加脚本。</br>
  38677. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-putscript}</br>
  38678. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html}</br>
  38679. * @param {Object} params - 参数。
  38680. * @param {function} callback - 回调函数。
  38681. */
  38682. }, {
  38683. key: "putScript",
  38684. value: function putScript(params, callback) {
  38685. return this.client.putScript(params, callback);
  38686. }
  38687. /**
  38688. * @function SuperMap.ElasticSearch.prototype.putTemplate
  38689. * @description 添加模板。</br>
  38690. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-puttemplate}</br>
  38691. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  38692. * @param {Object} params - 参数。
  38693. * @param {function} callback - 回调函数。
  38694. */
  38695. }, {
  38696. key: "putTemplate",
  38697. value: function putTemplate(params, callback) {
  38698. return this.client.putTemplate(params, callback);
  38699. }
  38700. /**
  38701. * @function SuperMap.ElasticSearch.prototype.reindex
  38702. * @description 重新索引。</br>
  38703. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindex}</br>
  38704. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  38705. * @param {Object} params - 参数。
  38706. * @param {function} callback - 回调函数。
  38707. */
  38708. }, {
  38709. key: "reindex",
  38710. value: function reindex(params, callback) {
  38711. return this.client.reindex(params, callback);
  38712. }
  38713. /**
  38714. * @function SuperMap.ElasticSearch.prototype.reindexRessrottle
  38715. * @description 重新索引。</br>
  38716. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-reindexrethrottle}</br>
  38717. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html}</br>
  38718. * @param {Object} params - 参数。
  38719. * @param {function} callback - 回调函数。
  38720. */
  38721. }, {
  38722. key: "reindexRessrottle",
  38723. value: function reindexRessrottle(params, callback) {
  38724. return this.client.reindexRessrottle(params, callback);
  38725. }
  38726. /**
  38727. * @function SuperMap.ElasticSearch.prototype.renderSearchTemplate
  38728. * @description 搜索模板。</br>
  38729. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-rendersearchtemplate}</br>
  38730. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html}</br>
  38731. * @param {Object} params - 参数。
  38732. * @param {function} callback - 回调函数。
  38733. */
  38734. }, {
  38735. key: "renderSearchTemplate",
  38736. value: function renderSearchTemplate(params, callback) {
  38737. return this.client.renderSearchTemplate(params, callback);
  38738. }
  38739. /**
  38740. * @function SuperMap.ElasticSearch.prototype.scroll
  38741. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。</br>
  38742. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-scroll}</br>
  38743. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html}</br>
  38744. * @param {Object} params - 参数。
  38745. * @param {function} callback - 回调函数。
  38746. */
  38747. }, {
  38748. key: "scroll",
  38749. value: function scroll(params, callback) {
  38750. return this.client.scroll(params, callback);
  38751. }
  38752. /**
  38753. * @function SuperMap.ElasticSearch.prototype.search
  38754. * @description 在search()调用中指定滚动参数之后,滚动搜索请求(检索下一组结果)。
  38755. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-search}</br>
  38756. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html}</br>
  38757. * @param {Object} params - 参数。
  38758. * @param {function} callback - 请求返回的回调函数。也可以使用then表达式获取返回结果。
  38759. * 回调参数:error,response,结果存储在response.responses中
  38760. */
  38761. }, {
  38762. key: "search",
  38763. value: function search(params, callback) {
  38764. var me = this;
  38765. return me.client.search(params).then(function (resp) {
  38766. me._update(resp.responses, callback);
  38767. return resp;
  38768. }, function (err) {
  38769. callback(err);
  38770. me.events.triggerEvent('error', {
  38771. error: err
  38772. });
  38773. return err;
  38774. });
  38775. }
  38776. /**
  38777. * @function SuperMap.ElasticSearch.prototype.searchShards
  38778. * @description 返回要执行搜索请求的索引和分片。
  38779. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchshards}</br>
  38780. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html}</br>
  38781. * @param {Object} params - 参数。
  38782. * @param {function} callback - 回调函数。
  38783. */
  38784. }, {
  38785. key: "searchShards",
  38786. value: function searchShards(params, callback) {
  38787. return this.client.searchShards(params, callback);
  38788. }
  38789. /**
  38790. * @function SuperMap.ElasticSearch.prototype.searchTemplate
  38791. * @description 搜索模板。
  38792. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-searchtemplate}</br>
  38793. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  38794. * @param {Object} params - 参数。
  38795. * @param {function} callback - 回调函数。
  38796. */
  38797. }, {
  38798. key: "searchTemplate",
  38799. value: function searchTemplate(params, callback) {
  38800. return this.client.searchTemplate(params, callback);
  38801. }
  38802. /**
  38803. * @function SuperMap.ElasticSearch.prototype.suggest
  38804. * @description 该建议功能通过使用特定的建议者,基于所提供的文本来建议类似的术语。
  38805. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-suggest}</br>
  38806. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html}</br>
  38807. * @param {Object} params - 参数。
  38808. * @param {function} callback - 回调函数。
  38809. */
  38810. }, {
  38811. key: "suggest",
  38812. value: function suggest(params, callback) {
  38813. return this.client.suggest(params, callback);
  38814. }
  38815. /**
  38816. * @function SuperMap.ElasticSearch.prototype.termvectors
  38817. * @description 返回有关特定文档字段中的术语的信息和统计信息。
  38818. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-termvectors}</br>
  38819. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html}</br>
  38820. * @param {Object} params - 参数。
  38821. * @param {function} callback - 回调函数。
  38822. */
  38823. }, {
  38824. key: "termvectors",
  38825. value: function termvectors(params, callback) {
  38826. return this.client.termvectors(params, callback);
  38827. }
  38828. /**
  38829. * @function SuperMap.ElasticSearch.prototype.update
  38830. * @description 更新文档的部分。
  38831. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-update}</br>
  38832. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html}</br>
  38833. * @param {Object} params - 参数。
  38834. * @param {function} callback - 回调函数。
  38835. */
  38836. }, {
  38837. key: "update",
  38838. value: function update(params, callback) {
  38839. return this.client.update(params, callback);
  38840. }
  38841. /**
  38842. * @function SuperMap.ElasticSearch.prototype.update
  38843. * @description 通过查询API来更新文档。
  38844. * 参数设置参考 {@link https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html#api-updatebyquery}</br>
  38845. * 更多信息参考 {@link https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html}</br>
  38846. * @param {Object} params - 参数。
  38847. * @param {function} callback - 回调函数。
  38848. */
  38849. }, {
  38850. key: "updateByQuery",
  38851. value: function updateByQuery(params, callback) {
  38852. return this.client.updateByQuery(params, callback);
  38853. }
  38854. }, {
  38855. key: "_update",
  38856. value: function _update(data, callback) {
  38857. var me = this;
  38858. if (!data) {
  38859. return;
  38860. }
  38861. me.data = data;
  38862. if (me.openGeoFence && me.geoFence) {
  38863. me._validateDatas(data);
  38864. }
  38865. me.events.triggerEvent('change', {
  38866. data: me.data
  38867. }); //change方法已废弃,不建议使用。建议使用search方法的第二个参数传入请求成功的回调
  38868. if (me.change) {
  38869. me.change && me.change(data);
  38870. } else {
  38871. //加responses是为了保持跟原来es自身的数据结构一致
  38872. callback && callback(undefined, {
  38873. responses: data
  38874. });
  38875. }
  38876. }
  38877. }, {
  38878. key: "_validateDatas",
  38879. value: function _validateDatas(datas) {
  38880. if (!datas) {
  38881. return;
  38882. }
  38883. if (!(datas instanceof Array)) {
  38884. datas = [datas];
  38885. }
  38886. var i,
  38887. len = datas.length;
  38888. for (i = 0; i < len; i++) {
  38889. this._validateData(datas[i]);
  38890. }
  38891. }
  38892. }, {
  38893. key: "_validateData",
  38894. value: function _validateData(data) {
  38895. var me = this;
  38896. data.hits.hits.map(function (source) {
  38897. var content = source._source;
  38898. var meterUnit = me._getMeterPerMapUnit(me.geoFence.unit);
  38899. var geoFenceCX = me.geoFence.center[0] * meterUnit;
  38900. var geoFenceCY = me.geoFence.center[1] * meterUnit;
  38901. var contentX = content.x * meterUnit;
  38902. var contentY = content.y * meterUnit;
  38903. var distance = me._distance(contentX, contentY, geoFenceCX, geoFenceCY);
  38904. var radius = me.geoFence.radius;
  38905. if (distance > radius) {
  38906. me.outOfGeoFence && me.outOfGeoFence(data);
  38907. me.events.triggerEvent('outOfGeoFence', {
  38908. data: data
  38909. });
  38910. }
  38911. return source;
  38912. });
  38913. }
  38914. }, {
  38915. key: "_distance",
  38916. value: function _distance(x1, y1, x2, y2) {
  38917. return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
  38918. }
  38919. }, {
  38920. key: "_getMeterPerMapUnit",
  38921. value: function _getMeterPerMapUnit(mapUnit) {
  38922. var earchRadiusInMeters = 6378137;
  38923. var meterPerMapUnit;
  38924. if (mapUnit === 'meter') {
  38925. meterPerMapUnit = 1;
  38926. } else if (mapUnit === 'degree') {
  38927. // 每度表示多少米。
  38928. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  38929. }
  38930. return meterPerMapUnit;
  38931. }
  38932. }]);
  38933. return ElasticSearch;
  38934. }();
  38935. SuperMap.ElasticSearch = ElasticSearch;
  38936. ;// CONCATENATED MODULE: ./src/common/thirdparty/elasticsearch/index.js
  38937. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38938. * This program are made available under the terms of the Apache License, Version 2.0
  38939. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38940. ;// CONCATENATED MODULE: ./src/common/thirdparty/index.js
  38941. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38942. * This program are made available under the terms of the Apache License, Version 2.0
  38943. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38944. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Util.js
  38945. function Util_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Util_typeof = function _typeof(obj) { return typeof obj; }; } else { Util_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Util_typeof(obj); }
  38946. function Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  38947. 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); } }
  38948. function Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) Util_defineProperties(Constructor, staticProps); return Constructor; }
  38949. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  38950. * This program are made available under the terms of the Apache License, Version 2.0
  38951. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  38952. /**
  38953. * @private
  38954. * @class SuperMap.LevelRenderer.Tool.Util
  38955. * @category Visualization Theme
  38956. * LevelRenderer 基础工具类
  38957. *
  38958. */
  38959. var Util_Util = /*#__PURE__*/function () {
  38960. /**
  38961. * @function SuperMap.LevelRenderer.Tool.Util.constructor
  38962. * @description 构造函数。
  38963. *
  38964. */
  38965. function Util() {
  38966. Util_classCallCheck(this, Util);
  38967. /**
  38968. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype.BUILTIN_OBJECT
  38969. * @description 用于处理merge时无法遍历Date等对象的问题
  38970. */
  38971. this.BUILTIN_OBJECT = {
  38972. '[object Function]': 1,
  38973. '[object RegExp]': 1,
  38974. '[object Date]': 1,
  38975. '[object Error]': 1,
  38976. '[object CanvasGradient]': 1
  38977. };
  38978. /**
  38979. * @member {Object} SuperMap.LevelRenderer.Tool.Util.prototype._ctx
  38980. */
  38981. this._ctx = null;
  38982. /**
  38983. * Property: _canvas
  38984. * {Object}
  38985. */
  38986. this._canvas = null;
  38987. /**
  38988. * Property: _pixelCtx
  38989. * {Object}
  38990. */
  38991. this._pixelCtx = null;
  38992. /**
  38993. * Property: _width
  38994. * {Object}
  38995. */
  38996. this._width = null;
  38997. /**
  38998. * Property: _height
  38999. * {Object}
  39000. */
  39001. this._height = null;
  39002. /**
  39003. * Property: _offsetX
  39004. * {Object}
  39005. */
  39006. this._offsetX = 0;
  39007. /**
  39008. * Property: _offsetY
  39009. * {Object}
  39010. */
  39011. this._offsetY = 0;
  39012. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Util";
  39013. }
  39014. /**
  39015. * @function SuperMap.LevelRenderer.Tool.Util.prototype.clone
  39016. * @description 对一个object进行深度拷贝。
  39017. *
  39018. * @param {Object} source - 需要进行拷贝的对象。
  39019. * @return {Object} 拷贝后的新对象。
  39020. */
  39021. Util_createClass(Util, [{
  39022. key: "clone",
  39023. value: function clone(source) {
  39024. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  39025. if (Util_typeof(source) == 'object' && source !== null) {
  39026. var result = source;
  39027. if (source instanceof Array) {
  39028. result = [];
  39029. for (var i = 0, len = source.length; i < len; i++) {
  39030. result[i] = this.clone(source[i]);
  39031. }
  39032. } else if (!BUILTIN_OBJECT[Object.prototype.toString.call(source)]) {
  39033. result = {};
  39034. for (var key in source) {
  39035. if (source.hasOwnProperty(key)) {
  39036. result[key] = this.clone(source[key]);
  39037. }
  39038. }
  39039. }
  39040. return result;
  39041. }
  39042. return source;
  39043. }
  39044. /**
  39045. * @function SuperMap.LevelRenderer.Tool.Util.prototype.mergeItem
  39046. * @description 合并源对象的单个属性到目标对象。
  39047. *
  39048. * @param {Object} target - 目标对象。
  39049. * @param {Object} source - 源对象。
  39050. * @param {string} key - 键。
  39051. * @param {boolean} overwrite - 是否覆盖。
  39052. * @return {Object} 目标对象
  39053. */
  39054. }, {
  39055. key: "mergeItem",
  39056. value: function mergeItem(target, source, key, overwrite) {
  39057. var BUILTIN_OBJECT = this.BUILTIN_OBJECT;
  39058. if (source.hasOwnProperty(key)) {
  39059. if (Util_typeof(target[key]) == 'object' && !BUILTIN_OBJECT[Object.prototype.toString.call(target[key])]) {
  39060. // 如果需要递归覆盖,就递归调用merge
  39061. this.merge(target[key], source[key], overwrite);
  39062. } else if (overwrite || !(key in target)) {
  39063. // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
  39064. target[key] = source[key];
  39065. }
  39066. }
  39067. }
  39068. /**
  39069. * @function SuperMap.LevelRenderer.Tool.Util.prototype.merge
  39070. * @description 合并源对象的属性到目标对象。
  39071. *
  39072. * @param {Object} target - 目标对象。
  39073. * @param {Object} source - 源对象。
  39074. * @param {boolean} overwrite - 是否覆盖。
  39075. * @return {Object} 目标对象。
  39076. */
  39077. }, {
  39078. key: "merge",
  39079. value: function merge(target, source, overwrite) {
  39080. for (var i in source) {
  39081. this.mergeItem(target, source, i, overwrite);
  39082. }
  39083. return target;
  39084. }
  39085. /**
  39086. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getContext
  39087. * @description 获取 Canvas 上下文。
  39088. * @return {Object} 上下文。
  39089. */
  39090. }, {
  39091. key: "getContext",
  39092. value: function getContext() {
  39093. if (!this._ctx) {
  39094. this._ctx = document.createElement('canvas').getContext('2d');
  39095. }
  39096. return this._ctx;
  39097. }
  39098. /**
  39099. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelContext
  39100. * @description 获取像素拾取专用的上下文。
  39101. * @return {Object} 像素拾取专用的上下文。
  39102. */
  39103. }, {
  39104. key: "getPixelContext",
  39105. value: function getPixelContext() {
  39106. if (!this._pixelCtx) {
  39107. this._canvas = document.createElement('canvas');
  39108. this._width = this._canvas.width;
  39109. this._height = this._canvas.height;
  39110. this._pixelCtx = this._canvas.getContext('2d');
  39111. }
  39112. return this._pixelCtx;
  39113. }
  39114. /**
  39115. * @function SuperMap.LevelRenderer.Tool.Util.prototype.adjustCanvasSize
  39116. * @description 如果坐标处在_canvas外部,改变_canvas的大小,修改canvas的大小 需要重新设置translate
  39117. *
  39118. * @param {number} x - 横坐标。
  39119. * @param {number} y - 纵坐标。
  39120. *
  39121. */
  39122. }, {
  39123. key: "adjustCanvasSize",
  39124. value: function adjustCanvasSize(x, y) {
  39125. var _canvas = this._canvas;
  39126. var _pixelCtx = this._pixelCtx;
  39127. var _width = this._width;
  39128. var _height = this._height;
  39129. var _offsetX = this._offsetX;
  39130. var _offsetY = this._offsetY; // 每次加的长度
  39131. var _v = 100;
  39132. var _flag;
  39133. if (x + _offsetX > _width) {
  39134. _width = x + _offsetX + _v;
  39135. _canvas.width = _width;
  39136. _flag = true;
  39137. }
  39138. if (y + _offsetY > _height) {
  39139. _height = y + _offsetY + _v;
  39140. _canvas.height = _height;
  39141. _flag = true;
  39142. }
  39143. if (x < -_offsetX) {
  39144. _offsetX = Math.ceil(-x / _v) * _v;
  39145. _width += _offsetX;
  39146. _canvas.width = _width;
  39147. _flag = true;
  39148. }
  39149. if (y < -_offsetY) {
  39150. _offsetY = Math.ceil(-y / _v) * _v;
  39151. _height += _offsetY;
  39152. _canvas.height = _height;
  39153. _flag = true;
  39154. }
  39155. if (_flag) {
  39156. _pixelCtx.translate(_offsetX, _offsetY);
  39157. }
  39158. }
  39159. /**
  39160. * @function SuperMap.LevelRenderer.Tool.Util.prototype.getPixelOffset
  39161. * @description 获取像素canvas的偏移量。
  39162. * @return {Object} 偏移量。
  39163. */
  39164. }, {
  39165. key: "getPixelOffset",
  39166. value: function getPixelOffset() {
  39167. return {
  39168. x: this._offsetX,
  39169. y: this._offsetY
  39170. };
  39171. }
  39172. /**
  39173. * @function SuperMap.LevelRenderer.Tool.Util.prototype.indexOf
  39174. * @description 查询数组中元素的index
  39175. * @return {Object} 偏移量。
  39176. */
  39177. }, {
  39178. key: "indexOf",
  39179. value: function indexOf(array, value) {
  39180. if (array.indexOf) {
  39181. return array.indexOf(value);
  39182. }
  39183. for (var i = 0, len = array.length; i < len; i++) {
  39184. if (array[i] === value) {
  39185. return i;
  39186. }
  39187. }
  39188. return -1;
  39189. }
  39190. /**
  39191. * @function SuperMap.LevelRenderer.Tool.Util.prototype.inherits
  39192. * @description 构造类继承关系
  39193. *
  39194. * @param {Function} clazz - 源类。
  39195. * @param {Function} baseClazz - 基类。
  39196. * @return {Object} 偏移量。
  39197. */
  39198. }, {
  39199. key: "inherits",
  39200. value: function inherits(clazz, baseClazz) {
  39201. var clazzPrototype = clazz.prototype;
  39202. function F() {}
  39203. F.prototype = baseClazz.prototype;
  39204. clazz.prototype = new F();
  39205. for (var prop in clazzPrototype) {
  39206. clazz.prototype[prop] = clazzPrototype[prop];
  39207. }
  39208. clazz.constructor = clazz;
  39209. }
  39210. }]);
  39211. return Util;
  39212. }();
  39213. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Color.js
  39214. function Color_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  39215. 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); } }
  39216. function Color_createClass(Constructor, protoProps, staticProps) { if (protoProps) Color_defineProperties(Constructor.prototype, protoProps); if (staticProps) Color_defineProperties(Constructor, staticProps); return Constructor; }
  39217. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  39218. * This program are made available under the terms of the Apache License, Version 2.0
  39219. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  39220. /**
  39221. * @class SuperMap.LevelRenderer.Tool.Color
  39222. * @category Visualization Theme
  39223. * @classdesc LevelRenderer 工具-颜色辅助类
  39224. * @private
  39225. */
  39226. var Color = /*#__PURE__*/function () {
  39227. function Color() {
  39228. Color_classCallCheck(this, Color);
  39229. /**
  39230. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Color.prototype.util
  39231. * @description LevelRenderer 基础工具对象。
  39232. */
  39233. this.util = new Util_Util();
  39234. /**
  39235. * @member {Object} SuperMap.LevelRenderer.Tool.Color.prototype._ctx
  39236. * @description _ctx。
  39237. */
  39238. this._ctx = null;
  39239. /**
  39240. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype.palette
  39241. * @description 默认色板。色板是一个包含图表默认颜色系列的数组,当色板中所有颜色被使用过后,又将从新回到色板中的第一个颜色。
  39242. */
  39243. 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'];
  39244. /**
  39245. * @member {Array} SuperMap.LevelRenderer.Tool.Color.prototype._palette
  39246. * @description 复位色板,用于复位 palette
  39247. */
  39248. this._palette = this.palette;
  39249. /**
  39250. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.highlightColor
  39251. * @description 高亮色
  39252. */
  39253. this.highlightColor = 'rgba(0,0,255,1)';
  39254. /**
  39255. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._highlightColor
  39256. * @description 复位高亮色
  39257. */
  39258. this._highlightColor = this.highlightColor;
  39259. /**
  39260. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype.colorRegExp
  39261. * @description 颜色格式,正则表达式。
  39262. */
  39263. 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;
  39264. /**
  39265. * @member {string} SuperMap.LevelRenderer.Tool.Color.prototype._nameColors
  39266. * @description 颜色名。
  39267. */
  39268. this._nameColors = {
  39269. aliceblue: '#f0f8ff',
  39270. antiquewhite: '#faebd7',
  39271. aqua: '#0ff',
  39272. aquamarine: '#7fffd4',
  39273. azure: '#f0ffff',
  39274. beige: '#f5f5dc',
  39275. bisque: '#ffe4c4',
  39276. black: '#000',
  39277. blanchedalmond: '#ffebcd',
  39278. blue: '#00f',
  39279. blueviolet: '#8a2be2',
  39280. brown: '#a52a2a',
  39281. burlywood: '#deb887',
  39282. cadetblue: '#5f9ea0',
  39283. chartreuse: '#7fff00',
  39284. chocolate: '#d2691e',
  39285. coral: '#ff7f50',
  39286. cornflowerblue: '#6495ed',
  39287. cornsilk: '#fff8dc',
  39288. crimson: '#dc143c',
  39289. cyan: '#0ff',
  39290. darkblue: '#00008b',
  39291. darkcyan: '#008b8b',
  39292. darkgoldenrod: '#b8860b',
  39293. darkgray: '#a9a9a9',
  39294. darkgrey: '#a9a9a9',
  39295. darkgreen: '#006400',
  39296. darkkhaki: '#bdb76b',
  39297. darkmagenta: '#8b008b',
  39298. darkolivegreen: '#556b2f',
  39299. darkorange: '#ff8c00',
  39300. darkorchid: '#9932cc',
  39301. darkred: '#8b0000',
  39302. darksalmon: '#e9967a',
  39303. darkseagreen: '#8fbc8f',
  39304. darkslateblue: '#483d8b',
  39305. darkslategray: '#2f4f4f',
  39306. darkslategrey: '#2f4f4f',
  39307. darkturquoise: '#00ced1',
  39308. darkviolet: '#9400d3',
  39309. deeppink: '#ff1493',
  39310. deepskyblue: '#00bfff',
  39311. dimgray: '#696969',
  39312. dimgrey: '#696969',
  39313. dodgerblue: '#1e90ff',
  39314. firebrick: '#b22222',
  39315. floralwhite: '#fffaf0',
  39316. forestgreen: '#228b22',
  39317. fuchsia: '#f0f',
  39318. gainsboro: '#dcdcdc',
  39319. ghostwhite: '#f8f8ff',
  39320. gold: '#ffd700',
  39321. goldenrod: '#daa520',
  39322. gray: '#808080',
  39323. grey: '#808080',
  39324. green: '#008000',
  39325. greenyellow: '#adff2f',
  39326. honeydew: '#f0fff0',
  39327. hotpink: '#ff69b4',
  39328. indianred: '#cd5c5c',
  39329. indigo: '#4b0082',
  39330. ivory: '#fffff0',
  39331. khaki: '#f0e68c',
  39332. lavender: '#e6e6fa',
  39333. lavenderblush: '#fff0f5',
  39334. lawngreen: '#7cfc00',
  39335. lemonchiffon: '#fffacd',
  39336. lightblue: '#add8e6',
  39337. lightcoral: '#f08080',
  39338. lightcyan: '#e0ffff',
  39339. lightgoldenrodyellow: '#fafad2',
  39340. lightgray: '#d3d3d3',
  39341. lightgrey: '#d3d3d3',
  39342. lightgreen: '#90ee90',
  39343. lightpink: '#ffb6c1',
  39344. lightsalmon: '#ffa07a',
  39345. lightseagreen: '#20b2aa',
  39346. lightskyblue: '#87cefa',
  39347. lightslategray: '#789',
  39348. lightslategrey: '#789',
  39349. lightsteelblue: '#b0c4de',
  39350. lightyellow: '#ffffe0',
  39351. lime: '#0f0',
  39352. limegreen: '#32cd32',
  39353. linen: '#faf0e6',
  39354. magenta: '#f0f',
  39355. maroon: '#800000',
  39356. mediumaquamarine: '#66cdaa',
  39357. mediumblue: '#0000cd',
  39358. mediumorchid: '#ba55d3',
  39359. mediumpurple: '#9370d8',
  39360. mediumseagreen: '#3cb371',
  39361. mediumslateblue: '#7b68ee',
  39362. mediumspringgreen: '#00fa9a',
  39363. mediumturquoise: '#48d1cc',
  39364. mediumvioletred: '#c71585',
  39365. midnightblue: '#191970',
  39366. mintcream: '#f5fffa',
  39367. mistyrose: '#ffe4e1',
  39368. moccasin: '#ffe4b5',
  39369. navajowhite: '#ffdead',
  39370. navy: '#000080',
  39371. oldlace: '#fdf5e6',
  39372. olive: '#808000',
  39373. olivedrab: '#6b8e23',
  39374. orange: '#ffa500',
  39375. orangered: '#ff4500',
  39376. orchid: '#da70d6',
  39377. palegoldenrod: '#eee8aa',
  39378. palegreen: '#98fb98',
  39379. paleturquoise: '#afeeee',
  39380. palevioletred: '#d87093',
  39381. papayawhip: '#ffefd5',
  39382. peachpuff: '#ffdab9',
  39383. peru: '#cd853f',
  39384. pink: '#ffc0cb',
  39385. plum: '#dda0dd',
  39386. powderblue: '#b0e0e6',
  39387. purple: '#800080',
  39388. red: '#f00',
  39389. rosybrown: '#bc8f8f',
  39390. royalblue: '#4169e1',
  39391. saddlebrown: '#8b4513',
  39392. salmon: '#fa8072',
  39393. sandybrown: '#f4a460',
  39394. seagreen: '#2e8b57',
  39395. seashell: '#fff5ee',
  39396. sienna: '#a0522d',
  39397. silver: '#c0c0c0',
  39398. skyblue: '#87ceeb',
  39399. slateblue: '#6a5acd',
  39400. slategray: '#708090',
  39401. slategrey: '#708090',
  39402. snow: '#fffafa',
  39403. springgreen: '#00ff7f',
  39404. steelblue: '#4682b4',
  39405. tan: '#d2b48c',
  39406. teal: '#008080',
  39407. thistle: '#d8bfd8',
  39408. tomato: '#ff6347',
  39409. turquoise: '#40e0d0',
  39410. violet: '#ee82ee',
  39411. wheat: '#f5deb3',
  39412. white: '#fff',
  39413. whitesmoke: '#f5f5f5',
  39414. yellow: '#ff0',
  39415. yellowgreen: '#9acd32'
  39416. };
  39417. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Color";
  39418. }
  39419. /**
  39420. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customPalette
  39421. * @description 自定义调色板。
  39422. * @param {Array} userPalete - 颜色板。
  39423. */
  39424. Color_createClass(Color, [{
  39425. key: "customPalette",
  39426. value: function customPalette(userPalete) {
  39427. this.palette = userPalete;
  39428. }
  39429. /**
  39430. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetPalette
  39431. * @description 复位默认色板。
  39432. */
  39433. }, {
  39434. key: "resetPalette",
  39435. value: function resetPalette() {
  39436. this.palette = this._palette;
  39437. }
  39438. /**
  39439. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getColor
  39440. * @description 获取色板颜色。
  39441. * @param {number} idx - 色板位置。
  39442. * @param {Array} userPalete - 色板。
  39443. * @returns {string} 颜色值。
  39444. */
  39445. }, {
  39446. key: "getColor",
  39447. value: function getColor(idx, userPalete) {
  39448. idx = idx | 0;
  39449. userPalete = userPalete || this.palette;
  39450. return userPalete[idx % userPalete.length];
  39451. }
  39452. /**
  39453. * @function SuperMap.LevelRenderer.Tool.Color.prototype.customHighlight
  39454. * @description 自定义默认高亮颜色。
  39455. * @param {string} userHighlightColor - 自定义高亮色。
  39456. */
  39457. }, {
  39458. key: "customHighlight",
  39459. value: function customHighlight(userHighlightColor) {
  39460. this.highlightColor = userHighlightColor;
  39461. }
  39462. /**
  39463. * @function SuperMap.LevelRenderer.Tool.Color.prototype.resetHighlight
  39464. * @description 重置默认高亮颜色。将当前的高亮色作为默认高亮颜色
  39465. */
  39466. }, {
  39467. key: "resetHighlight",
  39468. value: function resetHighlight() {
  39469. this.highlightColor = this._highlightColor;
  39470. }
  39471. /**
  39472. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getHighlightColor
  39473. * @description 获取默认高亮颜色
  39474. * @returns {string} 颜色值。
  39475. */
  39476. }, {
  39477. key: "getHighlightColor",
  39478. value: function getHighlightColor() {
  39479. return this.highlightColor;
  39480. }
  39481. /**
  39482. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getRadialGradient
  39483. * @description 径向渐变。
  39484. * @param {number} x0 - 渐变起点横坐标。
  39485. * @param {number} y0 - 渐变起点纵坐标。
  39486. * @param {number} r0 - 半径
  39487. * @param {number} x1 - 渐变终点横坐标。
  39488. * @param {number} y1 - 渐变终点纵坐标。
  39489. * @param {number} r1 - 半径
  39490. * @param {Array} colorList - 颜色列表。
  39491. * @returns {CanvasGradient} Cavans 渐变颜色。
  39492. */
  39493. }, {
  39494. key: "getRadialGradient",
  39495. value: function getRadialGradient(x0, y0, r0, x1, y1, r1, colorList) {
  39496. var util = this.util;
  39497. if (!this._ctx) {
  39498. this._ctx = util.getContext();
  39499. }
  39500. var gradient = this._ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
  39501. for (var i = 0, l = colorList.length; i < l; i++) {
  39502. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  39503. }
  39504. gradient.__nonRecursion = true;
  39505. return gradient;
  39506. }
  39507. /**
  39508. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getLinearGradient
  39509. * @description 线性渐变。
  39510. * @param {number} x0 - 渐变起点横坐标。
  39511. * @param {number} y0 - 渐变起点纵坐标。
  39512. * @param {number} x1 - 渐变终点横坐标。
  39513. * @param {number} y1 - 渐变终点纵坐标。
  39514. * @param {Array} colorList - 颜色列表。
  39515. * @returns {CanvasGradient} Cavans 渐变颜色。
  39516. */
  39517. }, {
  39518. key: "getLinearGradient",
  39519. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  39520. var util = this.util;
  39521. if (!this._ctx) {
  39522. this._ctx = util.getContext();
  39523. }
  39524. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  39525. for (var i = 0, l = colorList.length; i < l; i++) {
  39526. gradient.addColorStop(colorList[i][0], colorList[i][1]);
  39527. }
  39528. gradient.__nonRecursion = true;
  39529. return gradient;
  39530. }
  39531. /**
  39532. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getStepColors
  39533. * @description 获取两种颜色之间渐变颜色数组。
  39534. * @param {Object} start - 起始颜色对象。
  39535. * @param {Object} end - 结束颜色对象。
  39536. * @param {number} step - 渐变级数。
  39537. * @returns {Array} 颜色数组。
  39538. */
  39539. }, {
  39540. key: "getStepColors",
  39541. value: function getStepColors(start, end, step) {
  39542. start = this.toRGBA(start);
  39543. end = this.toRGBA(end);
  39544. start = this.getData(start);
  39545. end = this.getData(end);
  39546. var colors = [];
  39547. var stepR = (end[0] - start[0]) / step;
  39548. var stepG = (end[1] - start[1]) / step;
  39549. var stepB = (end[2] - start[2]) / step;
  39550. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  39551. // fix by linfeng 颜色堆积
  39552. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  39553. 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');
  39554. r += stepR;
  39555. g += stepG;
  39556. b += stepB;
  39557. a += stepA;
  39558. }
  39559. r = end[0];
  39560. g = end[1];
  39561. b = end[2];
  39562. a = end[3];
  39563. colors[i] = this.toColor([r, g, b, a], 'rgba');
  39564. return colors;
  39565. }
  39566. /**
  39567. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getGradientColors
  39568. * @description 获取指定级数的渐变颜色数组。
  39569. * @param {Array.<string>} colors - 颜色数组。
  39570. * @param {number} [step=20] - 渐变级数。
  39571. * @returns {Array.<string>} 颜色数组。
  39572. */
  39573. }, {
  39574. key: "getGradientColors",
  39575. value: function getGradientColors(colors, step) {
  39576. var ret = [];
  39577. var len = colors.length;
  39578. if (step === undefined) {
  39579. step = 20;
  39580. }
  39581. if (len === 1) {
  39582. ret = this.getStepColors(colors[0], colors[0], step);
  39583. } else if (len > 1) {
  39584. for (var i = 0, n = len - 1; i < n; i++) {
  39585. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  39586. if (i < n - 1) {
  39587. steps.pop();
  39588. }
  39589. ret = ret.concat(steps);
  39590. }
  39591. }
  39592. return ret;
  39593. }
  39594. /**
  39595. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toColor
  39596. * @description 颜色值数组转为指定格式颜色。
  39597. * @param {Array} data - 颜色值数组。
  39598. * @param {string} format - 格式,默认'rgb'
  39599. * @returns {string} 颜色。
  39600. */
  39601. }, {
  39602. key: "toColor",
  39603. value: function toColor(data, format) {
  39604. format = format || 'rgb';
  39605. if (data && (data.length === 3 || data.length === 4)) {
  39606. data = this.map(data, function (c) {
  39607. return c > 1 ? Math.ceil(c) : c;
  39608. });
  39609. if (format.indexOf('hex') > -1) {
  39610. return '#' + ((1 << 24) + (data[0] << 16) + (data[1] << 8) + +data[2]).toString(16).slice(1);
  39611. } else if (format.indexOf('hs') > -1) {
  39612. var sx = this.map(data.slice(1, 3), function (c) {
  39613. return c + '%';
  39614. });
  39615. data[1] = sx[0];
  39616. data[2] = sx[1];
  39617. }
  39618. if (format.indexOf('a') > -1) {
  39619. if (data.length === 3) {
  39620. data.push(1);
  39621. }
  39622. data[3] = this.adjust(data[3], [0, 1]);
  39623. return format + '(' + data.slice(0, 4).join(',') + ')';
  39624. }
  39625. return format + '(' + data.slice(0, 3).join(',') + ')';
  39626. }
  39627. }
  39628. /**
  39629. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toArray
  39630. * @description 颜色字符串转换为rgba数组。
  39631. * @param {string} color - 颜色。
  39632. * @returns {Array.<number>} 颜色值数组。
  39633. */
  39634. }, {
  39635. key: "toArray",
  39636. value: function toArray(color) {
  39637. color = this.trim(color);
  39638. if (color.indexOf('rgba') < 0) {
  39639. color = this.toRGBA(color);
  39640. }
  39641. var data = [];
  39642. var i = 0;
  39643. color.replace(/[\d.]+/g, function (n) {
  39644. if (i < 3) {
  39645. n = n | 0;
  39646. } else {
  39647. // Alpha
  39648. n = +n;
  39649. }
  39650. data[i++] = n;
  39651. });
  39652. return data;
  39653. }
  39654. /**
  39655. * @function SuperMap.LevelRenderer.Tool.Color.prototype.convert
  39656. * @description 颜色格式转化。
  39657. * @param {Array} data - 颜色值数组。
  39658. * @param {string} format - 格式,默认'rgb'
  39659. * @returns {string} 颜色。
  39660. */
  39661. }, {
  39662. key: "convert",
  39663. value: function convert(color, format) {
  39664. if (!this.isCalculableColor(color)) {
  39665. return color;
  39666. }
  39667. var data = this.getData(color);
  39668. var alpha = data[3];
  39669. if (typeof alpha === 'undefined') {
  39670. alpha = 1;
  39671. }
  39672. if (color.indexOf('hsb') > -1) {
  39673. data = this._HSV_2_RGB(data);
  39674. } else if (color.indexOf('hsl') > -1) {
  39675. data = this._HSL_2_RGB(data);
  39676. }
  39677. if (format.indexOf('hsb') > -1 || format.indexOf('hsv') > -1) {
  39678. data = this._RGB_2_HSB(data);
  39679. } else if (format.indexOf('hsl') > -1) {
  39680. data = this._RGB_2_HSL(data);
  39681. }
  39682. data[3] = alpha;
  39683. return this.toColor(data, format);
  39684. }
  39685. /**
  39686. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGBA
  39687. * @description 转换为rgba格式的颜色。
  39688. * @param {string} color - 颜色。
  39689. * @returns {string} 颜色。
  39690. */
  39691. }, {
  39692. key: "toRGBA",
  39693. value: function toRGBA(color) {
  39694. return this.convert(color, 'rgba');
  39695. }
  39696. /**
  39697. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toRGB
  39698. * @description 转换为rgb数字格式的颜色。
  39699. * @param {string} color - 颜色。
  39700. * @returns {string} 颜色。
  39701. */
  39702. }, {
  39703. key: "toRGB",
  39704. value: function toRGB(color) {
  39705. return this.convert(color, 'rgb');
  39706. }
  39707. /**
  39708. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHex
  39709. * @description 转换为16进制颜色。
  39710. * @param {string} color - 颜色。
  39711. * @returns {string} 16进制颜色,#rrggbb格式
  39712. */
  39713. }, {
  39714. key: "toHex",
  39715. value: function toHex(color) {
  39716. return this.convert(color, 'hex');
  39717. }
  39718. /**
  39719. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSVA
  39720. * @description 转换为HSV颜色。
  39721. * @param {string} color - 颜色。
  39722. * @returns {string} HSVA颜色,hsva(h,s,v,a)
  39723. */
  39724. }, {
  39725. key: "toHSVA",
  39726. value: function toHSVA(color) {
  39727. return this.convert(color, 'hsva');
  39728. }
  39729. /**
  39730. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSV
  39731. * @description 转换为HSV颜色。
  39732. * @param {string} color - 颜色。
  39733. * @returns {string} HSV颜色,hsv(h,s,v)
  39734. */
  39735. }, {
  39736. key: "toHSV",
  39737. value: function toHSV(color) {
  39738. return this.convert(color, 'hsv');
  39739. }
  39740. /**
  39741. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSBA
  39742. * @description 转换为HSBA颜色。
  39743. * @param {string} color - 颜色。
  39744. * @returns {string} HSBA颜色,hsba(h,s,b,a)
  39745. */
  39746. }, {
  39747. key: "toHSBA",
  39748. value: function toHSBA(color) {
  39749. return this.convert(color, 'hsba');
  39750. }
  39751. /**
  39752. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSB
  39753. * @description 转换为HSB颜色。
  39754. * @param {string} color - 颜色。
  39755. * @returns {string} HSB颜色,hsb(h,s,b)
  39756. */
  39757. }, {
  39758. key: "toHSB",
  39759. value: function toHSB(color) {
  39760. return this.convert(color, 'hsb');
  39761. }
  39762. /**
  39763. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSLA
  39764. * @description 转换为HSLA颜色。
  39765. * @param {string} color - 颜色。
  39766. * @returns {string} HSLA颜色,hsla(h,s,l,a)
  39767. */
  39768. }, {
  39769. key: "toHSLA",
  39770. value: function toHSLA(color) {
  39771. return this.convert(color, 'hsla');
  39772. }
  39773. /**
  39774. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toHSL
  39775. * @description 转换为HSL颜色。
  39776. * @param {string} color - 颜色。
  39777. * @returns {string} HSL颜色,hsl(h,s,l)
  39778. */
  39779. }, {
  39780. key: "toHSL",
  39781. value: function toHSL(color) {
  39782. return this.convert(color, 'hsl');
  39783. }
  39784. /**
  39785. * @function SuperMap.LevelRenderer.Tool.Color.prototype.toName
  39786. * @description 转换颜色名。
  39787. * @param {string} color - 颜色。
  39788. * @returns {string} 颜色名
  39789. */
  39790. }, {
  39791. key: "toName",
  39792. value: function toName(color) {
  39793. for (var key in this._nameColors) {
  39794. if (this.toHex(this._nameColors[key]) === this.toHex(color)) {
  39795. return key;
  39796. }
  39797. }
  39798. return null;
  39799. }
  39800. /**
  39801. * @function SuperMap.LevelRenderer.Tool.Color.prototype.trim
  39802. * @description 移除颜色中多余空格。
  39803. * @param {string} color - 颜色。
  39804. * @returns {string} 无空格颜色
  39805. */
  39806. }, {
  39807. key: "trim",
  39808. value: function trim(color) {
  39809. return String(color).replace(/\s+/g, '');
  39810. }
  39811. /**
  39812. * @function SuperMap.LevelRenderer.Tool.Color.prototype.normalize
  39813. * @description 颜色规范化。
  39814. * @param {string} color - 颜色。
  39815. * @returns {string} 规范化后的颜色
  39816. */
  39817. }, {
  39818. key: "normalize",
  39819. value: function normalize(color) {
  39820. // 颜色名
  39821. if (this._nameColors[color]) {
  39822. color = this._nameColors[color];
  39823. } // 去掉空格
  39824. color = this.trim(color); // hsv与hsb等价
  39825. color = color.replace(/hsv/i, 'hsb'); // rgb转为rrggbb
  39826. if (/^#[\da-f]{3}$/i.test(color)) {
  39827. color = parseInt(color.slice(1), 16);
  39828. var r = (color & 0xf00) << 8;
  39829. var g = (color & 0xf0) << 4;
  39830. var b = color & 0xf;
  39831. color = '#' + ((1 << 24) + (r << 4) + r + (g << 4) + g + (b << 4) + b).toString(16).slice(1);
  39832. } // 或者使用以下正则替换,不过 chrome 下性能相对差点
  39833. // color = color.replace(/^#([\da-f])([\da-f])([\da-f])$/i, '#$1$1$2$2$3$3');
  39834. return color;
  39835. }
  39836. /**
  39837. * @function SuperMap.LevelRenderer.Tool.Color.prototype.lift
  39838. * @description 颜色加深或减淡,当level>0加深,当level<0减淡。
  39839. * @param {string} color - 颜色。
  39840. * @param {number} level - 升降程度,取值区间[-1,1]。
  39841. * @returns {string} 加深或减淡后颜色值
  39842. */
  39843. }, {
  39844. key: "lift",
  39845. value: function lift(color, level) {
  39846. if (!this.isCalculableColor(color)) {
  39847. return color;
  39848. }
  39849. var direct = level > 0 ? 1 : -1;
  39850. if (typeof level === 'undefined') {
  39851. level = 0;
  39852. }
  39853. level = Math.abs(level) > 1 ? 1 : Math.abs(level);
  39854. color = this.toRGB(color);
  39855. var data = this.getData(color);
  39856. for (var i = 0; i < 3; i++) {
  39857. if (direct === 1) {
  39858. data[i] = data[i] * (1 - level) | 0;
  39859. } else {
  39860. data[i] = (255 - data[i]) * level + data[i] | 0;
  39861. }
  39862. }
  39863. return 'rgb(' + data.join(',') + ')';
  39864. }
  39865. /**
  39866. * @function SuperMap.LevelRenderer.Tool.Color.prototype.reverse
  39867. * @description 颜色翻转。[255-r,255-g,255-b,1-a]
  39868. * @param {string} color - 颜色。
  39869. * @returns {string} 翻转颜色
  39870. */
  39871. }, {
  39872. key: "reverse",
  39873. value: function reverse(color) {
  39874. if (!this.isCalculableColor(color)) {
  39875. return color;
  39876. }
  39877. var data = this.getData(this.toRGBA(color));
  39878. data = this.map(data, function (c) {
  39879. return 255 - c;
  39880. });
  39881. return this.toColor(data, 'rgb');
  39882. }
  39883. /**
  39884. * @function SuperMap.LevelRenderer.Tool.Color.prototype.mix
  39885. * @description 简单两种颜色混合
  39886. * @param {string} color1 - 第一种颜色。
  39887. * @param {string} color2 - 第二种颜色。
  39888. * @param {number} weight - 混合权重[0-1]。
  39889. * @returns {string} 结果色。rgb(r,g,b)或rgba(r,g,b,a)
  39890. */
  39891. }, {
  39892. key: "mix",
  39893. value: function mix(color1, color2, weight) {
  39894. if (!this.isCalculableColor(color1) || !this.isCalculableColor(color2)) {
  39895. return color1;
  39896. }
  39897. if (typeof weight === 'undefined') {
  39898. weight = 0.5;
  39899. }
  39900. weight = 1 - this.adjust(weight, [0, 1]);
  39901. var w = weight * 2 - 1;
  39902. var data1 = this.getData(this.toRGBA(color1));
  39903. var data2 = this.getData(this.toRGBA(color2));
  39904. var d = data1[3] - data2[3];
  39905. var weight1 = ((w * d === -1 ? w : (w + d) / (1 + w * d)) + 1) / 2;
  39906. var weight2 = 1 - weight1;
  39907. var data = [];
  39908. for (var i = 0; i < 3; i++) {
  39909. data[i] = data1[i] * weight1 + data2[i] * weight2;
  39910. }
  39911. var alpha = data1[3] * weight + data2[3] * (1 - weight);
  39912. alpha = Math.max(0, Math.min(1, alpha));
  39913. if (data1[3] === 1 && data2[3] === 1) {
  39914. // 不考虑透明度
  39915. return this.toColor(data, 'rgb');
  39916. }
  39917. data[3] = alpha;
  39918. return this.toColor(data, 'rgba');
  39919. }
  39920. /**
  39921. * @function SuperMap.LevelRenderer.Tool.Color.prototype.random
  39922. * @description 随机颜色
  39923. * @returns {string} 颜色值,#rrggbb格式
  39924. */
  39925. }, {
  39926. key: "random",
  39927. value: function random() {
  39928. return '#' + Math.random().toString(16).slice(2, 8);
  39929. }
  39930. /**
  39931. * @function SuperMap.LevelRenderer.Tool.Color.prototype.getData
  39932. * @description 获取颜色值数组,返回值范围。
  39933. * RGB 范围[0-255]
  39934. * HSL/HSV/HSB 范围[0-1]
  39935. * A透明度范围[0-1]
  39936. * 支持格式:
  39937. * #rgb
  39938. * #rrggbb
  39939. * rgb(r,g,b)
  39940. * rgb(r%,g%,b%)
  39941. * rgba(r,g,b,a)
  39942. * hsb(h,s,b) // hsv与hsb等价
  39943. * hsb(h%,s%,b%)
  39944. * hsba(h,s,b,a)
  39945. * hsl(h,s,l)
  39946. * hsl(h%,s%,l%)
  39947. * hsla(h,s,l,a)
  39948. * @param {string} color - 颜色。
  39949. * @returns {Array.<number>} 颜色值数组或null
  39950. */
  39951. }, {
  39952. key: "getData",
  39953. value: function getData(color) {
  39954. color = this.normalize(color);
  39955. var r = color.match(this.colorRegExp);
  39956. if (r === null) {
  39957. throw new Error('The color format error'); // 颜色格式错误
  39958. }
  39959. var d;
  39960. var a;
  39961. var data = [];
  39962. var rgb;
  39963. if (r[2]) {
  39964. // #rrggbb
  39965. d = r[2].replace('#', '').split('');
  39966. rgb = [d[0] + d[1], d[2] + d[3], d[4] + d[5]];
  39967. data = this.map(rgb, function (c) {
  39968. return Color.prototype.adjust.call(this, parseInt(c, 16), [0, 255]);
  39969. });
  39970. } else if (r[4]) {
  39971. // rgb rgba
  39972. var rgba = r[4].split(',');
  39973. a = rgba[3];
  39974. rgb = rgba.slice(0, 3);
  39975. data = this.map(rgb, function (c) {
  39976. c = Math.floor(c.indexOf('%') > 0 ? parseInt(c, 0) * 2.55 : c);
  39977. return Color.prototype.adjust.call(this, c, [0, 255]);
  39978. });
  39979. if (typeof a !== 'undefined') {
  39980. data.push(this.adjust(parseFloat(a), [0, 1]));
  39981. }
  39982. } else if (r[5] || r[6]) {
  39983. // hsb hsba hsl hsla
  39984. var hsxa = (r[5] || r[6]).split(',');
  39985. var h = parseInt(hsxa[0], 0) / 360;
  39986. var s = hsxa[1];
  39987. var x = hsxa[2];
  39988. a = hsxa[3];
  39989. data = this.map([s, x], function (c) {
  39990. return Color.prototype.adjust.call(this, parseFloat(c) / 100, [0, 1]);
  39991. });
  39992. data.unshift(h);
  39993. if (typeof a !== 'undefined') {
  39994. data.push(this.adjust(parseFloat(a), [0, 1]));
  39995. }
  39996. }
  39997. return data;
  39998. }
  39999. /**
  40000. * @function SuperMap.LevelRenderer.Tool.Color.prototype.alpha
  40001. * @description 设置颜色透明度
  40002. * @param {string} color - 颜色。
  40003. * @param {number} a - 透明度,区间[0,1]。
  40004. * @returns {string} rgba颜色值
  40005. */
  40006. }, {
  40007. key: "alpha",
  40008. value: function alpha(color, a) {
  40009. if (!this.isCalculableColor(color)) {
  40010. return color;
  40011. }
  40012. if (a === null) {
  40013. a = 1;
  40014. }
  40015. var data = this.getData(this.toRGBA(color));
  40016. data[3] = this.adjust(Number(a).toFixed(4), [0, 1]);
  40017. return this.toColor(data, 'rgba');
  40018. }
  40019. /**
  40020. * @function SuperMap.LevelRenderer.Tool.Color.prototype.map
  40021. * @description 数组映射
  40022. * @param {Array} array - 数组。
  40023. * @param {function} fun - 函数。
  40024. * @returns {string} 数组映射结果
  40025. */
  40026. }, {
  40027. key: "map",
  40028. value: function map(array, fun) {
  40029. if (typeof fun !== 'function') {
  40030. throw new TypeError();
  40031. }
  40032. var len = array ? array.length : 0;
  40033. for (var i = 0; i < len; i++) {
  40034. array[i] = fun(array[i]);
  40035. }
  40036. return array;
  40037. }
  40038. /**
  40039. * @function SuperMap.LevelRenderer.Tool.Color.prototype.adjust
  40040. * @description 调整值区间
  40041. * @param {Array.<number>} value - 数组。
  40042. * @param {Array.<number>} region - 区间。
  40043. * @returns {number} 调整后的值
  40044. */
  40045. }, {
  40046. key: "adjust",
  40047. value: function adjust(value, region) {
  40048. // < to <= & > to >=
  40049. // modify by linzhifeng 2014-05-25 because -0 == 0
  40050. if (value <= region[0]) {
  40051. value = region[0];
  40052. } else if (value >= region[1]) {
  40053. value = region[1];
  40054. }
  40055. return value;
  40056. }
  40057. /**
  40058. * @function SuperMap.LevelRenderer.Tool.Color.prototype.isCalculableColor
  40059. * @description 判断是否是可计算的颜色
  40060. * @param {string} color - 颜色。
  40061. * @returns {boolean} 是否是可计算的颜色
  40062. */
  40063. }, {
  40064. key: "isCalculableColor",
  40065. value: function isCalculableColor(color) {
  40066. return color instanceof Array || typeof color === 'string';
  40067. }
  40068. /**
  40069. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSV_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40070. */
  40071. }, {
  40072. key: "_HSV_2_RGB",
  40073. value: function _HSV_2_RGB(data) {
  40074. var H = data[0];
  40075. var S = data[1];
  40076. var V = data[2]; // HSV from 0 to 1
  40077. var R;
  40078. var G;
  40079. var B;
  40080. if (S === 0) {
  40081. R = V * 255;
  40082. G = V * 255;
  40083. B = V * 255;
  40084. } else {
  40085. var h = H * 6;
  40086. if (h === 6) {
  40087. h = 0;
  40088. }
  40089. var i = h | 0;
  40090. var v1 = V * (1 - S);
  40091. var v2 = V * (1 - S * (h - i));
  40092. var v3 = V * (1 - S * (1 - (h - i)));
  40093. var r = 0;
  40094. var g = 0;
  40095. var b = 0;
  40096. if (i === 0) {
  40097. r = V;
  40098. g = v3;
  40099. b = v1;
  40100. } else if (i === 1) {
  40101. r = v2;
  40102. g = V;
  40103. b = v1;
  40104. } else if (i === 2) {
  40105. r = v1;
  40106. g = V;
  40107. b = v3;
  40108. } else if (i === 3) {
  40109. r = v1;
  40110. g = v2;
  40111. b = V;
  40112. } else if (i === 4) {
  40113. r = v3;
  40114. g = v1;
  40115. b = V;
  40116. } else {
  40117. r = V;
  40118. g = v1;
  40119. b = v2;
  40120. } // RGB results from 0 to 255
  40121. R = r * 255;
  40122. G = g * 255;
  40123. B = b * 255;
  40124. }
  40125. return [R, G, B];
  40126. }
  40127. /**
  40128. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HSL_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40129. */
  40130. }, {
  40131. key: "_HSL_2_RGB",
  40132. value: function _HSL_2_RGB(data) {
  40133. var H = data[0];
  40134. var S = data[1];
  40135. var L = data[2]; // HSL from 0 to 1
  40136. var R;
  40137. var G;
  40138. var B;
  40139. if (S === 0) {
  40140. R = L * 255;
  40141. G = L * 255;
  40142. B = L * 255;
  40143. } else {
  40144. var v2;
  40145. if (L < 0.5) {
  40146. v2 = L * (1 + S);
  40147. } else {
  40148. v2 = L + S - S * L;
  40149. }
  40150. var v1 = 2 * L - v2;
  40151. R = 255 * this._HUE_2_RGB(v1, v2, H + 1 / 3);
  40152. G = 255 * this._HUE_2_RGB(v1, v2, H);
  40153. B = 255 * this._HUE_2_RGB(v1, v2, H - 1 / 3);
  40154. }
  40155. return [R, G, B];
  40156. }
  40157. /**
  40158. * @function SuperMap.LevelRenderer.Tool.Color.prototype._HUE_2_RGB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40159. */
  40160. }, {
  40161. key: "_HUE_2_RGB",
  40162. value: function _HUE_2_RGB(v1, v2, vH) {
  40163. if (vH < 0) {
  40164. vH += 1;
  40165. }
  40166. if (vH > 1) {
  40167. vH -= 1;
  40168. }
  40169. if (6 * vH < 1) {
  40170. return v1 + (v2 - v1) * 6 * vH;
  40171. }
  40172. if (2 * vH < 1) {
  40173. return v2;
  40174. }
  40175. if (3 * vH < 2) {
  40176. return v1 + (v2 - v1) * (2 / 3 - vH) * 6;
  40177. }
  40178. return v1;
  40179. }
  40180. /**
  40181. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSB。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40182. */
  40183. }, {
  40184. key: "_RGB_2_HSB",
  40185. value: function _RGB_2_HSB(data) {
  40186. // RGB from 0 to 255
  40187. var R = data[0] / 255;
  40188. var G = data[1] / 255;
  40189. var B = data[2] / 255;
  40190. var vMin = Math.min(R, G, B); // Min. value of RGB
  40191. var vMax = Math.max(R, G, B); // Max. value of RGB
  40192. var delta = vMax - vMin; // Delta RGB value
  40193. var V = vMax;
  40194. var H;
  40195. var S; // HSV results from 0 to 1
  40196. if (delta === 0) {
  40197. H = 0;
  40198. S = 0;
  40199. } else {
  40200. S = delta / vMax;
  40201. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  40202. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  40203. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  40204. if (R === vMax) {
  40205. H = deltaB - deltaG;
  40206. } else if (G === vMax) {
  40207. H = 1 / 3 + deltaR - deltaB;
  40208. } else if (B === vMax) {
  40209. H = 2 / 3 + deltaG - deltaR;
  40210. }
  40211. if (H < 0) {
  40212. H += 1;
  40213. }
  40214. if (H > 1) {
  40215. H -= 1;
  40216. }
  40217. }
  40218. H = H * 360;
  40219. S = S * 100;
  40220. V = V * 100;
  40221. return [H, S, V];
  40222. }
  40223. /**
  40224. * @function SuperMap.LevelRenderer.Tool.Color.prototype._RGB_2_HSL。参见{@link http://www.easyrgb.com/index.php?X=MATH}
  40225. */
  40226. }, {
  40227. key: "_RGB_2_HSL",
  40228. value: function _RGB_2_HSL(data) {
  40229. // RGB from 0 to 255
  40230. var R = data[0] / 255;
  40231. var G = data[1] / 255;
  40232. var B = data[2] / 255;
  40233. var vMin = Math.min(R, G, B); // Min. value of RGB
  40234. var vMax = Math.max(R, G, B); // Max. value of RGB
  40235. var delta = vMax - vMin; // Delta RGB value
  40236. var L = (vMax + vMin) / 2;
  40237. var H;
  40238. var S; // HSL results from 0 to 1
  40239. if (delta === 0) {
  40240. H = 0;
  40241. S = 0;
  40242. } else {
  40243. if (L < 0.5) {
  40244. S = delta / (vMax + vMin);
  40245. } else {
  40246. S = delta / (2 - vMax - vMin);
  40247. }
  40248. var deltaR = ((vMax - R) / 6 + delta / 2) / delta;
  40249. var deltaG = ((vMax - G) / 6 + delta / 2) / delta;
  40250. var deltaB = ((vMax - B) / 6 + delta / 2) / delta;
  40251. if (R === vMax) {
  40252. H = deltaB - deltaG;
  40253. } else if (G === vMax) {
  40254. H = 1 / 3 + deltaR - deltaB;
  40255. } else if (B === vMax) {
  40256. H = 2 / 3 + deltaG - deltaR;
  40257. }
  40258. if (H < 0) {
  40259. H += 1;
  40260. }
  40261. if (H > 1) {
  40262. H -= 1;
  40263. }
  40264. }
  40265. H = H * 360;
  40266. S = S * 100;
  40267. L = L * 100;
  40268. return [H, S, L];
  40269. }
  40270. }]);
  40271. return Color;
  40272. }();
  40273. ;// CONCATENATED MODULE: ./src/common/util/ColorsPickerUtil.js
  40274. function ColorsPickerUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40275. 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); } }
  40276. function ColorsPickerUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) ColorsPickerUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) ColorsPickerUtil_defineProperties(Constructor, staticProps); return Constructor; }
  40277. var ColorRender = new Color(); // let "http://www.qzu.zj.cn": "#bd10e0"
  40278. // "www.qzct.net": "#7ed321" = new SuperMap.LevelRenderer.Tool.Color();
  40279. /**
  40280. * Created by yzy on 2016/11/9.
  40281. * 色带选择器工具类 用于1、创建canvas对象,2、从几种颜色中获取一定数量的渐变色
  40282. *
  40283. */
  40284. var ColorsPickerUtil = /*#__PURE__*/function () {
  40285. function ColorsPickerUtil() {
  40286. ColorsPickerUtil_classCallCheck(this, ColorsPickerUtil);
  40287. }
  40288. ColorsPickerUtil_createClass(ColorsPickerUtil, null, [{
  40289. key: "createCanvas",
  40290. /**
  40291. * 创建DOM canvas
  40292. * @param height canvas 高度
  40293. * @param width canvas 宽度
  40294. *
  40295. */
  40296. value: function createCanvas(height, width) {
  40297. var canvas = document.createElement("canvas");
  40298. canvas.height = height;
  40299. canvas.width = width;
  40300. return canvas.getContext("2d");
  40301. }
  40302. /**
  40303. * 线性渐变。
  40304. * Parameters:
  40305. * x0 - {Number} 渐变起点。
  40306. * y0 - {Number}
  40307. * x1 - {Number} 渐变终点。
  40308. * y1 - {Number}
  40309. * colorList - {Array} 颜色列表。
  40310. *
  40311. * Returns:
  40312. * {CanvasGradient} Cavans 渐变颜色。
  40313. */
  40314. }, {
  40315. key: "getLinearGradient",
  40316. value: function getLinearGradient(x0, y0, x1, y1, colorList) {
  40317. if (!this._ctx) {
  40318. this._ctx = this.getContext();
  40319. }
  40320. var gradient = this._ctx.createLinearGradient(x0, y0, x1, y1);
  40321. var leng = colorList.length;
  40322. var add = 1 / (leng - 1);
  40323. var offset = 0;
  40324. for (var i = 0; i < leng; i++) {
  40325. gradient.addColorStop(offset, colorList[i]);
  40326. offset += add;
  40327. }
  40328. gradient.__nonRecursion = true;
  40329. return gradient;
  40330. }
  40331. /**
  40332. * 获取 Cavans 上下文
  40333. *
  40334. * Returns:
  40335. * {Object} Cavans 上下文。
  40336. */
  40337. }, {
  40338. key: "getContext",
  40339. value: function getContext() {
  40340. if (!this._ctx) {
  40341. this._ctx = document.createElement('canvas').getContext('2d');
  40342. }
  40343. return this._ctx;
  40344. }
  40345. /**
  40346. * 获取两种颜色之间渐变颜色数组。
  40347. *
  40348. * Parameters:
  40349. * start - {color} 起始颜色。
  40350. * end - {color} 结束颜色。
  40351. * step - {Number} 渐变级数。
  40352. * colorList - {Array} 颜色列表。
  40353. *
  40354. * Returns:
  40355. * {Array} 颜色数组。
  40356. */
  40357. }, {
  40358. key: "getStepColors",
  40359. value: function getStepColors(start, end, step) {
  40360. start = ColorRender.toRGBA(start);
  40361. end = ColorRender.toRGBA(end);
  40362. start = ColorRender.getData(start);
  40363. end = ColorRender.getData(end);
  40364. var colors = [];
  40365. var stepR = (end[0] - start[0]) / step;
  40366. var stepG = (end[1] - start[1]) / step;
  40367. var stepB = (end[2] - start[2]) / step;
  40368. var stepA = (end[3] - start[3]) / step; // 生成颜色集合
  40369. // fix by linfeng 颜色堆积
  40370. for (var i = 0, r = start[0], g = start[1], b = start[2], a = start[3]; i < step; i++) {
  40371. 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');
  40372. r += stepR;
  40373. g += stepG;
  40374. b += stepB;
  40375. a += stepA;
  40376. }
  40377. r = end[0];
  40378. g = end[1];
  40379. b = end[2];
  40380. a = end[3];
  40381. colors[i] = ColorRender.toColor([r, g, b, a], 'hex');
  40382. return colors;
  40383. }
  40384. /**
  40385. * APIMethod: getGradientColors
  40386. * 获取指定级数的渐变颜色数组。
  40387. *
  40388. * Parameters:
  40389. * colors - {Array{String}} 颜色组。
  40390. * total - {Number} 颜色总数。
  40391. * total - {String} 专题类型
  40392. *
  40393. * Returns:
  40394. * {Array{String}} 颜色数组。
  40395. */
  40396. }, {
  40397. key: "getGradientColors",
  40398. value: function getGradientColors(colors, total, themeType) {
  40399. var ret = [],
  40400. step;
  40401. var i,
  40402. n,
  40403. len = colors.length;
  40404. if (total === undefined) {
  40405. return;
  40406. }
  40407. if (len >= total) {
  40408. if (themeType === 'RANGE') {
  40409. for (i = 0; i < total; i++) {
  40410. ret.push(colors[i]);
  40411. }
  40412. } else {
  40413. //1/2前后取色
  40414. for (i = 0; i < total; i++) {
  40415. var ii = Math.floor(i / 2);
  40416. if (i % 2 === 0) {
  40417. ret.push(colors[ii]);
  40418. } else {
  40419. var _index = colors.length - 1 - ii;
  40420. ret.push(colors[_index]);
  40421. }
  40422. }
  40423. }
  40424. } else {
  40425. step = Math.ceil(total / (len - 1));
  40426. for (i = 0, n = len - 1; i < n; i++) {
  40427. var steps = this.getStepColors(colors[i], colors[i + 1], step);
  40428. if (i < n - 1) {
  40429. steps.pop();
  40430. }
  40431. ret = ret.concat(steps);
  40432. } //删除多余元素
  40433. var nouse = ret.length - total;
  40434. for (var j = 0, index = 0; j < nouse; j++) {
  40435. ret.splice(index + 2, 1);
  40436. }
  40437. }
  40438. return ret;
  40439. }
  40440. }]);
  40441. return ColorsPickerUtil;
  40442. }();
  40443. SuperMap.ColorsPickerUtil = ColorsPickerUtil;
  40444. ;// CONCATENATED MODULE: ./src/common/util/ArrayStatistic.js
  40445. function ArrayStatistic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40446. 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); } }
  40447. function ArrayStatistic_createClass(Constructor, protoProps, staticProps) { if (protoProps) ArrayStatistic_defineProperties(Constructor.prototype, protoProps); if (staticProps) ArrayStatistic_defineProperties(Constructor, staticProps); return Constructor; }
  40448. var ArrayStatistic = /*#__PURE__*/function () {
  40449. function ArrayStatistic() {
  40450. ArrayStatistic_classCallCheck(this, ArrayStatistic);
  40451. }
  40452. ArrayStatistic_createClass(ArrayStatistic, null, [{
  40453. key: "newInstance",
  40454. // geostatsInstance: null,
  40455. /**
  40456. * 初始化插件实例
  40457. */
  40458. value: function newInstance() {
  40459. // if(!this.geostatsInstance) {
  40460. // // this.geostatsInstance = new geostats();
  40461. // // }
  40462. // window.dataList = [];
  40463. if (!this.geostatsInstance) {
  40464. this.geostatsInstance = new window.geostats();
  40465. }
  40466. return this.geostatsInstance;
  40467. }
  40468. /**
  40469. * 设置需要被处理的数组
  40470. *
  40471. * @param array
  40472. */
  40473. }, {
  40474. key: "getInstance",
  40475. value: function getInstance(array) {
  40476. var instance = this.newInstance();
  40477. instance.setSerie(array);
  40478. return instance;
  40479. }
  40480. /**
  40481. * 获取数组统计的值
  40482. *
  40483. * @param array 需要统计的数组
  40484. * @param type 统计方法
  40485. */
  40486. }, {
  40487. key: "getArrayStatistic",
  40488. value: function getArrayStatistic(array, type) {
  40489. if (!array.length) {
  40490. return 0;
  40491. }
  40492. if (type === "Sum" || type === "求和") {
  40493. return this.getSum(array);
  40494. } else if (type === "Maximum" || type === "最大值") {
  40495. return this.getMax(array);
  40496. } else if (type === "Minimum" || type === "最小值") {
  40497. return this.getMin(array);
  40498. } else if (type === "Average" || type === "平均值") {
  40499. return this.getMean(array);
  40500. } else if (type === "Median" || type === "中位数") {
  40501. return this.getMedian(array);
  40502. } else if (type === "times" || type === "计数") {
  40503. return this.getTimes(array);
  40504. }
  40505. }
  40506. /**
  40507. * 获取数组分段后的数值
  40508. *
  40509. * @param array 需要分段的数组
  40510. * @param type 分段方法
  40511. * @param segNum 分段个数
  40512. */
  40513. }, {
  40514. key: "getArraySegments",
  40515. value: function getArraySegments(array, type, segNum) {
  40516. if (type === "offset") {
  40517. return this.getEqInterval(array, segNum);
  40518. } else if (type === "jenks") {
  40519. return this.getJenks(array, segNum);
  40520. } else if (type === "square") {
  40521. // 数据都必须 >= 0
  40522. var minValue = this.getMin(array);
  40523. if (minValue >= 0) {
  40524. return this.getSqrtInterval(array, segNum);
  40525. } else {
  40526. //console.log('数据都必须 >= 0');
  40527. // Util.showMessage(Language.hasNegValue + Language.noSupportRange, 'ERROR');
  40528. return false;
  40529. }
  40530. } else if (type === "logarithm") {
  40531. // 数据都必须 > 0
  40532. var _minValue = this.getMin(array);
  40533. if (_minValue > 0) {
  40534. return this.getGeometricProgression(array, segNum);
  40535. } else {
  40536. //console.log('数据都必须 > 0');
  40537. // Util.showMessage(Language.hasZeroNegValue + Language.noSupportRange, 'ERROR');
  40538. return false;
  40539. }
  40540. }
  40541. }
  40542. /**
  40543. * 求和
  40544. * @param array
  40545. * @returns {number}
  40546. */
  40547. }, {
  40548. key: "getSum",
  40549. value: function getSum(array) {
  40550. return this.getInstance(array).sum();
  40551. }
  40552. /**
  40553. * 最小值
  40554. * @param array
  40555. * @returns {*}
  40556. */
  40557. }, {
  40558. key: "getMax",
  40559. value: function getMax(array) {
  40560. return this.getInstance(array).max();
  40561. }
  40562. /**
  40563. * 最大值
  40564. * @param array
  40565. * @returns {*}
  40566. */
  40567. }, {
  40568. key: "getMin",
  40569. value: function getMin(array) {
  40570. return this.getInstance(array).min();
  40571. }
  40572. /**
  40573. * 求平均
  40574. * @param array
  40575. * @returns {number}
  40576. */
  40577. }, {
  40578. key: "getMean",
  40579. value: function getMean(array) {
  40580. return this.getInstance(array).mean();
  40581. }
  40582. /**
  40583. * 求中位数
  40584. *
  40585. * @param array
  40586. * @returns {number}
  40587. */
  40588. }, {
  40589. key: "getMedian",
  40590. value: function getMedian(array) {
  40591. return this.getInstance(array).median();
  40592. }
  40593. /**
  40594. * 计数
  40595. *
  40596. * @param array
  40597. * @returns {number}
  40598. */
  40599. }, {
  40600. key: "getTimes",
  40601. value: function getTimes(array) {
  40602. return array.length;
  40603. }
  40604. /**
  40605. * 等距分段法
  40606. *
  40607. * @param array
  40608. * @param segNum
  40609. */
  40610. }, {
  40611. key: "getEqInterval",
  40612. value: function getEqInterval(array, segNum) {
  40613. return this.getInstance(array).getClassEqInterval(segNum);
  40614. }
  40615. /**
  40616. * 自然断裂法
  40617. *
  40618. * @param array
  40619. * @param segNum
  40620. */
  40621. }, {
  40622. key: "getJenks",
  40623. value: function getJenks(array, segNum) {
  40624. return this.getInstance(array).getClassJenks(segNum);
  40625. }
  40626. /**
  40627. * 平方根分段法
  40628. *
  40629. * @param array
  40630. * @param segNum
  40631. */
  40632. }, {
  40633. key: "getSqrtInterval",
  40634. value: function getSqrtInterval(array, segNum) {
  40635. array = array.map(function (value) {
  40636. return Math.sqrt(value);
  40637. });
  40638. var breaks = this.getInstance(array).getClassEqInterval(segNum);
  40639. return breaks.map(function (value) {
  40640. return value * value;
  40641. });
  40642. }
  40643. /**
  40644. * 对数分段法
  40645. *
  40646. * @param array
  40647. * @param segNum
  40648. */
  40649. }, {
  40650. key: "getGeometricProgression",
  40651. value: function getGeometricProgression(array, segNum) {
  40652. return this.getInstance(array).getClassGeometricProgression(segNum);
  40653. }
  40654. }]);
  40655. return ArrayStatistic;
  40656. }();
  40657. SuperMap.ArrayStatistic = ArrayStatistic;
  40658. ;// CONCATENATED MODULE: ./src/common/util/MapCalculateUtil.js
  40659. var getMeterPerMapUnit = function getMeterPerMapUnit(mapUnit) {
  40660. var earchRadiusInMeters = 6378137;
  40661. var meterPerMapUnit;
  40662. if (mapUnit === Unit.METER) {
  40663. meterPerMapUnit = 1;
  40664. } else if (mapUnit === Unit.DEGREE) {
  40665. // 每度表示多少米。
  40666. meterPerMapUnit = Math.PI * 2 * earchRadiusInMeters / 360;
  40667. } else if (mapUnit === Unit.KILOMETER) {
  40668. meterPerMapUnit = 1.0e-3;
  40669. } else if (mapUnit === Unit.INCH) {
  40670. meterPerMapUnit = 1 / 2.5399999918e-2;
  40671. } else if (mapUnit === Unit.FOOT) {
  40672. meterPerMapUnit = 0.3048;
  40673. } else {
  40674. return meterPerMapUnit;
  40675. }
  40676. return meterPerMapUnit;
  40677. };
  40678. function getWrapNum(x) {
  40679. var includeMax = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  40680. var includeMin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  40681. var range = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [-180, 180];
  40682. var max = range[1],
  40683. min = range[0],
  40684. d = max - min;
  40685. if (x === max && includeMax) {
  40686. return x;
  40687. }
  40688. if (x === min && includeMin) {
  40689. return x;
  40690. }
  40691. var tmp = ((x - min) % d + d) % d;
  40692. if (tmp === 0 && includeMax) {
  40693. return max;
  40694. }
  40695. return ((x - min) % d + d) % d + min;
  40696. }
  40697. function conversionDegree(degrees) {
  40698. var degree = parseInt(degrees);
  40699. var fraction = parseInt((degrees - degree) * 60);
  40700. var second = parseInt(((degrees - degree) * 60 - fraction) * 60);
  40701. fraction = parseInt(fraction / 10) === 0 ? "0".concat(fraction) : fraction;
  40702. second = parseInt(second / 10) === 0 ? "0".concat(second) : second;
  40703. return "".concat(degree, "\xB0").concat(fraction, "'").concat(second);
  40704. }
  40705. ;// CONCATENATED MODULE: ./src/common/util/index.js
  40706. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40707. * This program are made available under the terms of the Apache License, Version 2.0
  40708. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40709. // EXTERNAL MODULE: ./node_modules/lodash.topairs/index.js
  40710. var lodash_topairs = __webpack_require__(820);
  40711. var lodash_topairs_default = /*#__PURE__*/__webpack_require__.n(lodash_topairs);
  40712. ;// CONCATENATED MODULE: ./src/common/style/CartoCSS.js
  40713. function CartoCSS_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CartoCSS_typeof = function _typeof(obj) { return typeof obj; }; } else { CartoCSS_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CartoCSS_typeof(obj); }
  40714. function CartoCSS_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  40715. 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); } }
  40716. function CartoCSS_createClass(Constructor, protoProps, staticProps) { if (protoProps) CartoCSS_defineProperties(Constructor.prototype, protoProps); if (staticProps) CartoCSS_defineProperties(Constructor, staticProps); return Constructor; }
  40717. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  40718. * This program are made available under the terms of the Apache License, Version 2.0
  40719. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  40720. /**
  40721. * @class SuperMap.CartoCSS
  40722. * @classdesc CartoCSS 解析类,其主要功能为将 CartoCSS 字符串解析为 CartoCSS 的 shader 属性风格对象。
  40723. * @category BaseTypes Style
  40724. * @param {string} cartoStr - CartoCSS 样式表字符串
  40725. * @example
  40726. * var cartocss = "@provinceLineColor:#ddd;
  40727. * #China_Provinces_L___China400{
  40728. * line-dasharray:10,10;
  40729. * line-color:@provinceLineColor;
  40730. * line-width:1;
  40731. * }";
  40732. * new SuperMap.CartoCSS(cartocss);
  40733. */
  40734. /*eslint no-useless-escape: "off"*/
  40735. var CartoCSS = /*#__PURE__*/function () {
  40736. function CartoCSS(cartoStr) {
  40737. CartoCSS_classCallCheck(this, CartoCSS);
  40738. this.env = null;
  40739. /**
  40740. * @member SuperMap.CartoCSS.prototype.parser
  40741. * @description 解析器
  40742. */
  40743. this.parser = null;
  40744. /**
  40745. * @member SuperMap.CartoCSS.prototype.ruleSet
  40746. * @description CartoCSS 规则对象
  40747. */
  40748. this.ruleSet = null;
  40749. /**
  40750. * @member SuperMap.CartoCSS.prototype.cartoStr
  40751. * @description CartoCSS 样式表字符串
  40752. */
  40753. this.cartoStr = "";
  40754. /**
  40755. * @member SuperMap.CartoCSS.prototype.shaders
  40756. * @description Carto 着色器集
  40757. */
  40758. this.shaders = null;
  40759. if (typeof cartoStr === "string") {
  40760. this.cartoStr = cartoStr;
  40761. this.env = {
  40762. frames: [],
  40763. errors: [],
  40764. error: function error(obj) {
  40765. this.errors.push(obj);
  40766. }
  40767. };
  40768. this.parser = this.getParser(this.env);
  40769. this.parse(cartoStr);
  40770. this.shaders = this.toShaders();
  40771. }
  40772. }
  40773. /**
  40774. * @function SuperMap.CartoCSS.prototype.getParser
  40775. * @description 获取 CartoCSS 解析器
  40776. */
  40777. CartoCSS_createClass(CartoCSS, [{
  40778. key: "getParser",
  40779. value: function getParser(env) {
  40780. var input, // LeSS input string
  40781. i, // current index in `input`
  40782. j, // current chunk
  40783. temp, // temporarily holds a chunk's state, for backtracking
  40784. memo, // temporarily holds `i`, when backtracking
  40785. furthest, // furthest index the parser has gone to
  40786. chunks, // chunkified input
  40787. current, // index of current chunk, in `input`
  40788. parser;
  40789. var that = this; // This function is called after all files
  40790. // have been imported through `@import`.
  40791. var finish = function finish() {//NOSONAR
  40792. //所有文件导入完成之后调用
  40793. };
  40794. function save() {
  40795. temp = chunks[j];
  40796. memo = i;
  40797. current = i;
  40798. }
  40799. function restore() {
  40800. chunks[j] = temp;
  40801. i = memo;
  40802. current = i;
  40803. }
  40804. function sync() {
  40805. if (i > current) {
  40806. chunks[j] = chunks[j].slice(i - current);
  40807. current = i;
  40808. }
  40809. } //
  40810. // Parse from a token, regexp or string, and move forward if match
  40811. //
  40812. function _match(tok) {
  40813. var match, length, c, endIndex; // Non-terminal
  40814. if (tok instanceof Function) {
  40815. return tok.call(parser.parsers); // Terminal
  40816. // Either match a single character in the input,
  40817. // or match a regexp in the current chunk (chunk[j]).
  40818. } else if (typeof tok === 'string') {
  40819. match = input.charAt(i) === tok ? tok : null;
  40820. length = 1;
  40821. sync();
  40822. } else {
  40823. sync();
  40824. match = tok.exec(chunks[j]);
  40825. if (match) {
  40826. length = match[0].length;
  40827. } else {
  40828. return null;
  40829. }
  40830. } // The match is confirmed, add the match length to `i`,
  40831. // and consume any extra white-space characters (' ' || '\n')
  40832. // which come after that. The reason for this is that LeSS's
  40833. // grammar is mostly white-space insensitive.
  40834. if (match) {
  40835. var mem = i += length;
  40836. endIndex = i + chunks[j].length - length;
  40837. while (i < endIndex) {
  40838. c = input.charCodeAt(i);
  40839. if (!(c === 32 || c === 10 || c === 9)) {
  40840. break;
  40841. }
  40842. i++;
  40843. }
  40844. chunks[j] = chunks[j].slice(length + (i - mem));
  40845. current = i;
  40846. if (chunks[j].length === 0 && j < chunks.length - 1) {
  40847. j++;
  40848. }
  40849. if (typeof match === 'string') {
  40850. return match;
  40851. } else {
  40852. return match.length === 1 ? match[0] : match;
  40853. }
  40854. }
  40855. } // Same as _match(), but don't change the state of the parser,
  40856. // just return the match.
  40857. function peek(tok) {
  40858. if (typeof tok === 'string') {
  40859. return input.charAt(i) === tok;
  40860. } else {
  40861. return !!tok.test(chunks[j]);
  40862. }
  40863. } // Make an error object from a passed set of properties.
  40864. // Accepted properties:
  40865. // - `message`: Text of the error message.
  40866. // - `filename`: Filename where the error occurred.
  40867. // - `index`: Char. index where the error occurred.
  40868. function makeError(err) {
  40869. var einput;
  40870. var defautls = {
  40871. index: furthest,
  40872. filename: env.filename,
  40873. message: 'Parse error.',
  40874. line: 0,
  40875. column: -1
  40876. };
  40877. for (var prop in defautls) {
  40878. if (err[prop] === 0) {
  40879. err[prop] = defautls[prop];
  40880. }
  40881. }
  40882. if (err.filename && that.env.inputs && that.env.inputs[err.filename]) {
  40883. einput = that.env.inputs[err.filename];
  40884. } else {
  40885. einput = input;
  40886. }
  40887. err.line = (einput.slice(0, err.index).match(/\n/g) || '').length + 1;
  40888. for (var n = err.index; n >= 0 && einput.charAt(n) !== '\n'; n--) {
  40889. err.column++;
  40890. }
  40891. return new Error([err.filename, err.line, err.column, err.message].join(";"));
  40892. }
  40893. this.env = env = env || {};
  40894. this.env.filename = this.env.filename || null;
  40895. this.env.inputs = this.env.inputs || {}; // The Parser
  40896. parser = {
  40897. // Parse an input string into an abstract syntax tree.
  40898. // Throws an error on parse errors.
  40899. parse: function parse(str) {
  40900. var root,
  40901. error = null;
  40902. i = j = current = furthest = 0;
  40903. chunks = [];
  40904. input = str.replace(/\r\n/g, '\n');
  40905. if (env.filename) {
  40906. that.env.inputs[env.filename] = input;
  40907. } // Split the input into chunks.
  40908. chunks = function (chunks) {
  40909. var j = 0,
  40910. skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
  40911. comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
  40912. string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
  40913. level = 0,
  40914. match,
  40915. chunk = chunks[0],
  40916. inParam;
  40917. for (var i = 0, c, cc; i < input.length;) {
  40918. skip.lastIndex = i;
  40919. if (match = skip.exec(input)) {
  40920. if (match.index === i) {
  40921. i += match[0].length;
  40922. chunk.push(match[0]);
  40923. }
  40924. }
  40925. c = input.charAt(i);
  40926. comment.lastIndex = string.lastIndex = i;
  40927. if (match = string.exec(input)) {
  40928. if (match.index === i) {
  40929. i += match[0].length;
  40930. chunk.push(match[0]);
  40931. continue;
  40932. }
  40933. }
  40934. if (!inParam && c === '/') {
  40935. cc = input.charAt(i + 1);
  40936. if (cc === '/' || cc === '*') {
  40937. if (match = comment.exec(input)) {
  40938. if (match.index === i) {
  40939. i += match[0].length;
  40940. chunk.push(match[0]);
  40941. continue;
  40942. }
  40943. }
  40944. }
  40945. }
  40946. switch (c) {
  40947. case '{':
  40948. //NOSONAR
  40949. if (!inParam) {
  40950. level++;
  40951. chunk.push(c);
  40952. break;
  40953. }
  40954. case '}':
  40955. //NOSONAR
  40956. if (!inParam) {
  40957. level--;
  40958. chunk.push(c);
  40959. chunks[++j] = chunk = [];
  40960. break;
  40961. }
  40962. case '(':
  40963. //NOSONAR
  40964. if (!inParam) {
  40965. inParam = true;
  40966. chunk.push(c);
  40967. break;
  40968. }
  40969. case ')':
  40970. //NOSONAR
  40971. if (inParam) {
  40972. inParam = false;
  40973. chunk.push(c);
  40974. break;
  40975. }
  40976. default:
  40977. chunk.push(c);
  40978. break;
  40979. }
  40980. i++;
  40981. }
  40982. if (level !== 0) {
  40983. error = {
  40984. index: i - 1,
  40985. type: 'Parse',
  40986. message: level > 0 ? "missing closing `}`" : "missing opening `{`"
  40987. };
  40988. }
  40989. return chunks.map(function (c) {
  40990. return c.join('');
  40991. });
  40992. }([[]]);
  40993. if (error) {
  40994. throw makeError(error);
  40995. } // Sort rules by specificity: this function expects selectors to be
  40996. // split already.
  40997. //
  40998. // Written to be used as a .sort(Function);
  40999. // argument.
  41000. //
  41001. // [1, 0, 0, 467] > [0, 0, 1, 520]
  41002. var specificitySort = function specificitySort(a, b) {
  41003. var as = a.specificity;
  41004. var bs = b.specificity;
  41005. if (as[0] != bs[0]) {
  41006. return bs[0] - as[0];
  41007. }
  41008. if (as[1] != bs[1]) {
  41009. return bs[1] - as[1];
  41010. }
  41011. if (as[2] != bs[2]) {
  41012. return bs[2] - as[2];
  41013. }
  41014. return bs[3] - as[3];
  41015. }; // Start with the primary rule.
  41016. // The whole syntax tree is held under a Ruleset node,
  41017. // with the `root` property set to true, so no `{}` are
  41018. // output.
  41019. root = new SuperMap.CartoCSS.Tree.Ruleset([], _match(this.parsers.primary));
  41020. root.root = true; // Get an array of Ruleset objects, flattened
  41021. // and sorted according to specificitySort
  41022. root.toList = function () {
  41023. return function (env) {
  41024. env.error = function (e) {
  41025. if (!env.errors) {
  41026. env.errors = new Error('');
  41027. }
  41028. if (env.errors.message) {
  41029. env.errors.message += '\n' + makeError(e).message;
  41030. } else {
  41031. env.errors.message = makeError(e).message;
  41032. }
  41033. };
  41034. env.frames = env.frames || []; // call populates Invalid-caused errors
  41035. var definitions = this.flatten([], [], env);
  41036. definitions.sort(specificitySort);
  41037. return definitions;
  41038. };
  41039. }();
  41040. return root;
  41041. },
  41042. // Here in, the parsing rules/functions
  41043. //
  41044. // The basic structure of the syntax tree generated is as follows:
  41045. //
  41046. // Ruleset -> Rule -> Value -> Expression -> Entity
  41047. //
  41048. // In general, most rules will try to parse a token with the `_match()` function, and if the return
  41049. // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
  41050. // first, before parsing, that's when we use `peek()`.
  41051. parsers: {
  41052. // The `primary` rule is the *entry* and *exit* point of the parser.
  41053. // The rules here can appear at any level of the parse tree.
  41054. //
  41055. // The recursive nature of the grammar is an interplay between the `block`
  41056. // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
  41057. // as represented by this simplified grammar:
  41058. //
  41059. // primary → (ruleset | rule)+
  41060. // ruleset → selector+ block
  41061. // block → '{' primary '}'
  41062. //
  41063. // Only at one point is the primary rule not called from the
  41064. // block rule: at the root level.
  41065. primary: function primary() {
  41066. var node,
  41067. root = [];
  41068. while ((node = _match(this.rule) || _match(this.ruleset) || _match(this.comment)) || _match(/^[\s\n]+/) || (node = _match(this.invalid))) {
  41069. if (node) {
  41070. root.push(node);
  41071. }
  41072. }
  41073. return root;
  41074. },
  41075. invalid: function invalid() {
  41076. var chunk = _match(/^[^;\n]*[;\n]/); // To fail gracefully, match everything until a semicolon or linebreak.
  41077. if (chunk) {
  41078. return new SuperMap.CartoCSS.Tree.Invalid(chunk, memo);
  41079. }
  41080. },
  41081. // We create a Comment node for CSS comments `/* */`,
  41082. // but keep the LeSS comments `//` silent, by just skipping
  41083. // over them.
  41084. comment: function comment() {
  41085. var comment;
  41086. if (input.charAt(i) !== '/') {
  41087. return;
  41088. }
  41089. if (input.charAt(i + 1) === '/') {
  41090. return new SuperMap.CartoCSS.Tree.Comment(_match(/^\/\/.*/), true);
  41091. } else if (comment = _match(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
  41092. return new SuperMap.CartoCSS.Tree.Comment(comment);
  41093. }
  41094. },
  41095. // Entities are tokens which can be found inside an Expression
  41096. entities: {
  41097. // A string, which supports escaping " and ' "milky way" 'he\'s the one!'
  41098. quoted: function quoted() {
  41099. if (input.charAt(i) !== '"' && input.charAt(i) !== "'") {
  41100. return;
  41101. }
  41102. var str = _match(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);
  41103. if (str) {
  41104. return new SuperMap.CartoCSS.Tree.Quoted(str[1] || str[2]);
  41105. }
  41106. },
  41107. // A reference to a Mapnik field, like [NAME]
  41108. // Behind the scenes, this has the same representation, but Carto
  41109. // needs to be careful to warn when unsupported operations are used.
  41110. field: function field() {
  41111. var l = '[',
  41112. r = ']';
  41113. if (!_match(l)) {
  41114. return;
  41115. }
  41116. var field_name = _match(/(^[^\]]+)/);
  41117. if (!_match(r)) {
  41118. return;
  41119. }
  41120. if (field_name) {
  41121. return new SuperMap.CartoCSS.Tree.Field(field_name[1]);
  41122. }
  41123. },
  41124. // This is a comparison operator
  41125. comparison: function comparison() {
  41126. var str = _match(/^=~|=|!=|<=|>=|<|>/);
  41127. if (str) {
  41128. return str;
  41129. }
  41130. },
  41131. // A catch-all word, such as: hard-light
  41132. // These can start with either a letter or a dash (-),
  41133. // and then contain numbers, underscores, and letters.
  41134. keyword: function keyword() {
  41135. var k = _match(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);
  41136. if (k) {
  41137. return new SuperMap.CartoCSS.Tree.Keyword(k);
  41138. }
  41139. },
  41140. // A function call like rgb(255, 0, 255)
  41141. // The arguments are parsed with the `entities.arguments` parser.
  41142. call: function call() {
  41143. var name, args;
  41144. if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) {
  41145. return;
  41146. }
  41147. name = name[1];
  41148. if (name === 'url') {
  41149. // url() is handled by the url parser instead
  41150. return null;
  41151. } else {
  41152. i += name.length;
  41153. }
  41154. var l = '(',
  41155. r = ')';
  41156. _match(l); // Parse the '(' and consume whitespace.
  41157. args = _match(this.entities['arguments']);
  41158. if (!_match(r)) {
  41159. return;
  41160. }
  41161. if (name) {
  41162. return new SuperMap.CartoCSS.Tree.Call(name, args, i);
  41163. }
  41164. },
  41165. // Arguments are comma-separated expressions
  41166. 'arguments': function _arguments() {
  41167. var args = [],
  41168. arg;
  41169. while (arg = _match(this.expression)) {
  41170. args.push(arg);
  41171. var q = ',';
  41172. if (!_match(q)) {
  41173. break;
  41174. }
  41175. }
  41176. return args;
  41177. },
  41178. literal: function literal() {
  41179. return _match(this.entities.dimension) || _match(this.entities.keywordcolor) || _match(this.entities.hexcolor) || _match(this.entities.quoted);
  41180. },
  41181. // Parse url() tokens
  41182. //
  41183. // We use a specific rule for urls, because they don't really behave like
  41184. // standard function calls. The difference is that the argument doesn't have
  41185. // to be enclosed within a string, so it can't be parsed as an Expression.
  41186. url: function url() {
  41187. var value;
  41188. if (input.charAt(i) !== 'u' || !_match(/^url\(/)) {
  41189. return;
  41190. }
  41191. value = _match(this.entities.quoted) || _match(this.entities.variable) || _match(/^[\-\w%@_match\/.&=:;#+?~]+/) || '';
  41192. var r = ')';
  41193. if (!_match(r)) {
  41194. return new SuperMap.CartoCSS.Tree.Invalid(value, memo, 'Missing closing ) in URL.');
  41195. } else {
  41196. return new SuperMap.CartoCSS.Tree.URL(typeof value.value !== 'undefined' || value instanceof SuperMap.CartoCSS.Tree.Variable ? value : new SuperMap.CartoCSS.Tree.Quoted(value));
  41197. }
  41198. },
  41199. // A Variable entity, such as `@fink`, in
  41200. //
  41201. // width: @fink + 2px
  41202. //
  41203. // We use a different parser for variable definitions,
  41204. // see `parsers.variable`.
  41205. variable: function variable() {
  41206. var name,
  41207. index = i;
  41208. if (input.charAt(i) === '@' && (name = _match(/^@[\w-]+/))) {
  41209. return new SuperMap.CartoCSS.Tree.Variable(name, index, env.filename);
  41210. }
  41211. },
  41212. hexcolor: function hexcolor() {
  41213. var rgb;
  41214. if (input.charAt(i) === '#' && (rgb = _match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
  41215. return new SuperMap.CartoCSS.Tree.Color(rgb[1]);
  41216. }
  41217. },
  41218. keywordcolor: function keywordcolor() {
  41219. var rgb = chunks[j].match(/^[a-z]+/);
  41220. if (rgb && rgb[0] in SuperMap.CartoCSS.Tree.Reference.data.colors) {
  41221. return new SuperMap.CartoCSS.Tree.Color(SuperMap.CartoCSS.Tree.Reference.data.colors[_match(/^[a-z]+/)]);
  41222. }
  41223. },
  41224. // A Dimension, that is, a number and a unit. The only
  41225. // unit that has an effect is %
  41226. dimension: function dimension() {
  41227. var c = input.charCodeAt(i);
  41228. if (c > 57 || c < 45 || c === 47) {
  41229. return;
  41230. }
  41231. var value = _match(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);
  41232. if (value) {
  41233. return new SuperMap.CartoCSS.Tree.Dimension(value[1], value[2], memo);
  41234. }
  41235. }
  41236. },
  41237. // The variable part of a variable definition.
  41238. // Used in the `rule` parser. Like @fink:
  41239. variable: function variable() {
  41240. var name;
  41241. if (input.charAt(i) === '@' && (name = _match(/^(@[\w-]+)\s*:/))) {
  41242. return name[1];
  41243. }
  41244. },
  41245. // Entities are the smallest recognized token,
  41246. // and can be found inside a rule's value.
  41247. entity: function entity() {
  41248. var property1 = _match(this.entities.call) || _match(this.entities.literal);
  41249. var property2 = _match(this.entities.field) || _match(this.entities.variable);
  41250. var property3 = _match(this.entities.url) || _match(this.entities.keyword);
  41251. return property1 || property2 || property3;
  41252. },
  41253. // A Rule terminator. Note that we use `peek()` to check for '}',
  41254. // because the `block` rule will be expecting it, but we still need to make sure
  41255. // it's there, if ';' was ommitted.
  41256. end: function end() {
  41257. var q = ';';
  41258. return _match(q) || peek('}');
  41259. },
  41260. // Elements are the building blocks for Selectors. They consist of
  41261. // an element name, such as a tag a class, or `*`.
  41262. //增加对中文的支持,[\u4e00-\u9fa5]
  41263. element: function element() {
  41264. var e = _match(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);
  41265. if (e) {
  41266. return new SuperMap.CartoCSS.Tree.Element(e);
  41267. }
  41268. },
  41269. // Attachments allow adding multiple lines, polygons etc. to an
  41270. // object. There can only be one attachment per selector.
  41271. attachment: function attachment() {
  41272. var s = _match(/^::([\w\-]+(?:\/[\w\-]+)*)/);
  41273. if (s) {
  41274. return s[1];
  41275. }
  41276. },
  41277. // Selectors are made out of one or more Elements, see above.
  41278. selector: function selector() {
  41279. var a,
  41280. attachment,
  41281. e,
  41282. elements = [],
  41283. f,
  41284. filters = new SuperMap.CartoCSS.Tree.Filterset(),
  41285. z,
  41286. zooms = [],
  41287. segments = 0,
  41288. conditions = 0;
  41289. while ((e = _match(this.element)) || (z = _match(this.zoom)) || (f = _match(this.filter)) || (a = _match(this.attachment))) {
  41290. segments++;
  41291. if (e) {
  41292. elements.push(e);
  41293. } else if (z) {
  41294. zooms.push(z);
  41295. conditions++;
  41296. } else if (f) {
  41297. var err = filters.add(f);
  41298. if (err) {
  41299. throw makeError({
  41300. message: err,
  41301. index: i - 1
  41302. });
  41303. }
  41304. conditions++;
  41305. } else if (attachment) {
  41306. throw makeError({
  41307. message: 'Encountered second attachment name.',
  41308. index: i - 1
  41309. });
  41310. } else {
  41311. attachment = a;
  41312. }
  41313. var c = input.charAt(i);
  41314. if (c === '{' || c === '}' || c === ';' || c === ',') {
  41315. break;
  41316. }
  41317. }
  41318. if (segments) {
  41319. return new SuperMap.CartoCSS.Tree.Selector(filters, zooms, elements, attachment, conditions, memo);
  41320. }
  41321. },
  41322. filter: function filter() {
  41323. save();
  41324. var key,
  41325. op,
  41326. val,
  41327. l = '[',
  41328. r = ']';
  41329. if (!_match(l)) {
  41330. return;
  41331. }
  41332. if (key = _match(/^[a-zA-Z0-9\-_]+/) || _match(this.entities.quoted) || _match(this.entities.variable) || _match(this.entities.keyword) || _match(this.entities.field)) {
  41333. if (key instanceof SuperMap.CartoCSS.Tree.Quoted) {
  41334. key = new SuperMap.CartoCSS.Tree.Field(key.toString());
  41335. }
  41336. 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))) {
  41337. if (!_match(r)) {
  41338. throw makeError({
  41339. message: 'Missing closing ] of filter.',
  41340. index: memo - 1
  41341. });
  41342. }
  41343. if (!key.is) {
  41344. key = new SuperMap.CartoCSS.Tree.Field(key);
  41345. }
  41346. return new SuperMap.CartoCSS.Tree.Filter(key, op, val, memo, env.filename);
  41347. }
  41348. }
  41349. },
  41350. zoom: function zoom() {
  41351. save();
  41352. var op,
  41353. val,
  41354. r = ']';
  41355. if (_match(/^\[\s*zoom/g) && (op = _match(this.entities.comparison)) && (val = _match(this.entities.variable) || _match(this.entities.dimension)) && _match(r)) {
  41356. return new SuperMap.CartoCSS.Tree.Zoom(op, val, memo);
  41357. } else {
  41358. // backtrack
  41359. restore();
  41360. }
  41361. },
  41362. // The `block` rule is used by `ruleset`
  41363. // It's a wrapper around the `primary` rule, with added `{}`.
  41364. block: function block() {
  41365. var content,
  41366. l = '{',
  41367. r = '}';
  41368. if (_match(l) && (content = _match(this.primary)) && _match(r)) {
  41369. return content;
  41370. }
  41371. },
  41372. // div, .class, body > p {...}
  41373. ruleset: function ruleset() {
  41374. var selectors = [],
  41375. s,
  41376. rules,
  41377. q = ',';
  41378. save();
  41379. while (s = _match(this.selector)) {
  41380. selectors.push(s);
  41381. while (_match(this.comment)) {//NOSONAR
  41382. }
  41383. if (!_match(q)) {
  41384. break;
  41385. }
  41386. while (_match(this.comment)) {//NOSONAR
  41387. }
  41388. }
  41389. if (s) {
  41390. while (_match(this.comment)) {//NOSONAR
  41391. }
  41392. }
  41393. if (selectors.length > 0 && (rules = _match(this.block))) {
  41394. if (selectors.length === 1 && selectors[0].elements.length && selectors[0].elements[0].value === 'Map') {
  41395. var rs = new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  41396. rs.isMap = true;
  41397. return rs;
  41398. }
  41399. return new SuperMap.CartoCSS.Tree.Ruleset(selectors, rules);
  41400. } else {
  41401. // Backtrack
  41402. restore();
  41403. }
  41404. },
  41405. rule: function rule() {
  41406. var name,
  41407. value,
  41408. c = input.charAt(i);
  41409. save();
  41410. if (c === '.' || c === '#') {
  41411. return;
  41412. }
  41413. if (name = _match(this.variable) || _match(this.property)) {
  41414. value = _match(this.value);
  41415. if (value && _match(this.end)) {
  41416. return new SuperMap.CartoCSS.Tree.Rule(name, value, memo, env.filename);
  41417. } else {
  41418. furthest = i;
  41419. restore();
  41420. }
  41421. }
  41422. },
  41423. font: function font() {
  41424. var value = [],
  41425. expression = [],
  41426. e,
  41427. q = ',';
  41428. while (e = _match(this.entity)) {
  41429. expression.push(e);
  41430. }
  41431. value.push(new SuperMap.CartoCSS.Tree.Expression(expression));
  41432. if (_match(q)) {
  41433. while (e = _match(this.expression)) {
  41434. value.push(e);
  41435. if (!_match(q)) {
  41436. break;
  41437. }
  41438. }
  41439. }
  41440. return new SuperMap.CartoCSS.Tree.Value(value);
  41441. },
  41442. // A Value is a comma-delimited list of Expressions
  41443. // In a Rule, a Value represents everything after the `:`,
  41444. // and before the `;`.
  41445. value: function value() {
  41446. var e,
  41447. expressions = [],
  41448. q = ',';
  41449. while (e = _match(this.expression)) {
  41450. expressions.push(e);
  41451. if (!_match(q)) {
  41452. break;
  41453. }
  41454. }
  41455. if (expressions.length > 1) {
  41456. return new SuperMap.CartoCSS.Tree.Value(expressions.map(function (e) {
  41457. return e.value[0];
  41458. }));
  41459. } else if (expressions.length === 1) {
  41460. return new SuperMap.CartoCSS.Tree.Value(expressions);
  41461. }
  41462. },
  41463. // A sub-expression, contained by parenthensis
  41464. sub: function sub() {
  41465. var e,
  41466. l = '(',
  41467. r = ")";
  41468. if (_match(l) && (e = _match(this.expression)) && _match(r)) {
  41469. return e;
  41470. }
  41471. },
  41472. // This is a misnomer because it actually handles multiplication
  41473. // and division.
  41474. multiplication: function multiplication() {
  41475. var m,
  41476. a,
  41477. op,
  41478. operation,
  41479. q = '/';
  41480. if (m = _match(this.operand)) {
  41481. while ((op = _match(q) || _match('*') || _match('%')) && (a = _match(this.operand))) {
  41482. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  41483. }
  41484. return operation || m;
  41485. }
  41486. },
  41487. addition: function addition() {
  41488. var m,
  41489. a,
  41490. op,
  41491. operation,
  41492. plus = '+';
  41493. if (m = _match(this.multiplication)) {
  41494. while ((op = _match(/^[-+]\s+/) || input.charAt(i - 1) != ' ' && (_match(plus) || _match('-'))) && (a = _match(this.multiplication))) {
  41495. operation = new SuperMap.CartoCSS.Tree.Operation(op, [operation || m, a], memo);
  41496. }
  41497. return operation || m;
  41498. }
  41499. },
  41500. // An operand is anything that can be part of an operation,
  41501. // such as a Color, or a Variable
  41502. operand: function operand() {
  41503. return _match(this.sub) || _match(this.entity);
  41504. },
  41505. // Expressions either represent mathematical operations,
  41506. // or white-space delimited Entities. @var * 2
  41507. expression: function expression() {
  41508. var e,
  41509. entities = [];
  41510. while (e = _match(this.addition) || _match(this.entity)) {
  41511. entities.push(e);
  41512. }
  41513. if (entities.length > 0) {
  41514. return new SuperMap.CartoCSS.Tree.Expression(entities);
  41515. }
  41516. },
  41517. property: function property() {
  41518. var name = _match(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);
  41519. if (name) {
  41520. return name[1];
  41521. }
  41522. }
  41523. }
  41524. };
  41525. return parser;
  41526. }
  41527. /**
  41528. * @function SuperMap.CartoCSS.prototype.parse
  41529. * @description 利用CartoCSS解析器里面的parse方法,将CartoCSS样式表字符串转化为CartoCSS规则集
  41530. * @returns {Object} CartoCSS规则集
  41531. */
  41532. }, {
  41533. key: "parse",
  41534. value: function parse(str) {
  41535. var parser = this.parser;
  41536. var ruleSet = this.ruleSet = parser.parse(str);
  41537. return ruleSet;
  41538. }
  41539. /**
  41540. * @function SuperMap.CartoCSS.prototype.toShaders
  41541. * @description 将CartoCSS规则集转化为着色器
  41542. * @returns {Array} CartoCSS着色器集
  41543. */
  41544. }, {
  41545. key: "toShaders",
  41546. value: function toShaders() {
  41547. if (this.ruleSet) {
  41548. var ruleset = this.ruleSet;
  41549. if (ruleset) {
  41550. var defs = ruleset.toList(this.env);
  41551. defs.reverse();
  41552. var shaders = {};
  41553. var keys = [];
  41554. this._toShaders(shaders, keys, defs);
  41555. var ordered_shaders = [];
  41556. var done = {};
  41557. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  41558. var def = defs[i];
  41559. var k = def.attachment;
  41560. var shader = shaders[keys[i]];
  41561. var shaderArray = [];
  41562. if (!done[k]) {
  41563. var j = 0;
  41564. for (var prop in shader) {
  41565. if (prop !== 'zoom' && prop !== 'frames' && prop !== "attachment" && prop != "elements") {
  41566. //对layer-index作特殊处理以实现图层的控制
  41567. if (prop === "layer-index") {
  41568. /*var getLayerIndex = Function("attributes", "zoom", "var _value = null;" + shader[prop].join('\n') + "; return _value; ");*/
  41569. var getLayerIndex = function getLayerIndex(attributes, zoom) {
  41570. //NOSONAR
  41571. var _value = null;
  41572. shader[prop].join('\n');
  41573. return _value;
  41574. };
  41575. var layerIndex = getLayerIndex();
  41576. Object.defineProperty(shaderArray, "layerIndex", {
  41577. configurable: true,
  41578. enumerable: false,
  41579. value: layerIndex
  41580. });
  41581. } else {
  41582. shaderArray[j++] = function (ops, shaderArray) {
  41583. //NOSONAR
  41584. if (!Array.isArray(ops)) {
  41585. return ops;
  41586. }
  41587. var body = ops.join('\n');
  41588. var myKeyword = 'attributes["FEATUREID"]&&attributes["FEATUREID"]';
  41589. var index = body.indexOf(myKeyword);
  41590. if (index >= 0) {
  41591. //对featureID作一些特殊处理,以将featureID提取出来
  41592. if (!shaderArray.featureFilter) {
  41593. var featureFilterStart = index + myKeyword.length;
  41594. var featureFilterEnd = body.indexOf(")", featureFilterStart + 1);
  41595. var featureFilterStr = "featureId&&(featureId" + body.substring(featureFilterStart, featureFilterEnd) + ")";
  41596. /*var featureFilter = Function("featureId", "if(" + featureFilterStr + "){return true;}return false;");*/
  41597. var featureFilter = function featureFilter(featureId) {
  41598. if (featureFilterStr) {
  41599. return true;
  41600. }
  41601. return false;
  41602. };
  41603. Object.defineProperty(shaderArray, "featureFilter", {
  41604. configurable: true,
  41605. enumerable: false,
  41606. value: featureFilter
  41607. });
  41608. }
  41609. return {
  41610. "property": prop,
  41611. "getValue": Function("attributes", "zoom", "seftFilter", "var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){" + body + ";} return _value; ") //NOSONAR
  41612. };
  41613. } else {
  41614. return {
  41615. "property": prop,
  41616. "getValue": Function("attributes", "zoom", "var _value = null;" + body + "; return _value; ") //NOSONAR
  41617. };
  41618. }
  41619. }(shader[prop], shaderArray);
  41620. }
  41621. }
  41622. }
  41623. Object.defineProperty(shaderArray, "attachment", {
  41624. configurable: true,
  41625. enumerable: false,
  41626. value: k
  41627. });
  41628. Object.defineProperty(shaderArray, "elements", {
  41629. configurable: true,
  41630. enumerable: false,
  41631. value: def.elements
  41632. });
  41633. ordered_shaders.push(shaderArray);
  41634. done[keys[i]] = true;
  41635. }
  41636. Object.defineProperty(shaderArray, "zoom", {
  41637. configurable: true,
  41638. enumerable: false,
  41639. value: def.zoom
  41640. }); //shader.frames.push(def.frame_offset);
  41641. }
  41642. return ordered_shaders;
  41643. }
  41644. }
  41645. return null;
  41646. }
  41647. }, {
  41648. key: "_toShaders",
  41649. value: function _toShaders(shaders, keys, defs) {
  41650. for (var i = 0, len0 = defs.length; i < len0; ++i) {
  41651. var def = defs[i];
  41652. var element_str = [];
  41653. for (var j = 0, len1 = def.elements.length; j < len1; j++) {
  41654. element_str.push(def.elements[j]);
  41655. }
  41656. var filters = def.filters.filters;
  41657. var filterStr = [];
  41658. for (var attr in filters) {
  41659. filterStr.push(filters[attr].id);
  41660. }
  41661. var key = element_str.join("/") + "::" + def.attachment + "_" + filterStr.join("_");
  41662. keys.push(key);
  41663. var shader = shaders[key] = shaders[key] || {}; //shader.frames = [];
  41664. shader.zoom = SuperMap.CartoCSS.Tree.Zoom.all;
  41665. var props = def.toJS(this.env);
  41666. for (var v in props) {
  41667. (shader[v] = shader[v] || []).push(props[v].join('\n'));
  41668. }
  41669. }
  41670. }
  41671. /**
  41672. * @function SuperMap.CartoCSS.prototype.getShaders
  41673. * @description 获取CartoCSS着色器
  41674. * @returns {Array} 着色器集
  41675. * @example
  41676. * //shaders的结构大概如下:
  41677. * var shaders=[
  41678. * {
  41679. * attachment:"one",
  41680. * elements:[],
  41681. * zoom:23,
  41682. * length:2,
  41683. * 0:{property:"line-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  41684. * 1:{preoperty:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  41685. * },
  41686. * {
  41687. * attachment:"two",
  41688. * elements:[],
  41689. * zoom:23,
  41690. * length:2,
  41691. * 0:{property:"polygon-color",value:function(attribute,zoom){var _value=null;if(zoom){_value="#123456"}return _vlaue;}},
  41692. * 1:{property:"line-width",value:function(attribute,zoom){var _value=null;if(zoom){_value=3}return _vlaue;}}
  41693. * }
  41694. * ];
  41695. */
  41696. }, {
  41697. key: "getShaders",
  41698. value: function getShaders() {
  41699. return this.shaders;
  41700. }
  41701. /**
  41702. * @function SuperMap.CartoCSS.prototype.destroy
  41703. * @description CartoCSS解析对象的析构函数,用于销毁CartoCSS解析对象
  41704. */
  41705. }, {
  41706. key: "destroy",
  41707. value: function destroy() {
  41708. this.cartoStr = null;
  41709. this.env = null;
  41710. this.ruleSet = null;
  41711. this.parser = null;
  41712. this.shaders = null;
  41713. }
  41714. }]);
  41715. return CartoCSS;
  41716. }();
  41717. SuperMap._mapnik_reference_latest = {
  41718. "version": "2.1.1",
  41719. "style": {
  41720. "filter-mode": {
  41721. "type": ["all", "first"],
  41722. "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)",
  41723. "default-value": "all",
  41724. "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."
  41725. },
  41726. "image-filters": {
  41727. "css": "image-filters",
  41728. "default-value": "none",
  41729. "default-meaning": "no filters",
  41730. "type": "functions",
  41731. "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]],
  41732. "doc": "A list of image filters."
  41733. },
  41734. "comp-op": {
  41735. "css": "comp-op",
  41736. "default-value": "src-over",
  41737. "default-meaning": "add the current layer on top of other layers",
  41738. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  41739. "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"]
  41740. },
  41741. "opacity": {
  41742. "css": "opacity",
  41743. "type": "float",
  41744. "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)",
  41745. "default-value": 1,
  41746. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  41747. }
  41748. },
  41749. "layer": {
  41750. "name": {
  41751. "default-value": "",
  41752. "type": "string",
  41753. "required": true,
  41754. "default-meaning": "No layer name has been provided",
  41755. "doc": "The name of a layer. Can be anything you wish and is not strictly validated, but ideally unique in the map"
  41756. },
  41757. "srs": {
  41758. "default-value": "",
  41759. "type": "string",
  41760. "default-meaning": "No srs value is provided and the value will be inherited from the Map's srs",
  41761. "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'"
  41762. },
  41763. "status": {
  41764. "default-value": true,
  41765. "type": "boolean",
  41766. "default-meaning": "This layer will be marked as active and available for processing",
  41767. "doc": "A property that can be set to false to disable this layer from being processed"
  41768. },
  41769. "minzoom": {
  41770. "default-value": "0",
  41771. "type": "float",
  41772. "default-meaning": "The layer will be visible at the minimum possible scale",
  41773. "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"
  41774. },
  41775. "maxzoom": {
  41776. "default-value": "1.79769e+308",
  41777. "type": "float",
  41778. "default-meaning": "The layer will be visible at the maximum possible scale",
  41779. "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"
  41780. },
  41781. "queryable": {
  41782. "default-value": false,
  41783. "type": "boolean",
  41784. "default-meaning": "The layer will not be available for the direct querying of data values",
  41785. "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"
  41786. },
  41787. "clear-label-cache": {
  41788. "default-value": false,
  41789. "type": "boolean",
  41790. "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",
  41791. "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"
  41792. },
  41793. "group-by": {
  41794. "default-value": "",
  41795. "type": "string",
  41796. "default-meaning": "No special layer grouping will be used during rendering",
  41797. "doc": "https://github.com/mapnik/mapnik/wiki/Grouped-rendering"
  41798. },
  41799. "buffer-size": {
  41800. "default-value": "0",
  41801. "type": "float",
  41802. "default-meaning": "No buffer will be used",
  41803. "doc": "Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"
  41804. },
  41805. "maximum-extent": {
  41806. "default-value": "none",
  41807. "type": "bbox",
  41808. "default-meaning": "No clipping extent will be used",
  41809. "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."
  41810. }
  41811. },
  41812. "symbolizers": {
  41813. "*": {
  41814. "image-filters": {
  41815. "css": "image-filters",
  41816. "default-value": "none",
  41817. "default-meaning": "no filters",
  41818. "type": "functions",
  41819. "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]],
  41820. "doc": "A list of image filters."
  41821. },
  41822. "comp-op": {
  41823. "css": "comp-op",
  41824. "default-value": "src-over",
  41825. "default-meaning": "add the current layer on top of other layers",
  41826. "doc": "Composite operation. This defines how this layer should behave relative to layers atop or below it.",
  41827. "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"]
  41828. },
  41829. "opacity": {
  41830. "css": "opacity",
  41831. "type": "float",
  41832. "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)",
  41833. "default-value": 1,
  41834. "default-meaning": "no separate buffer will be used and no alpha will be applied to the style after rendering"
  41835. }
  41836. },
  41837. "map": {
  41838. "background-color": {
  41839. "css": "background-color",
  41840. "default-value": "none",
  41841. "default-meaning": "transparent",
  41842. "type": "color",
  41843. "doc": "Map Background color"
  41844. },
  41845. "background-image": {
  41846. "css": "background-image",
  41847. "type": "uri",
  41848. "default-value": "",
  41849. "default-meaning": "transparent",
  41850. "doc": "An image that is repeated below all features on a map as a background.",
  41851. "description": "Map Background image"
  41852. },
  41853. "srs": {
  41854. "css": "srs",
  41855. "type": "string",
  41856. "default-value": "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
  41857. "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",
  41858. "doc": "Map spatial reference (proj4 string)"
  41859. },
  41860. "buffer-size": {
  41861. "css": "buffer-size",
  41862. "default-value": "0",
  41863. "type": "float",
  41864. "default-meaning": "No buffer will be used",
  41865. "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\"."
  41866. },
  41867. "maximum-extent": {
  41868. "css": "",
  41869. "default-value": "none",
  41870. "type": "bbox",
  41871. "default-meaning": "No clipping extent will be used",
  41872. "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."
  41873. },
  41874. "base": {
  41875. "css": "base",
  41876. "default-value": "",
  41877. "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.",
  41878. "type": "string",
  41879. "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."
  41880. },
  41881. "paths-from-xml": {
  41882. "css": "",
  41883. "default-value": true,
  41884. "default-meaning": "Paths read from XML will be interpreted from the location of the XML",
  41885. "type": "boolean",
  41886. "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()"
  41887. },
  41888. "minimum-version": {
  41889. "css": "",
  41890. "default-value": "none",
  41891. "default-meaning": "Mapnik version will not be detected and no error will be thrown about compatibility",
  41892. "type": "string",
  41893. "doc": "The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"
  41894. },
  41895. "font-directory": {
  41896. "css": "font-directory",
  41897. "type": "uri",
  41898. "default-value": "none",
  41899. "default-meaning": "No map-specific fonts will be registered",
  41900. "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)."
  41901. }
  41902. },
  41903. "polygon": {
  41904. "fill": {
  41905. "css": "polygon-fill",
  41906. "type": "color",
  41907. "default-value": "rgba(128,128,128,1)",
  41908. "default-meaning": "gray and fully opaque (alpha = 1), same as rgb(128,128,128)",
  41909. "doc": "Fill color to assign to a polygon"
  41910. },
  41911. "fill-opacity": {
  41912. "css": "polygon-opacity",
  41913. "type": "float",
  41914. "doc": "The opacity of the polygon",
  41915. "default-value": 1,
  41916. "default-meaning": "opaque"
  41917. },
  41918. "gamma": {
  41919. "css": "polygon-gamma",
  41920. "type": "float",
  41921. "default-value": 1,
  41922. "default-meaning": "fully antialiased",
  41923. "range": "0-1",
  41924. "doc": "Level of antialiasing of polygon edges"
  41925. },
  41926. "gamma-method": {
  41927. "css": "polygon-gamma-method",
  41928. "type": ["power", "linear", "none", "threshold", "multiply"],
  41929. "default-value": "power",
  41930. "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",
  41931. "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"
  41932. },
  41933. "clip": {
  41934. "css": "polygon-clip",
  41935. "type": "boolean",
  41936. "default-value": true,
  41937. "default-meaning": "geometry will be clipped to map bounds before rendering",
  41938. "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."
  41939. },
  41940. "smooth": {
  41941. "css": "polygon-smooth",
  41942. "type": "float",
  41943. "default-value": 0,
  41944. "default-meaning": "no smoothing",
  41945. "range": "0-1",
  41946. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  41947. },
  41948. "geometry-transform": {
  41949. "css": "polygon-geometry-transform",
  41950. "type": "functions",
  41951. "default-value": "none",
  41952. "default-meaning": "geometry will not be transformed",
  41953. "doc": "Allows transformation functions to be applied to the geometry.",
  41954. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  41955. },
  41956. "comp-op": {
  41957. "css": "polygon-comp-op",
  41958. "default-value": "src-over",
  41959. "default-meaning": "add the current symbolizer on top of other symbolizer",
  41960. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  41961. "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"]
  41962. }
  41963. },
  41964. "line": {
  41965. "stroke": {
  41966. "css": "line-color",
  41967. "default-value": "rgba(0,0,0,1)",
  41968. "type": "color",
  41969. "default-meaning": "black and fully opaque (alpha = 1), same as rgb(0,0,0)",
  41970. "doc": "The color of a drawn line"
  41971. },
  41972. "stroke-width": {
  41973. "css": "line-width",
  41974. "default-value": 1,
  41975. "type": "float",
  41976. "doc": "The width of a line in pixels"
  41977. },
  41978. "stroke-opacity": {
  41979. "css": "line-opacity",
  41980. "default-value": 1,
  41981. "type": "float",
  41982. "default-meaning": "opaque",
  41983. "doc": "The opacity of a line"
  41984. },
  41985. "stroke-linejoin": {
  41986. "css": "line-join",
  41987. "default-value": "miter",
  41988. "type": ["miter", "round", "bevel"],
  41989. "doc": "The behavior of lines when joining"
  41990. },
  41991. "stroke-linecap": {
  41992. "css": "line-cap",
  41993. "default-value": "butt",
  41994. "type": ["butt", "round", "square"],
  41995. "doc": "The display of line endings"
  41996. },
  41997. "stroke-gamma": {
  41998. "css": "line-gamma",
  41999. "type": "float",
  42000. "default-value": 1,
  42001. "default-meaning": "fully antialiased",
  42002. "range": "0-1",
  42003. "doc": "Level of antialiasing of stroke line"
  42004. },
  42005. "stroke-gamma-method": {
  42006. "css": "line-gamma-method",
  42007. "type": ["power", "linear", "none", "threshold", "multiply"],
  42008. "default-value": "power",
  42009. "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",
  42010. "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"
  42011. },
  42012. "stroke-dasharray": {
  42013. "css": "line-dasharray",
  42014. "type": "numbers",
  42015. "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.",
  42016. "default-value": "none",
  42017. "default-meaning": "solid line"
  42018. },
  42019. "stroke-dashoffset": {
  42020. "css": "line-dash-offset",
  42021. "type": "numbers",
  42022. "doc": "valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)",
  42023. "default-value": "none",
  42024. "default-meaning": "solid line"
  42025. },
  42026. "stroke-miterlimit": {
  42027. "css": "line-miterlimit",
  42028. "type": "float",
  42029. "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.",
  42030. "default-value": 4.0,
  42031. "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 )'"
  42032. },
  42033. "clip": {
  42034. "css": "line-clip",
  42035. "type": "boolean",
  42036. "default-value": true,
  42037. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42038. "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."
  42039. },
  42040. "smooth": {
  42041. "css": "line-smooth",
  42042. "type": "float",
  42043. "default-value": 0,
  42044. "default-meaning": "no smoothing",
  42045. "range": "0-1",
  42046. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42047. },
  42048. "offset": {
  42049. "css": "line-offset",
  42050. "type": "float",
  42051. "default-value": 0,
  42052. "default-meaning": "no offset",
  42053. "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)."
  42054. },
  42055. "rasterizer": {
  42056. "css": "line-rasterizer",
  42057. "type": ["full", "fast"],
  42058. "default-value": "full",
  42059. "doc": "Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."
  42060. },
  42061. "geometry-transform": {
  42062. "css": "line-geometry-transform",
  42063. "type": "functions",
  42064. "default-value": "none",
  42065. "default-meaning": "geometry will not be transformed",
  42066. "doc": "Allows transformation functions to be applied to the geometry.",
  42067. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42068. },
  42069. "comp-op": {
  42070. "css": "line-comp-op",
  42071. "default-value": "src-over",
  42072. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42073. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42074. "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"]
  42075. }
  42076. },
  42077. "markers": {
  42078. "file": {
  42079. "css": "marker-file",
  42080. "doc": "An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.",
  42081. "default-value": "",
  42082. "default-meaning": "An ellipse or circle, if width equals height",
  42083. "type": "uri"
  42084. },
  42085. "opacity": {
  42086. "css": "marker-opacity",
  42087. "doc": "The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke",
  42088. "default-value": 1,
  42089. "default-meaning": "The stroke-opacity and fill-opacity will be used",
  42090. "type": "float"
  42091. },
  42092. "fill-opacity": {
  42093. "css": "marker-fill-opacity",
  42094. "doc": "The fill opacity of the marker",
  42095. "default-value": 1,
  42096. "default-meaning": "opaque",
  42097. "type": "float"
  42098. },
  42099. "stroke": {
  42100. "css": "marker-line-color",
  42101. "doc": "The color of the stroke around a marker shape.",
  42102. "default-value": "black",
  42103. "type": "color"
  42104. },
  42105. "stroke-width": {
  42106. "css": "marker-line-width",
  42107. "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.",
  42108. "type": "float"
  42109. },
  42110. "stroke-opacity": {
  42111. "css": "marker-line-opacity",
  42112. "default-value": 1,
  42113. "default-meaning": "opaque",
  42114. "doc": "The opacity of a line",
  42115. "type": "float"
  42116. },
  42117. "placement": {
  42118. "css": "marker-placement",
  42119. "type": ["point", "line", "interior"],
  42120. "default-value": "point",
  42121. "default-meaning": "Place markers at the center point (centroid) of the geometry",
  42122. "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"
  42123. },
  42124. "multi-policy": {
  42125. "css": "marker-multi-policy",
  42126. "type": ["each", "whole", "largest"],
  42127. "default-value": "each",
  42128. "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",
  42129. "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)."
  42130. },
  42131. "marker-type": {
  42132. "css": "marker-type",
  42133. "type": ["arrow", "ellipse"],
  42134. "default-value": "ellipse",
  42135. "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)"
  42136. },
  42137. "width": {
  42138. "css": "marker-width",
  42139. "default-value": 10,
  42140. "doc": "The width of the marker, if using one of the default types.",
  42141. "type": "expression"
  42142. },
  42143. "height": {
  42144. "css": "marker-height",
  42145. "default-value": 10,
  42146. "doc": "The height of the marker, if using one of the default types.",
  42147. "type": "expression"
  42148. },
  42149. "fill": {
  42150. "css": "marker-fill",
  42151. "default-value": "blue",
  42152. "doc": "The color of the area of the marker.",
  42153. "type": "color"
  42154. },
  42155. "allow-overlap": {
  42156. "css": "marker-allow-overlap",
  42157. "type": "boolean",
  42158. "default-value": false,
  42159. "doc": "Control whether overlapping markers are shown or hidden.",
  42160. "default-meaning": "Do not allow makers to overlap with each other - overlapping markers will not be shown."
  42161. },
  42162. "ignore-placement": {
  42163. "css": "marker-ignore-placement",
  42164. "type": "boolean",
  42165. "default-value": false,
  42166. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  42167. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  42168. },
  42169. "spacing": {
  42170. "css": "marker-spacing",
  42171. "doc": "Space between repeated labels",
  42172. "default-value": 100,
  42173. "type": "float"
  42174. },
  42175. "max-error": {
  42176. "css": "marker-max-error",
  42177. "type": "float",
  42178. "default-value": 0.2,
  42179. "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."
  42180. },
  42181. "transform": {
  42182. "css": "marker-transform",
  42183. "type": "functions",
  42184. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  42185. "default-value": "",
  42186. "default-meaning": "No transformation",
  42187. "doc": "SVG transformation definition"
  42188. },
  42189. "clip": {
  42190. "css": "marker-clip",
  42191. "type": "boolean",
  42192. "default-value": true,
  42193. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42194. "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."
  42195. },
  42196. "smooth": {
  42197. "css": "marker-smooth",
  42198. "type": "float",
  42199. "default-value": 0,
  42200. "default-meaning": "no smoothing",
  42201. "range": "0-1",
  42202. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42203. },
  42204. "geometry-transform": {
  42205. "css": "marker-geometry-transform",
  42206. "type": "functions",
  42207. "default-value": "none",
  42208. "default-meaning": "geometry will not be transformed",
  42209. "doc": "Allows transformation functions to be applied to the geometry.",
  42210. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42211. },
  42212. "comp-op": {
  42213. "css": "marker-comp-op",
  42214. "default-value": "src-over",
  42215. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42216. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42217. "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"]
  42218. }
  42219. },
  42220. "shield": {
  42221. "name": {
  42222. "css": "shield-name",
  42223. "type": "expression",
  42224. "serialization": "content",
  42225. "doc": "Value to use for a shield\"s text label. Data columns are specified using brackets like [column_name]"
  42226. },
  42227. "file": {
  42228. "css": "shield-file",
  42229. "required": true,
  42230. "type": "uri",
  42231. "default-value": "none",
  42232. "doc": "Image file to render behind the shield text"
  42233. },
  42234. "face-name": {
  42235. "css": "shield-face-name",
  42236. "type": "string",
  42237. "validate": "font",
  42238. "doc": "Font name and style to use for the shield text",
  42239. "default-value": "",
  42240. "required": true
  42241. },
  42242. "unlock-image": {
  42243. "css": "shield-unlock-image",
  42244. "type": "boolean",
  42245. "doc": "This parameter should be set to true if you are trying to position text beside rather than on top of the shield image",
  42246. "default-value": false,
  42247. "default-meaning": "text alignment relative to the shield image uses the center of the image as the anchor for text positioning."
  42248. },
  42249. "size": {
  42250. "css": "shield-size",
  42251. "type": "float",
  42252. "doc": "The size of the shield text in pixels"
  42253. },
  42254. "fill": {
  42255. "css": "shield-fill",
  42256. "type": "color",
  42257. "doc": "The color of the shield text"
  42258. },
  42259. "placement": {
  42260. "css": "shield-placement",
  42261. "type": ["point", "line", "vertex", "interior"],
  42262. "default-value": "point",
  42263. "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."
  42264. },
  42265. "avoid-edges": {
  42266. "css": "shield-avoid-edges",
  42267. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  42268. "type": "boolean",
  42269. "default-value": false
  42270. },
  42271. "allow-overlap": {
  42272. "css": "shield-allow-overlap",
  42273. "type": "boolean",
  42274. "default-value": false,
  42275. "doc": "Control whether overlapping shields are shown or hidden.",
  42276. "default-meaning": "Do not allow shields to overlap with other map elements already placed."
  42277. },
  42278. "minimum-distance": {
  42279. "css": "shield-min-distance",
  42280. "type": "float",
  42281. "default-value": 0,
  42282. "doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
  42283. },
  42284. "spacing": {
  42285. "css": "shield-spacing",
  42286. "type": "float",
  42287. "default-value": 0,
  42288. "doc": "The spacing between repeated occurrences of the same shield on a line"
  42289. },
  42290. "minimum-padding": {
  42291. "css": "shield-min-padding",
  42292. "default-value": 0,
  42293. "doc": "Determines the minimum amount of padding that a shield gets relative to other shields",
  42294. "type": "float"
  42295. },
  42296. "wrap-width": {
  42297. "css": "shield-wrap-width",
  42298. "type": "unsigned",
  42299. "default-value": 0,
  42300. "doc": "Length of a chunk of text in characters before wrapping text"
  42301. },
  42302. "wrap-before": {
  42303. "css": "shield-wrap-before",
  42304. "type": "boolean",
  42305. "default-value": false,
  42306. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  42307. },
  42308. "wrap-character": {
  42309. "css": "shield-wrap-character",
  42310. "type": "string",
  42311. "default-value": " ",
  42312. "doc": "Use this character instead of a space to wrap long names."
  42313. },
  42314. "halo-fill": {
  42315. "css": "shield-halo-fill",
  42316. "type": "color",
  42317. "default-value": "#FFFFFF",
  42318. "default-meaning": "white",
  42319. "doc": "Specifies the color of the halo around the text."
  42320. },
  42321. "halo-radius": {
  42322. "css": "shield-halo-radius",
  42323. "doc": "Specify the radius of the halo in pixels",
  42324. "default-value": 0,
  42325. "default-meaning": "no halo",
  42326. "type": "float"
  42327. },
  42328. "character-spacing": {
  42329. "css": "shield-character-spacing",
  42330. "type": "unsigned",
  42331. "default-value": 0,
  42332. "doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
  42333. },
  42334. "line-spacing": {
  42335. "css": "shield-line-spacing",
  42336. "doc": "Vertical spacing between lines of multiline labels (in pixels)",
  42337. "type": "unsigned"
  42338. },
  42339. "dx": {
  42340. "css": "shield-text-dx",
  42341. "type": "float",
  42342. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  42343. "default-value": 0
  42344. },
  42345. "dy": {
  42346. "css": "shield-text-dy",
  42347. "type": "float",
  42348. "doc": "Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  42349. "default-value": 0
  42350. },
  42351. "shield-dx": {
  42352. "css": "shield-dx",
  42353. "type": "float",
  42354. "doc": "Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  42355. "default-value": 0
  42356. },
  42357. "shield-dy": {
  42358. "css": "shield-dy",
  42359. "type": "float",
  42360. "doc": "Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  42361. "default-value": 0
  42362. },
  42363. "opacity": {
  42364. "css": "shield-opacity",
  42365. "type": "float",
  42366. "doc": "(Default 1.0) - opacity of the image used for the shield",
  42367. "default-value": 1
  42368. },
  42369. "text-opacity": {
  42370. "css": "shield-text-opacity",
  42371. "type": "float",
  42372. "doc": "(Default 1.0) - opacity of the text placed on top of the shield",
  42373. "default-value": 1
  42374. },
  42375. "horizontal-alignment": {
  42376. "css": "shield-horizontal-alignment",
  42377. "type": ["left", "middle", "right", "auto"],
  42378. "doc": "The shield's horizontal alignment from its centerpoint",
  42379. "default-value": "auto"
  42380. },
  42381. "vertical-alignment": {
  42382. "css": "shield-vertical-alignment",
  42383. "type": ["top", "middle", "bottom", "auto"],
  42384. "doc": "The shield's vertical alignment from its centerpoint",
  42385. "default-value": "middle"
  42386. },
  42387. "text-transform": {
  42388. "css": "shield-text-transform",
  42389. "type": ["none", "uppercase", "lowercase", "capitalize"],
  42390. "doc": "Transform the case of the characters",
  42391. "default-value": "none"
  42392. },
  42393. "justify-alignment": {
  42394. "css": "shield-justify-alignment",
  42395. "type": ["left", "center", "right", "auto"],
  42396. "doc": "Define how text in a shield's label is justified",
  42397. "default-value": "auto"
  42398. },
  42399. "clip": {
  42400. "css": "shield-clip",
  42401. "type": "boolean",
  42402. "default-value": true,
  42403. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42404. "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."
  42405. },
  42406. "comp-op": {
  42407. "css": "shield-comp-op",
  42408. "default-value": "src-over",
  42409. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42410. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42411. "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"]
  42412. }
  42413. },
  42414. "line-pattern": {
  42415. "file": {
  42416. "css": "line-pattern-file",
  42417. "type": "uri",
  42418. "default-value": "none",
  42419. "required": true,
  42420. "doc": "An image file to be repeated and warped along a line"
  42421. },
  42422. "clip": {
  42423. "css": "line-pattern-clip",
  42424. "type": "boolean",
  42425. "default-value": true,
  42426. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42427. "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."
  42428. },
  42429. "smooth": {
  42430. "css": "line-pattern-smooth",
  42431. "type": "float",
  42432. "default-value": 0,
  42433. "default-meaning": "no smoothing",
  42434. "range": "0-1",
  42435. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42436. },
  42437. "geometry-transform": {
  42438. "css": "line-pattern-geometry-transform",
  42439. "type": "functions",
  42440. "default-value": "none",
  42441. "default-meaning": "geometry will not be transformed",
  42442. "doc": "Allows transformation functions to be applied to the geometry.",
  42443. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42444. },
  42445. "comp-op": {
  42446. "css": "line-pattern-comp-op",
  42447. "default-value": "src-over",
  42448. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42449. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42450. "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"]
  42451. }
  42452. },
  42453. "polygon-pattern": {
  42454. "file": {
  42455. "css": "polygon-pattern-file",
  42456. "type": "uri",
  42457. "default-value": "none",
  42458. "required": true,
  42459. "doc": "Image to use as a repeated pattern fill within a polygon"
  42460. },
  42461. "alignment": {
  42462. "css": "polygon-pattern-alignment",
  42463. "type": ["local", "global"],
  42464. "default-value": "local",
  42465. "doc": "Specify whether to align pattern fills to the layer or to the map."
  42466. },
  42467. "gamma": {
  42468. "css": "polygon-pattern-gamma",
  42469. "type": "float",
  42470. "default-value": 1,
  42471. "default-meaning": "fully antialiased",
  42472. "range": "0-1",
  42473. "doc": "Level of antialiasing of polygon pattern edges"
  42474. },
  42475. "opacity": {
  42476. "css": "polygon-pattern-opacity",
  42477. "type": "float",
  42478. "doc": "(Default 1.0) - Apply an opacity level to the image used for the pattern",
  42479. "default-value": 1,
  42480. "default-meaning": "The image is rendered without modifications"
  42481. },
  42482. "clip": {
  42483. "css": "polygon-pattern-clip",
  42484. "type": "boolean",
  42485. "default-value": true,
  42486. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42487. "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."
  42488. },
  42489. "smooth": {
  42490. "css": "polygon-pattern-smooth",
  42491. "type": "float",
  42492. "default-value": 0,
  42493. "default-meaning": "no smoothing",
  42494. "range": "0-1",
  42495. "doc": "Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."
  42496. },
  42497. "geometry-transform": {
  42498. "css": "polygon-pattern-geometry-transform",
  42499. "type": "functions",
  42500. "default-value": "none",
  42501. "default-meaning": "geometry will not be transformed",
  42502. "doc": "Allows transformation functions to be applied to the geometry.",
  42503. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]]
  42504. },
  42505. "comp-op": {
  42506. "css": "polygon-pattern-comp-op",
  42507. "default-value": "src-over",
  42508. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42509. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42510. "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"]
  42511. }
  42512. },
  42513. "raster": {
  42514. "opacity": {
  42515. "css": "raster-opacity",
  42516. "default-value": 1,
  42517. "default-meaning": "opaque",
  42518. "type": "float",
  42519. "doc": "The opacity of the raster symbolizer on top of other symbolizers."
  42520. },
  42521. "filter-factor": {
  42522. "css": "raster-filter-factor",
  42523. "default-value": -1,
  42524. "default-meaning": "Allow the datasource to choose appropriate downscaling.",
  42525. "type": "float",
  42526. "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."
  42527. },
  42528. "scaling": {
  42529. "css": "raster-scaling",
  42530. "type": ["near", "fast", "bilinear", "bilinear8", "bicubic", "spline16", "spline36", "hanning", "hamming", "hermite", "kaiser", "quadric", "catrom", "gaussian", "bessel", "mitchell", "sinc", "lanczos", "blackman"],
  42531. "default-value": "near",
  42532. "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."
  42533. },
  42534. "mesh-size": {
  42535. "css": "raster-mesh-size",
  42536. "default-value": 16,
  42537. "default-meaning": "Reprojection mesh will be 1/16 of the resolution of the source image",
  42538. "type": "unsigned",
  42539. "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."
  42540. },
  42541. "comp-op": {
  42542. "css": "raster-comp-op",
  42543. "default-value": "src-over",
  42544. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42545. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42546. "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"]
  42547. }
  42548. },
  42549. "point": {
  42550. "file": {
  42551. "css": "point-file",
  42552. "type": "uri",
  42553. "required": false,
  42554. "default-value": "none",
  42555. "doc": "Image file to represent a point"
  42556. },
  42557. "allow-overlap": {
  42558. "css": "point-allow-overlap",
  42559. "type": "boolean",
  42560. "default-value": false,
  42561. "doc": "Control whether overlapping points are shown or hidden.",
  42562. "default-meaning": "Do not allow points to overlap with each other - overlapping markers will not be shown."
  42563. },
  42564. "ignore-placement": {
  42565. "css": "point-ignore-placement",
  42566. "type": "boolean",
  42567. "default-value": false,
  42568. "default-meaning": "do not store the bbox of this geometry in the collision detector cache",
  42569. "doc": "value to control whether the placement of the feature will prevent the placement of other features"
  42570. },
  42571. "opacity": {
  42572. "css": "point-opacity",
  42573. "type": "float",
  42574. "default-value": 1.0,
  42575. "default-meaning": "Fully opaque",
  42576. "doc": "A value from 0 to 1 to control the opacity of the point"
  42577. },
  42578. "placement": {
  42579. "css": "point-placement",
  42580. "type": ["centroid", "interior"],
  42581. "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.",
  42582. "default-value": "centroid"
  42583. },
  42584. "transform": {
  42585. "css": "point-transform",
  42586. "type": "functions",
  42587. "functions": [["matrix", 6], ["translate", 2], ["scale", 2], ["rotate", 3], ["skewX", 1], ["skewY", 1]],
  42588. "default-value": "",
  42589. "default-meaning": "No transformation",
  42590. "doc": "SVG transformation definition"
  42591. },
  42592. "comp-op": {
  42593. "css": "point-comp-op",
  42594. "default-value": "src-over",
  42595. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42596. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42597. "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"]
  42598. }
  42599. },
  42600. "text": {
  42601. "name": {
  42602. "css": "text-name",
  42603. "type": "expression",
  42604. "required": true,
  42605. "default-value": "",
  42606. "serialization": "content",
  42607. "doc": "Value to use for a text label. Data columns are specified using brackets like [column_name]"
  42608. },
  42609. "face-name": {
  42610. "css": "text-face-name",
  42611. "type": "string",
  42612. "validate": "font",
  42613. "doc": "Font name and style to render a label in",
  42614. "required": true
  42615. },
  42616. "size": {
  42617. "css": "text-size",
  42618. "type": "float",
  42619. "default-value": 10,
  42620. "doc": "Text size in pixels"
  42621. },
  42622. "text-ratio": {
  42623. "css": "text-ratio",
  42624. "doc": "Define the amount of text (of the total) present on successive lines when wrapping occurs",
  42625. "default-value": 0,
  42626. "type": "unsigned"
  42627. },
  42628. "wrap-width": {
  42629. "css": "text-wrap-width",
  42630. "doc": "Length of a chunk of text in characters before wrapping text",
  42631. "default-value": 0,
  42632. "type": "unsigned"
  42633. },
  42634. "wrap-before": {
  42635. "css": "text-wrap-before",
  42636. "type": "boolean",
  42637. "default-value": false,
  42638. "doc": "Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."
  42639. },
  42640. "wrap-character": {
  42641. "css": "text-wrap-character",
  42642. "type": "string",
  42643. "default-value": " ",
  42644. "doc": "Use this character instead of a space to wrap long text."
  42645. },
  42646. "spacing": {
  42647. "css": "text-spacing",
  42648. "type": "unsigned",
  42649. "doc": "Distance between repeated text labels on a line (aka. label-spacing)"
  42650. },
  42651. "character-spacing": {
  42652. "css": "text-character-spacing",
  42653. "type": "float",
  42654. "default-value": 0,
  42655. "doc": "Horizontal spacing adjustment between characters in pixels"
  42656. },
  42657. "line-spacing": {
  42658. "css": "text-line-spacing",
  42659. "default-value": 0,
  42660. "type": "unsigned",
  42661. "doc": "Vertical spacing adjustment between lines in pixels"
  42662. },
  42663. "label-position-tolerance": {
  42664. "css": "text-label-position-tolerance",
  42665. "default-value": 0,
  42666. "type": "unsigned",
  42667. "doc": "Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"
  42668. },
  42669. "max-char-angle-delta": {
  42670. "css": "text-max-char-angle-delta",
  42671. "type": "float",
  42672. "default-value": "22.5",
  42673. "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."
  42674. },
  42675. "fill": {
  42676. "css": "text-fill",
  42677. "doc": "Specifies the color for the text",
  42678. "default-value": "#000000",
  42679. "type": "color"
  42680. },
  42681. "opacity": {
  42682. "css": "text-opacity",
  42683. "doc": "A number from 0 to 1 specifying the opacity for the text",
  42684. "default-value": 1.0,
  42685. "default-meaning": "Fully opaque",
  42686. "type": "float"
  42687. },
  42688. "halo-fill": {
  42689. "css": "text-halo-fill",
  42690. "type": "color",
  42691. "default-value": "#FFFFFF",
  42692. "default-meaning": "white",
  42693. "doc": "Specifies the color of the halo around the text."
  42694. },
  42695. "halo-radius": {
  42696. "css": "text-halo-radius",
  42697. "doc": "Specify the radius of the halo in pixels",
  42698. "default-value": 0,
  42699. "default-meaning": "no halo",
  42700. "type": "float"
  42701. },
  42702. "dx": {
  42703. "css": "text-dx",
  42704. "type": "float",
  42705. "doc": "Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right",
  42706. "default-value": 0
  42707. },
  42708. "dy": {
  42709. "css": "text-dy",
  42710. "type": "float",
  42711. "doc": "Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down",
  42712. "default-value": 0
  42713. },
  42714. "vertical-alignment": {
  42715. "css": "text-vertical-alignment",
  42716. "type": ["top", "middle", "bottom", "auto"],
  42717. "doc": "Position of label relative to point position.",
  42718. "default-value": "auto",
  42719. "default-meaning": "Default affected by value of dy; \"bottom\" for dy>0, \"top\" for dy<0."
  42720. },
  42721. "avoid-edges": {
  42722. "css": "text-avoid-edges",
  42723. "doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
  42724. "default-value": false,
  42725. "type": "boolean"
  42726. },
  42727. "minimum-distance": {
  42728. "css": "text-min-distance",
  42729. "doc": "Minimum permitted distance to the next text symbolizer.",
  42730. "type": "float"
  42731. },
  42732. "minimum-padding": {
  42733. "css": "text-min-padding",
  42734. "doc": "Determines the minimum amount of padding that a text symbolizer gets relative to other text",
  42735. "type": "float"
  42736. },
  42737. "minimum-path-length": {
  42738. "css": "text-min-path-length",
  42739. "type": "float",
  42740. "default-value": 0,
  42741. "default-meaning": "place labels on all paths",
  42742. "doc": "Place labels only on paths longer than this value."
  42743. },
  42744. "allow-overlap": {
  42745. "css": "text-allow-overlap",
  42746. "type": "boolean",
  42747. "default-value": false,
  42748. "doc": "Control whether overlapping text is shown or hidden.",
  42749. "default-meaning": "Do not allow text to overlap with other text - overlapping markers will not be shown."
  42750. },
  42751. "orientation": {
  42752. "css": "text-orientation",
  42753. "type": "expression",
  42754. "doc": "Rotate the text."
  42755. },
  42756. "placement": {
  42757. "css": "text-placement",
  42758. "type": ["point", "line", "vertex", "interior"],
  42759. "default-value": "point",
  42760. "doc": "Control the style of placement of a point versus the geometry it is attached to."
  42761. },
  42762. "placement-type": {
  42763. "css": "text-placement-type",
  42764. "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.",
  42765. "type": ["dummy", "simple"],
  42766. "default-value": "dummy"
  42767. },
  42768. "placements": {
  42769. "css": "text-placements",
  42770. "type": "string",
  42771. "default-value": "",
  42772. "doc": "If \"placement-type\" is set to \"simple\", use this \"POSITIONS,[SIZES]\" string. An example is `text-placements: \"E,NE,SE,W,NW,SW\";` "
  42773. },
  42774. "text-transform": {
  42775. "css": "text-transform",
  42776. "type": ["none", "uppercase", "lowercase", "capitalize"],
  42777. "doc": "Transform the case of the characters",
  42778. "default-value": "none"
  42779. },
  42780. "horizontal-alignment": {
  42781. "css": "text-horizontal-alignment",
  42782. "type": ["left", "middle", "right", "auto"],
  42783. "doc": "The text's horizontal alignment from its centerpoint",
  42784. "default-value": "auto"
  42785. },
  42786. "justify-alignment": {
  42787. "css": "text-align",
  42788. "type": ["left", "right", "center", "auto"],
  42789. "doc": "Define how text is justified",
  42790. "default-value": "auto",
  42791. "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"
  42792. },
  42793. "clip": {
  42794. "css": "text-clip",
  42795. "type": "boolean",
  42796. "default-value": true,
  42797. "default-meaning": "geometry will be clipped to map bounds before rendering",
  42798. "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."
  42799. },
  42800. "comp-op": {
  42801. "css": "text-comp-op",
  42802. "default-value": "src-over",
  42803. "default-meaning": "add the current symbolizer on top of other symbolizer",
  42804. "doc": "Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",
  42805. "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"]
  42806. }
  42807. },
  42808. "building": {
  42809. "fill": {
  42810. "css": "building-fill",
  42811. "default-value": "#FFFFFF",
  42812. "doc": "The color of the buildings walls.",
  42813. "type": "color"
  42814. },
  42815. "fill-opacity": {
  42816. "css": "building-fill-opacity",
  42817. "type": "float",
  42818. "doc": "The opacity of the building as a whole, including all walls.",
  42819. "default-value": 1
  42820. },
  42821. "height": {
  42822. "css": "building-height",
  42823. "doc": "The height of the building in pixels.",
  42824. "type": "expression",
  42825. "default-value": "0"
  42826. }
  42827. }
  42828. },
  42829. "colors": {
  42830. "aliceblue": [240, 248, 255],
  42831. "antiquewhite": [250, 235, 215],
  42832. "aqua": [0, 255, 255],
  42833. "aquamarine": [127, 255, 212],
  42834. "azure": [240, 255, 255],
  42835. "beige": [245, 245, 220],
  42836. "bisque": [255, 228, 196],
  42837. "black": [0, 0, 0],
  42838. "blanchedalmond": [255, 235, 205],
  42839. "blue": [0, 0, 255],
  42840. "blueviolet": [138, 43, 226],
  42841. "brown": [165, 42, 42],
  42842. "burlywood": [222, 184, 135],
  42843. "cadetblue": [95, 158, 160],
  42844. "chartreuse": [127, 255, 0],
  42845. "chocolate": [210, 105, 30],
  42846. "coral": [255, 127, 80],
  42847. "cornflowerblue": [100, 149, 237],
  42848. "cornsilk": [255, 248, 220],
  42849. "crimson": [220, 20, 60],
  42850. "cyan": [0, 255, 255],
  42851. "darkblue": [0, 0, 139],
  42852. "darkcyan": [0, 139, 139],
  42853. "darkgoldenrod": [184, 134, 11],
  42854. "darkgray": [169, 169, 169],
  42855. "darkgreen": [0, 100, 0],
  42856. "darkgrey": [169, 169, 169],
  42857. "darkkhaki": [189, 183, 107],
  42858. "darkmagenta": [139, 0, 139],
  42859. "darkolivegreen": [85, 107, 47],
  42860. "darkorange": [255, 140, 0],
  42861. "darkorchid": [153, 50, 204],
  42862. "darkred": [139, 0, 0],
  42863. "darksalmon": [233, 150, 122],
  42864. "darkseagreen": [143, 188, 143],
  42865. "darkslateblue": [72, 61, 139],
  42866. "darkslategrey": [47, 79, 79],
  42867. "darkturquoise": [0, 206, 209],
  42868. "darkviolet": [148, 0, 211],
  42869. "deeppink": [255, 20, 147],
  42870. "deepskyblue": [0, 191, 255],
  42871. "dimgray": [105, 105, 105],
  42872. "dimgrey": [105, 105, 105],
  42873. "dodgerblue": [30, 144, 255],
  42874. "firebrick": [178, 34, 34],
  42875. "floralwhite": [255, 250, 240],
  42876. "forestgreen": [34, 139, 34],
  42877. "fuchsia": [255, 0, 255],
  42878. "gainsboro": [220, 220, 220],
  42879. "ghostwhite": [248, 248, 255],
  42880. "gold": [255, 215, 0],
  42881. "goldenrod": [218, 165, 32],
  42882. "gray": [128, 128, 128],
  42883. "grey": [128, 128, 128],
  42884. "green": [0, 128, 0],
  42885. "greenyellow": [173, 255, 47],
  42886. "honeydew": [240, 255, 240],
  42887. "hotpink": [255, 105, 180],
  42888. "indianred": [205, 92, 92],
  42889. "indigo": [75, 0, 130],
  42890. "ivory": [255, 255, 240],
  42891. "khaki": [240, 230, 140],
  42892. "lavender": [230, 230, 250],
  42893. "lavenderblush": [255, 240, 245],
  42894. "lawngreen": [124, 252, 0],
  42895. "lemonchiffon": [255, 250, 205],
  42896. "lightblue": [173, 216, 230],
  42897. "lightcoral": [240, 128, 128],
  42898. "lightcyan": [224, 255, 255],
  42899. "lightgoldenrodyellow": [250, 250, 210],
  42900. "lightgray": [211, 211, 211],
  42901. "lightgreen": [144, 238, 144],
  42902. "lightgrey": [211, 211, 211],
  42903. "lightpink": [255, 182, 193],
  42904. "lightsalmon": [255, 160, 122],
  42905. "lightseagreen": [32, 178, 170],
  42906. "lightskyblue": [135, 206, 250],
  42907. "lightslategray": [119, 136, 153],
  42908. "lightslategrey": [119, 136, 153],
  42909. "lightsteelblue": [176, 196, 222],
  42910. "lightyellow": [255, 255, 224],
  42911. "lime": [0, 255, 0],
  42912. "limegreen": [50, 205, 50],
  42913. "linen": [250, 240, 230],
  42914. "magenta": [255, 0, 255],
  42915. "maroon": [128, 0, 0],
  42916. "mediumaquamarine": [102, 205, 170],
  42917. "mediumblue": [0, 0, 205],
  42918. "mediumorchid": [186, 85, 211],
  42919. "mediumpurple": [147, 112, 219],
  42920. "mediumseagreen": [60, 179, 113],
  42921. "mediumslateblue": [123, 104, 238],
  42922. "mediumspringgreen": [0, 250, 154],
  42923. "mediumturquoise": [72, 209, 204],
  42924. "mediumvioletred": [199, 21, 133],
  42925. "midnightblue": [25, 25, 112],
  42926. "mintcream": [245, 255, 250],
  42927. "mistyrose": [255, 228, 225],
  42928. "moccasin": [255, 228, 181],
  42929. "navajowhite": [255, 222, 173],
  42930. "navy": [0, 0, 128],
  42931. "oldlace": [253, 245, 230],
  42932. "olive": [128, 128, 0],
  42933. "olivedrab": [107, 142, 35],
  42934. "orange": [255, 165, 0],
  42935. "orangered": [255, 69, 0],
  42936. "orchid": [218, 112, 214],
  42937. "palegoldenrod": [238, 232, 170],
  42938. "palegreen": [152, 251, 152],
  42939. "paleturquoise": [175, 238, 238],
  42940. "palevioletred": [219, 112, 147],
  42941. "papayawhip": [255, 239, 213],
  42942. "peachpuff": [255, 218, 185],
  42943. "peru": [205, 133, 63],
  42944. "pink": [255, 192, 203],
  42945. "plum": [221, 160, 221],
  42946. "powderblue": [176, 224, 230],
  42947. "purple": [128, 0, 128],
  42948. "red": [255, 0, 0],
  42949. "rosybrown": [188, 143, 143],
  42950. "royalblue": [65, 105, 225],
  42951. "saddlebrown": [139, 69, 19],
  42952. "salmon": [250, 128, 114],
  42953. "sandybrown": [244, 164, 96],
  42954. "seagreen": [46, 139, 87],
  42955. "seashell": [255, 245, 238],
  42956. "sienna": [160, 82, 45],
  42957. "silver": [192, 192, 192],
  42958. "skyblue": [135, 206, 235],
  42959. "slateblue": [106, 90, 205],
  42960. "slategray": [112, 128, 144],
  42961. "slategrey": [112, 128, 144],
  42962. "snow": [255, 250, 250],
  42963. "springgreen": [0, 255, 127],
  42964. "steelblue": [70, 130, 180],
  42965. "tan": [210, 180, 140],
  42966. "teal": [0, 128, 128],
  42967. "thistle": [216, 191, 216],
  42968. "tomato": [255, 99, 71],
  42969. "turquoise": [64, 224, 208],
  42970. "violet": [238, 130, 238],
  42971. "wheat": [245, 222, 179],
  42972. "white": [255, 255, 255],
  42973. "whitesmoke": [245, 245, 245],
  42974. "yellow": [255, 255, 0],
  42975. "yellowgreen": [154, 205, 50],
  42976. "transparent": [0, 0, 0, 0]
  42977. },
  42978. "filter": {
  42979. "value": ["true", "false", "null", "point", "linestring", "polygon", "collection"]
  42980. }
  42981. };
  42982. CartoCSS['mapnik_reference'] = {
  42983. version: {
  42984. latest: SuperMap._mapnik_reference_latest,
  42985. '2.1.1': SuperMap._mapnik_reference_latest
  42986. }
  42987. };
  42988. SuperMap.CartoCSS = CartoCSS;
  42989. SuperMap.CartoCSS.Tree = {};
  42990. SuperMap.CartoCSS.Tree.operate = function (op, a, b) {
  42991. switch (op) {
  42992. case '+':
  42993. return a + b;
  42994. case '-':
  42995. return a - b;
  42996. case '*':
  42997. return a * b;
  42998. case '%':
  42999. return a % b;
  43000. case '/':
  43001. return a / b;
  43002. }
  43003. };
  43004. SuperMap.CartoCSS.Tree.functions = {
  43005. rgb: function rgb(r, g, b) {
  43006. return this.rgba(r, g, b, 1.0);
  43007. },
  43008. rgba: function rgba(r, g, b, a) {
  43009. var me = this;
  43010. var rgb = [r, g, b].map(function (c) {
  43011. return me.number(c);
  43012. });
  43013. a = me.number(a);
  43014. if (rgb.some(isNaN) || isNaN(a)) {
  43015. return null;
  43016. }
  43017. return new SuperMap.CartoCSS.Tree.Color(rgb, a);
  43018. },
  43019. // Only require val
  43020. stop: function stop(val) {
  43021. var color, mode;
  43022. if (arguments.length > 1) {
  43023. color = arguments[1];
  43024. }
  43025. if (arguments.length > 2) {
  43026. mode = arguments[2];
  43027. }
  43028. return {
  43029. is: 'tag',
  43030. val: val,
  43031. color: color,
  43032. mode: mode,
  43033. toString: function toString(env) {
  43034. return '\n\t<stop value="' + val.ev(env) + '"' + (color ? ' color="' + color.ev(env) + '" ' : '') + (mode ? ' mode="' + mode.ev(env) + '" ' : '') + '/>';
  43035. }
  43036. };
  43037. },
  43038. hsl: function hsl(h, s, l) {
  43039. return this.hsla(h, s, l, 1.0);
  43040. },
  43041. hsla: function hsla(h, s, l, a) {
  43042. h = this.number(h) % 360 / 360;
  43043. s = this.number(s);
  43044. l = this.number(l);
  43045. a = this.number(a);
  43046. if ([h, s, l, a].some(isNaN)) {
  43047. return null;
  43048. }
  43049. var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s,
  43050. m1 = l * 2 - m2;
  43051. return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, a);
  43052. function hue(h) {
  43053. h = h < 0 ? h + 1 : h > 1 ? h - 1 : h;
  43054. if (h * 6 < 1) {
  43055. return m1 + (m2 - m1) * h * 6;
  43056. } else if (h * 2 < 1) {
  43057. return m2;
  43058. } else if (h * 3 < 2) {
  43059. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  43060. } else {
  43061. return m1;
  43062. }
  43063. }
  43064. },
  43065. hue: function hue(color) {
  43066. if (!('toHSL' in color)) {
  43067. return null;
  43068. }
  43069. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().h));
  43070. },
  43071. saturation: function saturation(color) {
  43072. if (!('toHSL' in color)) {
  43073. return null;
  43074. }
  43075. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().s * 100), '%');
  43076. },
  43077. lightness: function lightness(color) {
  43078. if (!('toHSL' in color)) {
  43079. return null;
  43080. }
  43081. return new SuperMap.CartoCSS.Tree.Dimension(Math.round(color.toHSL().l * 100), '%');
  43082. },
  43083. alpha: function alpha(color) {
  43084. if (!('toHSL' in color)) {
  43085. return null;
  43086. }
  43087. return new SuperMap.CartoCSS.Tree.Dimension(color.toHSL().a);
  43088. },
  43089. saturate: function saturate(color, amount) {
  43090. if (!('toHSL' in color)) {
  43091. return null;
  43092. }
  43093. var hsl = color.toHSL();
  43094. hsl.s += amount.value / 100;
  43095. hsl.s = this.clamp(hsl.s);
  43096. return this.hsla_simple(hsl);
  43097. },
  43098. desaturate: function desaturate(color, amount) {
  43099. if (!('toHSL' in color)) {
  43100. return null;
  43101. }
  43102. var hsl = color.toHSL();
  43103. hsl.s -= amount.value / 100;
  43104. hsl.s = this.clamp(hsl.s);
  43105. return this.hsla_simple(hsl);
  43106. },
  43107. lighten: function lighten(color, amount) {
  43108. if (!('toHSL' in color)) {
  43109. return null;
  43110. }
  43111. var hsl = color.toHSL();
  43112. hsl.l += amount.value / 100;
  43113. hsl.l = this.clamp(hsl.l);
  43114. return this.hsla_simple(hsl);
  43115. },
  43116. darken: function darken(color, amount) {
  43117. if (!('toHSL' in color)) {
  43118. return null;
  43119. }
  43120. var hsl = color.toHSL();
  43121. hsl.l -= amount.value / 100;
  43122. hsl.l = this.clamp(hsl.l);
  43123. return this.hsla_simple(hsl);
  43124. },
  43125. fadein: function fadein(color, amount) {
  43126. if (!('toHSL' in color)) {
  43127. return null;
  43128. }
  43129. var hsl = color.toHSL();
  43130. hsl.a += amount.value / 100;
  43131. hsl.a = this.clamp(hsl.a);
  43132. return this.hsla_simple(hsl);
  43133. },
  43134. fadeout: function fadeout(color, amount) {
  43135. if (!('toHSL' in color)) {
  43136. return null;
  43137. }
  43138. var hsl = color.toHSL();
  43139. hsl.a -= amount.value / 100;
  43140. hsl.a = this.clamp(hsl.a);
  43141. return this.hsla_simple(hsl);
  43142. },
  43143. spin: function spin(color, amount) {
  43144. if (!('toHSL' in color)) {
  43145. return null;
  43146. }
  43147. var hsl = color.toHSL();
  43148. var hue = (hsl.h + amount.value) % 360;
  43149. hsl.h = hue < 0 ? 360 + hue : hue;
  43150. return this.hsla_simple(hsl);
  43151. },
  43152. replace: function replace(entity, a, b) {
  43153. if (entity.is === 'field') {
  43154. return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')';
  43155. } else {
  43156. return entity.replace(a, b);
  43157. }
  43158. },
  43159. //
  43160. // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
  43161. // http://sass-lang.com
  43162. //
  43163. mix: function mix(color1, color2, weight) {
  43164. var p = weight.value / 100.0;
  43165. var w = p * 2 - 1;
  43166. var a = color1.toHSL().a - color2.toHSL().a;
  43167. var w1 = ((w * a == -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  43168. var w2 = 1 - w1;
  43169. 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];
  43170. var alpha = color1.alpha * p + color2.alpha * (1 - p);
  43171. return new SuperMap.CartoCSS.Tree.Color(rgb, alpha);
  43172. },
  43173. greyscale: function greyscale(color) {
  43174. return this.desaturate(color, new SuperMap.CartoCSS.Tree.Dimension(100));
  43175. },
  43176. '%': function _(quoted
  43177. /* arg, arg, ...*/
  43178. ) {
  43179. var args = Array.prototype.slice.call(arguments, 1),
  43180. str = quoted.value;
  43181. for (var i = 0; i < args.length; i++) {
  43182. str = str.replace(/%s/, args[i].value).replace(/%[da]/, args[i].toString());
  43183. }
  43184. str = str.replace(/%%/g, '%');
  43185. return new SuperMap.CartoCSS.Tree.Quoted(str);
  43186. },
  43187. hsla_simple: function hsla_simple(h) {
  43188. return this.hsla(h.h, h.s, h.l, h.a);
  43189. },
  43190. number: function number(n) {
  43191. if (n instanceof SuperMap.CartoCSS.Tree.Dimension) {
  43192. return parseFloat(n.unit === '%' ? n.value / 100 : n.value);
  43193. } else if (typeof n === 'number') {
  43194. return n;
  43195. } else {
  43196. return NaN;
  43197. }
  43198. },
  43199. clamp: function clamp(val) {
  43200. return Math.min(1, Math.max(0, val));
  43201. }
  43202. };
  43203. SuperMap.CartoCSS.Tree.Call = /*#__PURE__*/function () {
  43204. function Call(name, args, index) {
  43205. CartoCSS_classCallCheck(this, Call);
  43206. this.is = 'call';
  43207. this.name = name;
  43208. this.args = args;
  43209. this.index = index;
  43210. } // When evuating a function call,
  43211. // we either find the function in `tree.functions` [1],
  43212. // in which case we call it, passing the evaluated arguments,
  43213. // or we simply print it out as it appeared originally [2].
  43214. // The *functions.js* file contains the built-in functions.
  43215. // The reason why we evaluate the arguments, is in the case where
  43216. // we try to pass a variable to a function, like: `saturate(@color)`.
  43217. // The function should receive the value, not the variable.
  43218. CartoCSS_createClass(Call, [{
  43219. key: 'ev',
  43220. value: function ev(env) {
  43221. var args = this.args.map(function (a) {
  43222. return a.ev(env);
  43223. });
  43224. for (var i = 0; i < args.length; i++) {
  43225. if (args[i].is === 'undefined') {
  43226. return {
  43227. is: 'undefined',
  43228. value: 'undefined'
  43229. };
  43230. }
  43231. }
  43232. if (this.name in SuperMap.CartoCSS.Tree.functions) {
  43233. if (SuperMap.CartoCSS.Tree.functions[this.name].length <= args.length) {
  43234. var val = SuperMap.CartoCSS.Tree.functions[this.name].apply(SuperMap.CartoCSS.Tree.functions, args);
  43235. if (val === null) {
  43236. env.error({
  43237. message: 'incorrect arguments given to ' + this.name + '()',
  43238. index: this.index,
  43239. type: 'runtime',
  43240. filename: this.filename
  43241. });
  43242. return {
  43243. is: 'undefined',
  43244. value: 'undefined'
  43245. };
  43246. }
  43247. return val;
  43248. } else {
  43249. env.error({
  43250. message: 'incorrect number of arguments for ' + this.name + '(). ' + SuperMap.CartoCSS.Tree.functions[this.name].length + ' expected.',
  43251. index: this.index,
  43252. type: 'runtime',
  43253. filename: this.filename
  43254. });
  43255. return {
  43256. is: 'undefined',
  43257. value: 'undefined'
  43258. };
  43259. }
  43260. } else {
  43261. var fn = SuperMap.CartoCSS.Tree.Reference.mapnikFunctions[this.name];
  43262. if (fn === undefined) {
  43263. var functions = lodash_topairs_default()(SuperMap.CartoCSS.Tree.Reference.mapnikFunctions); // cheap closest, needs improvement.
  43264. var name = this.name;
  43265. var mean = functions.map(function (f) {
  43266. return [f[0], SuperMap.CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];
  43267. }).sort(function (a, b) {
  43268. return a[1] - b[1];
  43269. });
  43270. env.error({
  43271. message: 'unknown function ' + this.name + '(), did you mean ' + mean[0][0] + '(' + mean[0][2] + ')',
  43272. index: this.index,
  43273. type: 'runtime',
  43274. filename: this.filename
  43275. });
  43276. return {
  43277. is: 'undefined',
  43278. value: 'undefined'
  43279. };
  43280. }
  43281. if (fn !== args.length && // support variable-arg functions like `colorize-alpha`
  43282. fn !== -1) {
  43283. env.error({
  43284. message: 'function ' + this.name + '() takes ' + fn + ' arguments and was given ' + args.length,
  43285. index: this.index,
  43286. type: 'runtime',
  43287. filename: this.filename
  43288. });
  43289. return {
  43290. is: 'undefined',
  43291. value: 'undefined'
  43292. };
  43293. } else {
  43294. // Save the evaluated versions of arguments
  43295. this.args = args;
  43296. return this;
  43297. }
  43298. }
  43299. }
  43300. }, {
  43301. key: "toString",
  43302. value: function toString(env, format) {
  43303. if (this.args.length) {
  43304. return this.name + '(' + this.args.join(',') + ')';
  43305. } else {
  43306. return this.name;
  43307. }
  43308. }
  43309. }]);
  43310. return Call;
  43311. }();
  43312. SuperMap.CartoCSS.Tree.Color = /*#__PURE__*/function () {
  43313. function Color(rgb, a) {
  43314. CartoCSS_classCallCheck(this, Color);
  43315. this.is = 'color'; // The end goal here, is to parse the arguments
  43316. // into an integer triplet, such as `128, 255, 0`
  43317. //
  43318. // This facilitates operations and conversions.
  43319. if (Array.isArray(rgb)) {
  43320. this.rgb = rgb.slice(0, 3);
  43321. } else if (rgb.length == 6) {
  43322. this.rgb = rgb.match(/.{2}/g).map(function (c) {
  43323. return parseInt(c, 16);
  43324. });
  43325. } else {
  43326. this.rgb = rgb.split('').map(function (c) {
  43327. return parseInt(c + c, 16);
  43328. });
  43329. }
  43330. if (typeof a === 'number') {
  43331. this.alpha = a;
  43332. } else if (rgb.length === 4) {
  43333. this.alpha = rgb[3];
  43334. } else {
  43335. this.alpha = 1;
  43336. }
  43337. }
  43338. CartoCSS_createClass(Color, [{
  43339. key: 'ev',
  43340. value: function ev() {
  43341. return this;
  43342. } // If we have some transparency, the only way to represent it
  43343. // is via `rgba`. Otherwise, we use the hex representation,
  43344. // which has better compatibility with older browsers.
  43345. // Values are capped between `0` and `255`, rounded and zero-padded.
  43346. }, {
  43347. key: "toString",
  43348. value: function toString() {
  43349. /* if (this.alpha < 1.0) {*/
  43350. return 'rgba(' + this.rgb.map(function (c) {
  43351. return Math.round(c);
  43352. }).concat(this.alpha).join(', ') + ')';
  43353. /*} else {
  43354. return '#' + this.rgb.map(function(i) {
  43355. i = Math.round(i);
  43356. i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
  43357. return i.length === 1 ? '0' + i : i;
  43358. }).join('');
  43359. }*/
  43360. } // Operations have to be done per-channel, if not,
  43361. // channels will spill onto each other. Once we have
  43362. // our result, in the form of an integer triplet,
  43363. // we create a new Color node to hold the result.
  43364. }, {
  43365. key: "operate",
  43366. value: function operate(env, op, other) {
  43367. var result = [];
  43368. if (!(other instanceof SuperMap.CartoCSS.Tree.Color)) {
  43369. other = other.toColor();
  43370. }
  43371. for (var c = 0; c < 3; c++) {
  43372. result[c] = SuperMap.CartoCSS.Tree.operate(op, this.rgb[c], other.rgb[c]);
  43373. }
  43374. return new SuperMap.CartoCSS.Tree.Color(result);
  43375. }
  43376. }, {
  43377. key: "toHSL",
  43378. value: function toHSL() {
  43379. var r = this.rgb[0] / 255,
  43380. g = this.rgb[1] / 255,
  43381. b = this.rgb[2] / 255,
  43382. a = this.alpha;
  43383. var max = Math.max(r, g, b),
  43384. min = Math.min(r, g, b);
  43385. var h,
  43386. s,
  43387. l = (max + min) / 2,
  43388. d = max - min;
  43389. if (max === min) {
  43390. h = s = 0;
  43391. } else {
  43392. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  43393. switch (max) {
  43394. case r:
  43395. h = (g - b) / d + (g < b ? 6 : 0);
  43396. break;
  43397. case g:
  43398. h = (b - r) / d + 2;
  43399. break;
  43400. case b:
  43401. h = (r - g) / d + 4;
  43402. break;
  43403. default:
  43404. break;
  43405. }
  43406. h /= 6;
  43407. }
  43408. return {
  43409. h: h * 360,
  43410. s: s,
  43411. l: l,
  43412. a: a
  43413. };
  43414. }
  43415. }]);
  43416. return Color;
  43417. }();
  43418. SuperMap.CartoCSS.Tree.Comment = /*#__PURE__*/function () {
  43419. function Comment(value, silent) {
  43420. CartoCSS_classCallCheck(this, Comment);
  43421. this.value = value;
  43422. this.silent = !!silent;
  43423. }
  43424. CartoCSS_createClass(Comment, [{
  43425. key: "toString",
  43426. value: function toString(env) {
  43427. return '<!--' + this.value + '-->';
  43428. }
  43429. }, {
  43430. key: 'ev',
  43431. value: function ev() {
  43432. return this;
  43433. }
  43434. }]);
  43435. return Comment;
  43436. }();
  43437. SuperMap.CartoCSS.Tree.Definition = /*#__PURE__*/function () {
  43438. function Definition(selector, rules) {
  43439. CartoCSS_classCallCheck(this, Definition);
  43440. this.elements = selector.elements; //assert.ok(selector.filters instanceof SuperMap.CartoCSS.Tree.Filterset);
  43441. this.rules = rules;
  43442. this.ruleIndex = {};
  43443. for (var i = 0; i < this.rules.length; i++) {
  43444. if ('zoom' in this.rules[i]) {
  43445. this.rules[i] = this.rules[i].clone();
  43446. }
  43447. this.rules[i].zoom = selector.zoom;
  43448. this.ruleIndex[this.rules[i].updateID()] = true;
  43449. }
  43450. this.filters = selector.filters;
  43451. this.zoom = selector.zoom;
  43452. this.attachment = selector.attachment || '__default__';
  43453. this.specificity = selector.specificity();
  43454. }
  43455. CartoCSS_createClass(Definition, [{
  43456. key: "toString",
  43457. value: function toString() {
  43458. var str = this.filters.toString();
  43459. for (var i = 0; i < this.rules.length; i++) {
  43460. str += '\n ' + this.rules[i];
  43461. }
  43462. return str;
  43463. }
  43464. }, {
  43465. key: "toJS",
  43466. value: function toJS(env) {
  43467. var shaderAttrs = {}; // merge conditions from filters with zoom condition of the
  43468. // definition
  43469. var zoom = this.zoom; //var frame_offset = this.frame_offset;
  43470. var _if = this.filters.toJS(env);
  43471. var filters = [zoom];
  43472. if (_if) {
  43473. filters.push(_if);
  43474. } //if(frame_offset) filters.push('ctx["frame-offset"] === ' + frame_offset);
  43475. _if = filters.join(" && ");
  43476. function eachRule(rule) {
  43477. if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  43478. shaderAttrs[rule.name] = shaderAttrs[rule.name] || [];
  43479. if (_if) {
  43480. shaderAttrs[rule.name].push("if(" + _if + "){" + rule.value.toJS(env) + "}");
  43481. } else {
  43482. shaderAttrs[rule.name].push(rule.value.toJS(env));
  43483. }
  43484. } else {
  43485. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  43486. var sh = rule.toJS(env);
  43487. for (var v in sh) {
  43488. shaderAttrs[v] = shaderAttrs[v] || [];
  43489. for (var attr in sh[v]) {
  43490. shaderAttrs[v].push(sh[v][attr]);
  43491. }
  43492. }
  43493. }
  43494. }
  43495. }
  43496. for (var id in this.rules) {
  43497. eachRule(this.rules[id]);
  43498. }
  43499. return shaderAttrs;
  43500. }
  43501. }]);
  43502. return Definition;
  43503. }();
  43504. SuperMap.CartoCSS.Tree.Dimension = /*#__PURE__*/function () {
  43505. function Dimension(value, unit, index) {
  43506. CartoCSS_classCallCheck(this, Dimension);
  43507. this.is = 'float';
  43508. this.physical_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc'];
  43509. this.screen_units = ['px', '%'];
  43510. this.all_units = ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'];
  43511. this.densities = {
  43512. m: 0.0254,
  43513. mm: 25.4,
  43514. cm: 2.54,
  43515. pt: 72,
  43516. pc: 6
  43517. };
  43518. this.value = parseFloat(value);
  43519. this.unit = unit || null;
  43520. this.index = index;
  43521. }
  43522. CartoCSS_createClass(Dimension, [{
  43523. key: "ev",
  43524. value: function ev(env) {
  43525. if (this.unit && this.all_units.indexOf(this.unit) < 0) {
  43526. env.error({
  43527. message: "Invalid unit: '" + this.unit + "'",
  43528. index: this.index
  43529. });
  43530. return {
  43531. is: 'undefined',
  43532. value: 'undefined'
  43533. };
  43534. } // normalize units which are not px or %
  43535. if (this.unit && this.physical_units.indexOf(this.unit) >= 0) {
  43536. if (!env.ppi) {
  43537. env.error({
  43538. message: "ppi is not set, so metric units can't be used",
  43539. index: this.index
  43540. });
  43541. return {
  43542. is: 'undefined',
  43543. value: 'undefined'
  43544. };
  43545. } // convert all units to inch
  43546. // convert inch to px using ppi
  43547. this.value = this.value / this.densities[this.unit] * env.ppi;
  43548. this.unit = 'px';
  43549. }
  43550. return this;
  43551. }
  43552. }, {
  43553. key: "toColor",
  43554. value: function toColor() {
  43555. return new SuperMap.CartoCSS.Tree.Color([this.value, this.value, this.value]);
  43556. }
  43557. }, {
  43558. key: "round",
  43559. value: function round() {
  43560. this.value = Math.round(this.value);
  43561. return this;
  43562. }
  43563. }, {
  43564. key: "toString",
  43565. value: function toString() {
  43566. return this.value.toString();
  43567. }
  43568. }, {
  43569. key: "operate",
  43570. value: function operate(env, op, other) {
  43571. if (this.unit === '%' && other.unit !== '%') {
  43572. env.error({
  43573. message: 'If two operands differ, the first must not be %',
  43574. index: this.index
  43575. });
  43576. return {
  43577. is: 'undefined',
  43578. value: 'undefined'
  43579. };
  43580. }
  43581. if (this.unit !== '%' && other.unit === '%') {
  43582. if (op === '*' || op === '/' || op === '%') {
  43583. env.error({
  43584. message: 'Percent values can only be added or subtracted from other values',
  43585. index: this.index
  43586. });
  43587. return {
  43588. is: 'undefined',
  43589. value: 'undefined'
  43590. };
  43591. }
  43592. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, this.value * other.value * 0.01), this.unit);
  43593. } //here the operands are either the same (% or undefined or px), or one is undefined and the other is px
  43594. return new SuperMap.CartoCSS.Tree.Dimension(SuperMap.CartoCSS.Tree.operate(op, this.value, other.value), this.unit || other.unit);
  43595. }
  43596. }]);
  43597. return Dimension;
  43598. }();
  43599. SuperMap.CartoCSS.Tree.Element = /*#__PURE__*/function () {
  43600. function Element(value) {
  43601. CartoCSS_classCallCheck(this, Element);
  43602. this.value = value.trim();
  43603. if (this.value[0] === '#') {
  43604. this.type = 'id';
  43605. this.clean = this.value.replace(/^#/, '');
  43606. }
  43607. if (this.value[0] === '.') {
  43608. this.type = 'class';
  43609. this.clean = this.value.replace(/^\./, '');
  43610. }
  43611. if (this.value.indexOf('*') !== -1) {
  43612. this.type = 'wildcard';
  43613. }
  43614. }
  43615. CartoCSS_createClass(Element, [{
  43616. key: "specificity",
  43617. value: function specificity() {
  43618. return [this.type === 'id' ? 1 : 0, // a
  43619. this.type === 'class' ? 1 : 0 // b
  43620. ];
  43621. }
  43622. }, {
  43623. key: "toString",
  43624. value: function toString() {
  43625. return this.value;
  43626. }
  43627. }]);
  43628. return Element;
  43629. }();
  43630. SuperMap.CartoCSS.Tree.Expression = /*#__PURE__*/function () {
  43631. function Expression(value) {
  43632. CartoCSS_classCallCheck(this, Expression);
  43633. this.is = 'expression';
  43634. this.value = value;
  43635. }
  43636. CartoCSS_createClass(Expression, [{
  43637. key: "ev",
  43638. value: function ev(env) {
  43639. if (this.value.length > 1) {
  43640. return new SuperMap.CartoCSS.Tree.Expression(this.value.map(function (e) {
  43641. return e.ev(env);
  43642. }));
  43643. } else {
  43644. return this.value[0].ev(env);
  43645. }
  43646. }
  43647. }, {
  43648. key: "toString",
  43649. value: function toString(env) {
  43650. return this.value.map(function (e) {
  43651. return e.toString(env);
  43652. }).join(' ');
  43653. }
  43654. }]);
  43655. return Expression;
  43656. }();
  43657. SuperMap.CartoCSS.Tree.Field = /*#__PURE__*/function () {
  43658. function Field(content) {
  43659. CartoCSS_classCallCheck(this, Field);
  43660. this.is = 'field';
  43661. this.value = content || '';
  43662. }
  43663. CartoCSS_createClass(Field, [{
  43664. key: "toString",
  43665. value: function toString() {
  43666. return '["' + this.value.toUpperCase() + '"]';
  43667. }
  43668. }, {
  43669. key: 'ev',
  43670. value: function ev() {
  43671. return this;
  43672. }
  43673. }]);
  43674. return Field;
  43675. }();
  43676. SuperMap.CartoCSS.Tree.Filter = /*#__PURE__*/function () {
  43677. function Filter(key, op, val, index, filename) {
  43678. CartoCSS_classCallCheck(this, Filter);
  43679. this.ops = {
  43680. '<': [' &lt; ', 'numeric'],
  43681. '>': [' &gt; ', 'numeric'],
  43682. '=': [' = ', 'both'],
  43683. '!=': [' != ', 'both'],
  43684. '<=': [' &lt;= ', 'numeric'],
  43685. '>=': [' &gt;= ', 'numeric'],
  43686. '=~': ['.match(', 'string', ')']
  43687. };
  43688. this.key = key;
  43689. this.op = op;
  43690. this.val = val;
  43691. this.index = index;
  43692. this.filename = filename;
  43693. this.id = this.key + this.op + this.val;
  43694. }
  43695. CartoCSS_createClass(Filter, [{
  43696. key: "ev",
  43697. value: function ev(env) {
  43698. this.key = this.key.ev(env);
  43699. this.val = this.val.ev(env);
  43700. return this;
  43701. }
  43702. }, {
  43703. key: "toString",
  43704. value: function toString() {
  43705. return '[' + this.id + ']';
  43706. }
  43707. }]);
  43708. return Filter;
  43709. }();
  43710. SuperMap.CartoCSS.Tree.Filterset = /*#__PURE__*/function () {
  43711. function Filterset() {
  43712. CartoCSS_classCallCheck(this, Filterset);
  43713. this.filters = {};
  43714. }
  43715. CartoCSS_createClass(Filterset, [{
  43716. key: "toJS",
  43717. value: function toJS(env) {
  43718. function eachFilter(filter) {
  43719. var op = filter.op;
  43720. if (op === "=") {
  43721. op = "==";
  43722. }
  43723. var val = filter.val;
  43724. if (filter._val !== undefined) {
  43725. val = filter._val.toString(true);
  43726. } //对scale进行特殊处理,将值转换成数值
  43727. if (filter.key && filter.key.value === 'scale') {
  43728. val = +val;
  43729. } else if (typeof val === 'string' || CartoCSS_typeof(val) === 'object') {
  43730. val = "'" + val + "'";
  43731. }
  43732. var attrs = "attributes";
  43733. return attrs + "&&" + attrs + filter.key + "&&" + attrs + filter.key + " " + op + val;
  43734. }
  43735. var results = [];
  43736. for (var id in this.filters) {
  43737. results.push(eachFilter(this.filters[id]));
  43738. }
  43739. return results.join(' && ');
  43740. }
  43741. }, {
  43742. key: "toString",
  43743. value: function toString() {
  43744. var arr = [];
  43745. for (var id in this.filters) {
  43746. arr.push(this.filters[id].id);
  43747. }
  43748. return arr.sort().join('\t');
  43749. }
  43750. }, {
  43751. key: "ev",
  43752. value: function ev(env) {
  43753. for (var i in this.filters) {
  43754. this.filters[i].ev(env);
  43755. }
  43756. return this;
  43757. }
  43758. }, {
  43759. key: "clone",
  43760. value: function clone() {
  43761. var clone = new SuperMap.CartoCSS.Tree.Filterset();
  43762. for (var id in this.filters) {
  43763. clone.filters[id] = this.filters[id];
  43764. }
  43765. return clone;
  43766. }
  43767. }, {
  43768. key: "cloneWith",
  43769. value: function cloneWith(other) {
  43770. var additions = [];
  43771. for (var id in other.filters) {
  43772. var status = this.addable(other.filters[id]); // status is true, false or null. if it's null we don't fail this
  43773. // clone nor do we add the filter.
  43774. if (status === false) {
  43775. return false;
  43776. }
  43777. if (status === true) {
  43778. // Adding the filter will override another value.
  43779. additions.push(other.filters[id]);
  43780. }
  43781. } // Adding the other filters doesn't make this filterset invalid, but it
  43782. // doesn't add anything to it either.
  43783. if (!additions.length) {
  43784. return null;
  43785. } // We can successfully add all filters. Now clone the filterset and add the
  43786. // new rules.
  43787. var clone = new SuperMap.CartoCSS.Tree.Filterset(); // We can add the rules that are already present without going through the
  43788. // add function as a Filterset is always in it's simplest canonical form.
  43789. for (id in this.filters) {
  43790. clone.filters[id] = this.filters[id];
  43791. } // Only add new filters that actually change the filter.
  43792. while (id = additions.shift()) {
  43793. clone.add(id);
  43794. }
  43795. return clone;
  43796. }
  43797. }, {
  43798. key: "addable",
  43799. value: function addable(filter) {
  43800. var key = filter.key.toString(),
  43801. value = filter.val.toString();
  43802. if (value.match(/^[0-9]+(\.[0-9]*)?_match/)) {
  43803. value = parseFloat(value);
  43804. }
  43805. switch (filter.op) {
  43806. case '=':
  43807. // if there is already foo= and we're adding foo=
  43808. if (this.filters[key + '='] !== undefined) {
  43809. if (this.filters[key + '='].val.toString() != value) {
  43810. return false;
  43811. } else {
  43812. return null;
  43813. }
  43814. }
  43815. if (this.filters[key + '!=' + value] !== undefined) {
  43816. return false;
  43817. }
  43818. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43819. return false;
  43820. }
  43821. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43822. return false;
  43823. }
  43824. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  43825. return false;
  43826. }
  43827. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  43828. return false;
  43829. }
  43830. return true;
  43831. case '=~':
  43832. return true;
  43833. case '!=':
  43834. if (this.filters[key + '='] !== undefined) {
  43835. return this.filters[key + '='].val === value ? false : null;
  43836. }
  43837. if (this.filters[key + '!=' + value] !== undefined) {
  43838. return null;
  43839. }
  43840. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43841. return null;
  43842. }
  43843. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43844. return null;
  43845. }
  43846. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  43847. return null;
  43848. }
  43849. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  43850. return null;
  43851. }
  43852. return true;
  43853. case '>':
  43854. if (key + '=' in this.filters) {
  43855. if (this.filters[key + '='].val <= value) {
  43856. return false;
  43857. } else {
  43858. return null;
  43859. }
  43860. }
  43861. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43862. return false;
  43863. }
  43864. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  43865. return false;
  43866. }
  43867. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43868. return null;
  43869. }
  43870. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  43871. return null;
  43872. }
  43873. return true;
  43874. case '>=':
  43875. if (this.filters[key + '='] !== undefined) {
  43876. return this.filters[key + '='].val < value ? false : null;
  43877. }
  43878. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43879. return false;
  43880. }
  43881. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  43882. return false;
  43883. }
  43884. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43885. return null;
  43886. }
  43887. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  43888. return null;
  43889. }
  43890. return true;
  43891. case '<':
  43892. if (this.filters[key + '='] !== undefined) {
  43893. return this.filters[key + '='].val >= value ? false : null;
  43894. }
  43895. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43896. return false;
  43897. }
  43898. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) {
  43899. return false;
  43900. }
  43901. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43902. return null;
  43903. }
  43904. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) {
  43905. return null;
  43906. }
  43907. return true;
  43908. case '<=':
  43909. if (this.filters[key + '='] !== undefined) {
  43910. return this.filters[key + '='].val > value ? false : null;
  43911. }
  43912. if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) {
  43913. return false;
  43914. }
  43915. if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) {
  43916. return false;
  43917. }
  43918. if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) {
  43919. return null;
  43920. }
  43921. if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) {
  43922. return null;
  43923. }
  43924. return true;
  43925. default:
  43926. break;
  43927. }
  43928. }
  43929. }, {
  43930. key: "conflict",
  43931. value: function conflict(filter) {
  43932. var key = filter.key.toString(),
  43933. value = filter.val.toString();
  43934. if (!isNaN(parseFloat(value))) {
  43935. value = parseFloat(value);
  43936. } // if (a=b) && (a=c)
  43937. // if (a=b) && (a!=b)
  43938. // or (a!=b) && (a=b)
  43939. 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()) {
  43940. return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter';
  43941. }
  43942. return false;
  43943. }
  43944. }, {
  43945. key: "add",
  43946. value: function add(filter, env) {
  43947. var key = filter.key.toString(),
  43948. op = filter.op,
  43949. conflict = this.conflict(filter),
  43950. numval;
  43951. if (conflict) {
  43952. return conflict;
  43953. }
  43954. if (op === '=') {
  43955. for (var i in this.filters) {
  43956. if (this.filters[i].key === key) {
  43957. delete this.filters[i];
  43958. }
  43959. }
  43960. this.filters[key + '='] = filter;
  43961. } else if (op === '!=') {
  43962. this.filters[key + '!=' + filter.val] = filter;
  43963. } else if (op === '=~') {
  43964. this.filters[key + '=~' + filter.val] = filter;
  43965. } else if (op === '>') {
  43966. // If there are other filters that are also >
  43967. // but are less than this one, they don't matter, so
  43968. // remove them.
  43969. for (var j in this.filters) {
  43970. if (this.filters[j].key === key && this.filters[j].val <= filter.val) {
  43971. delete this.filters[j];
  43972. }
  43973. }
  43974. this.filters[key + '>'] = filter;
  43975. } else if (op === '>=') {
  43976. for (var k in this.filters) {
  43977. numval = +this.filters[k].val.toString();
  43978. if (this.filters[k].key === key && numval < filter.val) {
  43979. delete this.filters[k];
  43980. }
  43981. }
  43982. if (this.filters[key + '!=' + filter.val] !== undefined) {
  43983. delete this.filters[key + '!=' + filter.val];
  43984. filter.op = '>';
  43985. this.filters[key + '>'] = filter;
  43986. } else {
  43987. this.filters[key + '>='] = filter;
  43988. }
  43989. } else if (op === '<') {
  43990. for (var l in this.filters) {
  43991. numval = +this.filters[l].val.toString();
  43992. if (this.filters[l].key === key && numval >= filter.val) {
  43993. delete this.filters[l];
  43994. }
  43995. }
  43996. this.filters[key + '<'] = filter;
  43997. } else if (op === '<=') {
  43998. for (var m in this.filters) {
  43999. numval = +this.filters[m].val.toString();
  44000. if (this.filters[m].key === key && numval > filter.val) {
  44001. delete this.filters[m];
  44002. }
  44003. }
  44004. if (this.filters[key + '!=' + filter.val] !== undefined) {
  44005. delete this.filters[key + '!=' + filter.val];
  44006. filter.op = '<';
  44007. this.filters[key + '<'] = filter;
  44008. } else {
  44009. this.filters[key + '<='] = filter;
  44010. }
  44011. }
  44012. }
  44013. }]);
  44014. return Filterset;
  44015. }();
  44016. SuperMap.CartoCSS.Tree.Fontset = function Fontset(env, fonts) {
  44017. CartoCSS_classCallCheck(this, Fontset);
  44018. this.fonts = fonts;
  44019. this.name = 'fontset-' + env.effects.length;
  44020. };
  44021. SuperMap.CartoCSS.Tree.Invalid = /*#__PURE__*/function () {
  44022. function Invalid(chunk, index, message) {
  44023. CartoCSS_classCallCheck(this, Invalid);
  44024. this.is = 'invalid';
  44025. this.chunk = chunk;
  44026. this.index = index;
  44027. this.type = 'syntax';
  44028. this.message = message || "Invalid code: " + this.chunk;
  44029. }
  44030. CartoCSS_createClass(Invalid, [{
  44031. key: "ev",
  44032. value: function ev(env) {
  44033. env.error({
  44034. chunk: this.chunk,
  44035. index: this.index,
  44036. type: 'syntax',
  44037. message: this.message || "Invalid code: " + this.chunk
  44038. });
  44039. return {
  44040. is: 'undefined'
  44041. };
  44042. }
  44043. }]);
  44044. return Invalid;
  44045. }();
  44046. SuperMap.CartoCSS.Tree.Keyword = /*#__PURE__*/function () {
  44047. CartoCSS_createClass(Keyword, [{
  44048. key: "ev",
  44049. value: function ev() {
  44050. return this;
  44051. }
  44052. }]);
  44053. function Keyword(value) {
  44054. CartoCSS_classCallCheck(this, Keyword);
  44055. this.value = value;
  44056. var special = {
  44057. 'transparent': 'color',
  44058. 'true': 'boolean',
  44059. 'false': 'boolean'
  44060. };
  44061. this.is = special[value] ? special[value] : 'keyword';
  44062. }
  44063. CartoCSS_createClass(Keyword, [{
  44064. key: "toString",
  44065. value: function toString() {
  44066. return this.value;
  44067. }
  44068. }]);
  44069. return Keyword;
  44070. }();
  44071. /*Layer:class Invalid ),*/
  44072. SuperMap.CartoCSS.Tree.Literal = /*#__PURE__*/function () {
  44073. function Literal(content) {
  44074. CartoCSS_classCallCheck(this, Literal);
  44075. this.value = content || '';
  44076. this.is = 'field';
  44077. }
  44078. CartoCSS_createClass(Literal, [{
  44079. key: "toString",
  44080. value: function toString() {
  44081. return this.value;
  44082. }
  44083. }, {
  44084. key: 'ev',
  44085. value: function ev() {
  44086. return this;
  44087. }
  44088. }]);
  44089. return Literal;
  44090. }();
  44091. SuperMap.CartoCSS.Tree.Operation = /*#__PURE__*/function () {
  44092. function Operation(op, operands, index) {
  44093. CartoCSS_classCallCheck(this, Operation);
  44094. this.is = 'operation';
  44095. this.op = op.trim();
  44096. this.operands = operands;
  44097. this.index = index;
  44098. }
  44099. CartoCSS_createClass(Operation, [{
  44100. key: "ev",
  44101. value: function ev(env) {
  44102. var a = this.operands[0].ev(env),
  44103. b = this.operands[1].ev(env),
  44104. temp;
  44105. if (a.is === 'undefined' || b.is === 'undefined') {
  44106. return {
  44107. is: 'undefined',
  44108. value: 'undefined'
  44109. };
  44110. }
  44111. if (a instanceof SuperMap.CartoCSS.Tree.Dimension && b instanceof SuperMap.CartoCSS.Tree.Color) {
  44112. if (this.op === '*' || this.op === '+') {
  44113. temp = b;
  44114. b = a;
  44115. a = temp;
  44116. } else {
  44117. env.error({
  44118. name: "OperationError",
  44119. message: "Can't substract or divide a color from a number",
  44120. index: this.index
  44121. });
  44122. }
  44123. } // Only concatenate plain strings, because this is easily
  44124. // pre-processed
  44125. if (a instanceof SuperMap.CartoCSS.Tree.Quoted && b instanceof SuperMap.CartoCSS.Tree.Quoted && this.op !== '+') {
  44126. env.error({
  44127. message: "Can't subtract, divide, or multiply strings.",
  44128. index: this.index,
  44129. type: 'runtime',
  44130. filename: this.filename
  44131. });
  44132. return {
  44133. is: 'undefined',
  44134. value: 'undefined'
  44135. };
  44136. } // Fields, literals, dimensions, and quoted strings can be combined.
  44137. if (a instanceof SuperMap.CartoCSS.Tree.Field || b instanceof SuperMap.CartoCSS.Tree.Field || a instanceof SuperMap.CartoCSS.Tree.Literal || b instanceof SuperMap.CartoCSS.Tree.Literal) {
  44138. if (a.is === 'color' || b.is === 'color') {
  44139. env.error({
  44140. message: "Can't subtract, divide, or multiply colors in expressions.",
  44141. index: this.index,
  44142. type: 'runtime',
  44143. filename: this.filename
  44144. });
  44145. return {
  44146. is: 'undefined',
  44147. value: 'undefined'
  44148. };
  44149. } else {
  44150. return new SuperMap.CartoCSS.Tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true));
  44151. }
  44152. }
  44153. if (a.operate === undefined) {
  44154. env.error({
  44155. message: 'Cannot do math with type ' + a.is + '.',
  44156. index: this.index,
  44157. type: 'runtime',
  44158. filename: this.filename
  44159. });
  44160. return {
  44161. is: 'undefined',
  44162. value: 'undefined'
  44163. };
  44164. }
  44165. return a.operate(env, this.op, b);
  44166. }
  44167. }]);
  44168. return Operation;
  44169. }();
  44170. SuperMap.CartoCSS.Tree.Quoted = /*#__PURE__*/function () {
  44171. function Quoted(content) {
  44172. CartoCSS_classCallCheck(this, Quoted);
  44173. this.is = 'string';
  44174. this.value = content || '';
  44175. }
  44176. CartoCSS_createClass(Quoted, [{
  44177. key: "toString",
  44178. value: function toString(quotes) {
  44179. var escapedValue = this.value.replace(/&/g, '&amp;');
  44180. var xmlvalue = escapedValue.replace(/\'/g, '\\\'').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/\>/g, '&gt;');
  44181. return quotes === true ? "'" + xmlvalue + "'" : escapedValue;
  44182. }
  44183. }, {
  44184. key: "ev",
  44185. value: function ev() {
  44186. return this;
  44187. }
  44188. }, {
  44189. key: "operate",
  44190. value: function operate(env, op, other) {
  44191. return new SuperMap.CartoCSS.Tree.Quoted(SuperMap.CartoCSS.Tree.operate(op, this.toString(), other.toString(this.contains_field)));
  44192. }
  44193. }]);
  44194. return Quoted;
  44195. }();
  44196. SuperMap.CartoCSS.Tree.Reference = {
  44197. _validateValue: {
  44198. 'font': function font(env, value) {
  44199. if (env.validation_data && env.validation_data.fonts) {
  44200. return env.validation_data.fonts.indexOf(value) != -1;
  44201. } else {
  44202. return true;
  44203. }
  44204. }
  44205. },
  44206. setData: function setData(data) {
  44207. this.data = data;
  44208. this.selector_cache = generateSelectorCache(data);
  44209. this.mapnikFunctions = generateMapnikFunctions(data);
  44210. this.required_cache = generateRequiredProperties(data);
  44211. function generateSelectorCache(data) {
  44212. var index = {};
  44213. for (var i in data.symbolizers) {
  44214. for (var j in data.symbolizers[i]) {
  44215. if (data.symbolizers[i][j].hasOwnProperty('css')) {
  44216. index[data.symbolizers[i][j].css] = [data.symbolizers[i][j], i, j];
  44217. }
  44218. }
  44219. }
  44220. return index;
  44221. }
  44222. function generateMapnikFunctions(data) {
  44223. var functions = {};
  44224. for (var i in data.symbolizers) {
  44225. for (var j in data.symbolizers[i]) {
  44226. if (data.symbolizers[i][j].type === 'functions') {
  44227. for (var k = 0; k < data.symbolizers[i][j].functions.length; k++) {
  44228. var fn = data.symbolizers[i][j].functions[k];
  44229. functions[fn[0]] = fn[1];
  44230. }
  44231. }
  44232. }
  44233. }
  44234. return functions;
  44235. }
  44236. function generateRequiredProperties(data) {
  44237. var cache = {};
  44238. for (var symbolizer_name in data.symbolizers) {
  44239. cache[symbolizer_name] = [];
  44240. for (var j in data.symbolizers[symbolizer_name]) {
  44241. if (data.symbolizers[symbolizer_name][j].required) {
  44242. cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css);
  44243. }
  44244. }
  44245. }
  44246. return cache;
  44247. }
  44248. },
  44249. setVersion: function setVersion(version) {
  44250. if (SuperMap.CartoCSS.mapnik_reference.version.hasOwnProperty(version)) {
  44251. this.setData(SuperMap.CartoCSS.mapnik_reference.version[version]);
  44252. return true;
  44253. }
  44254. return false;
  44255. },
  44256. selectorData: function selectorData(selector, i) {
  44257. if (this.selector_cache && this.selector_cache[selector]) {
  44258. return this.selector_cache[selector][i];
  44259. }
  44260. },
  44261. validSelector: function validSelector(selector) {
  44262. return !!this.selector_cache[selector];
  44263. },
  44264. selectorName: function selectorName(selector) {
  44265. return this.selectorData(selector, 2);
  44266. },
  44267. selector: function selector(_selector) {
  44268. return this.selectorData(_selector, 0);
  44269. },
  44270. symbolizer: function symbolizer(selector) {
  44271. return this.selectorData(selector, 1);
  44272. },
  44273. requiredProperties: function requiredProperties(symbolizer_name, rules) {
  44274. var req = this.required_cache[symbolizer_name];
  44275. for (var i in req) {
  44276. if (!(req[i] in rules)) {
  44277. return 'Property ' + req[i] + ' required for defining ' + symbolizer_name + ' styles.';
  44278. }
  44279. }
  44280. },
  44281. isFont: function isFont(selector) {
  44282. return this.selector(selector).validate === 'font';
  44283. },
  44284. editDistance: function editDistance(a, b) {
  44285. if (a.length === 0) {
  44286. return b.length;
  44287. }
  44288. if (b.length === 0) {
  44289. return a.length;
  44290. }
  44291. var matrix = [];
  44292. for (var i = 0; i <= b.length; i++) {
  44293. matrix[i] = [i];
  44294. }
  44295. for (var j = 0; j <= a.length; j++) {
  44296. matrix[0][j] = j;
  44297. }
  44298. for (i = 1; i <= b.length; i++) {
  44299. for (j = 1; j <= a.length; j++) {
  44300. if (b.charAt(i - 1) === a.charAt(j - 1)) {
  44301. matrix[i][j] = matrix[i - 1][j - 1];
  44302. } else {
  44303. matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
  44304. Math.min(matrix[i][j - 1] + 1, // insertion
  44305. matrix[i - 1][j] + 1)); // deletion
  44306. }
  44307. }
  44308. }
  44309. return matrix[b.length][a.length];
  44310. },
  44311. validValue: function validValue(env, selector, value) {
  44312. function validateFunctions(value, selector) {
  44313. if (value.value[0].is === 'string') {
  44314. return true;
  44315. }
  44316. for (var i in value.value) {
  44317. for (var j in value.value[i].value) {
  44318. if (value.value[i].value[j].is !== 'call') {
  44319. return false;
  44320. }
  44321. var f = find(this.selector(selector).functions, function (x) {
  44322. //NOSONAR
  44323. return x[0] === value.value[i].value[j].name;
  44324. });
  44325. if (!(f && f[1] === -1)) {
  44326. // This filter is unknown or given an incorrect number of arguments
  44327. if (!f || f[1] !== value.value[i].value[j].args.length) {
  44328. return false;
  44329. }
  44330. }
  44331. }
  44332. }
  44333. return true;
  44334. }
  44335. function validateKeyword(value, selector) {
  44336. if (CartoCSS_typeof(this.selector(selector).type) === 'object') {
  44337. return this.selector(selector).type.indexOf(value.value[0].value) !== -1;
  44338. } else {
  44339. // allow unquoted keywords as strings
  44340. return this.selector(selector).type === 'string';
  44341. }
  44342. }
  44343. var i;
  44344. if (!this.selector(selector)) {
  44345. return false;
  44346. } else if (value.value[0].is === 'keyword') {
  44347. return validateKeyword(value, selector);
  44348. } else if (value.value[0].is === 'undefined') {
  44349. // caught earlier in the chain - ignore here so that
  44350. // error is not overridden
  44351. return true;
  44352. } else if (this.selector(selector).type === 'numbers') {
  44353. for (i in value.value) {
  44354. if (value.value[i].is !== 'float') {
  44355. return false;
  44356. }
  44357. }
  44358. return true;
  44359. } else if (this.selector(selector).type === 'tags') {
  44360. if (!value.value) {
  44361. return false;
  44362. }
  44363. if (!value.value[0].value) {
  44364. return value.value[0].is === 'tag';
  44365. }
  44366. for (i = 0; i < value.value[0].value.length; i++) {
  44367. if (value.value[0].value[i].is !== 'tag') {
  44368. return false;
  44369. }
  44370. }
  44371. return true;
  44372. } else if (this.selector(selector).type == 'functions') {
  44373. // For backwards compatibility, you can specify a string for `functions`-compatible
  44374. // values, though they will not be validated.
  44375. return validateFunctions(value, selector);
  44376. } else if (this.selector(selector).type === 'expression') {
  44377. return true;
  44378. } else if (this.selector(selector).type === 'unsigned') {
  44379. if (value.value[0].is === 'float') {
  44380. value.value[0].round();
  44381. return true;
  44382. } else {
  44383. return false;
  44384. }
  44385. } else {
  44386. if (this.selector(selector).validate) {
  44387. var valid = false;
  44388. for (i = 0; i < value.value.length; i++) {
  44389. if (this.selector(selector).type === value.value[i].is && this._validateValue[this.selector(selector).validate](env, value.value[i].value)) {
  44390. return true;
  44391. }
  44392. }
  44393. return valid;
  44394. } else {
  44395. return this.selector(selector).type === value.value[0].is;
  44396. }
  44397. }
  44398. }
  44399. };
  44400. SuperMap.CartoCSS.Tree.Reference.setVersion("latest");
  44401. SuperMap.CartoCSS.Tree.Rule = /*#__PURE__*/function () {
  44402. function Rule(name, value, index, filename) {
  44403. CartoCSS_classCallCheck(this, Rule);
  44404. this.is = 'rule';
  44405. var parts = name.split('/');
  44406. this.name = parts.pop();
  44407. this.instance = parts.length ? parts[0] : '__default__';
  44408. this.value = value instanceof SuperMap.CartoCSS.Tree.Value ? value : new SuperMap.CartoCSS.Tree.Value([value]);
  44409. this.index = index;
  44410. this.symbolizer = SuperMap.CartoCSS.Tree.Reference.symbolizer(this.name);
  44411. this.filename = filename;
  44412. this.variable = name.charAt(0) === '@';
  44413. }
  44414. CartoCSS_createClass(Rule, [{
  44415. key: "clone",
  44416. value: function clone() {
  44417. var clone = Object.create(SuperMap.CartoCSS.Tree.Rule.prototype);
  44418. clone.name = this.name;
  44419. clone.value = this.value;
  44420. clone.index = this.index;
  44421. clone.instance = this.instance;
  44422. clone.symbolizer = this.symbolizer;
  44423. clone.filename = this.filename;
  44424. clone.variable = this.variable;
  44425. return clone;
  44426. }
  44427. }, {
  44428. key: "updateID",
  44429. value: function updateID() {
  44430. return this.id = this.zoom + '#' + this.instance + '#' + this.name;
  44431. }
  44432. }, {
  44433. key: "toString",
  44434. value: function toString() {
  44435. return '[' + SuperMap.CartoCSS.Tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value;
  44436. }
  44437. }, {
  44438. key: "ev",
  44439. value: function ev(context) {
  44440. return new SuperMap.CartoCSS.Tree.Rule(this.name, this.value.ev(context), this.index, this.filename);
  44441. }
  44442. }]);
  44443. return Rule;
  44444. }();
  44445. SuperMap.CartoCSS.Tree.Ruleset = /*#__PURE__*/function () {
  44446. function Ruleset(selectors, rules) {
  44447. CartoCSS_classCallCheck(this, Ruleset);
  44448. this.is = 'ruleset';
  44449. this.selectors = selectors;
  44450. this.rules = rules; // static cache of find() function
  44451. this._lookups = {};
  44452. }
  44453. CartoCSS_createClass(Ruleset, [{
  44454. key: "ev",
  44455. value: function ev(env) {
  44456. var i,
  44457. rule,
  44458. ruleset = new SuperMap.CartoCSS.Tree.Ruleset(this.selectors, this.rules.slice(0));
  44459. ruleset.root = this.root; // push the current ruleset to the frames stack
  44460. env.frames.unshift(ruleset); // Evaluate everything else
  44461. for (i = 0, rule; i < ruleset.rules.length; i++) {
  44462. rule = ruleset.rules[i];
  44463. ruleset.rules[i] = rule.ev ? rule.ev(env) : rule;
  44464. } // Pop the stack
  44465. env.frames.shift();
  44466. return ruleset;
  44467. }
  44468. }, {
  44469. key: "match",
  44470. value: function match(args) {
  44471. return !args || args.length === 0;
  44472. }
  44473. }, {
  44474. key: "variables",
  44475. value: function variables() {
  44476. if (this._variables) {
  44477. return this._variables;
  44478. } else {
  44479. return this._variables = this.rules.reduce(function (hash, r) {
  44480. if (r instanceof SuperMap.CartoCSS.Tree.Rule && r.variable === true) {
  44481. hash[r.name] = r;
  44482. }
  44483. return hash;
  44484. }, {});
  44485. }
  44486. }
  44487. }, {
  44488. key: "variable",
  44489. value: function variable(name) {
  44490. return this.variables()[name];
  44491. }
  44492. }, {
  44493. key: "rulesets",
  44494. value: function rulesets() {
  44495. if (this._rulesets) {
  44496. return this._rulesets;
  44497. } else {
  44498. return this._rulesets = this.rules.filter(function (r) {
  44499. return r instanceof SuperMap.CartoCSS.Tree.Ruleset;
  44500. });
  44501. }
  44502. }
  44503. }, {
  44504. key: "find",
  44505. value: function find(selector, self) {
  44506. self = self || this;
  44507. var rules = [],
  44508. match,
  44509. key = selector.toString();
  44510. if (key in this._lookups) {
  44511. return this._lookups[key];
  44512. }
  44513. this.rulesets().forEach(function (rule) {
  44514. if (rule !== self) {
  44515. for (var j = 0; j < rule.selectors.length; j++) {
  44516. match = selector.match(rule.selectors[j]);
  44517. if (match) {
  44518. if (selector.elements.length > 1) {
  44519. Array.prototype.push.apply(rules, rule.find(new SuperMap.CartoCSS.Tree.Selector(null, null, selector.elements.slice(1)), self));
  44520. } else {
  44521. rules.push(rule);
  44522. }
  44523. break;
  44524. }
  44525. }
  44526. }
  44527. });
  44528. return this._lookups[key] = rules;
  44529. } // Zooms can use variables. This replaces SuperMap.CartoCSS.Tree.Zoom objects on selectors
  44530. // with simple bit-arrays that we can compare easily.
  44531. }, {
  44532. key: "evZooms",
  44533. value: function evZooms(env) {
  44534. for (var i = 0; i < this.selectors.length; i++) {
  44535. var zval = SuperMap.CartoCSS.Tree.Zoom.all;
  44536. for (var z = 0; z < this.selectors[i].zoom.length; z++) {
  44537. zval = this.selectors[i].zoom[z].ev(env).zoom;
  44538. }
  44539. this.selectors[i].zoom = zval;
  44540. }
  44541. }
  44542. }, {
  44543. key: "flatten",
  44544. value: function flatten(result, parents, env) {
  44545. var selectors = [],
  44546. i,
  44547. j;
  44548. if (this.selectors.length === 0) {
  44549. env.frames = env.frames.concat(this.rules);
  44550. } // evaluate zoom variables on this object.
  44551. this.evZooms(env);
  44552. for (i = 0; i < this.selectors.length; i++) {
  44553. var child = this.selectors[i];
  44554. if (!child.filters) {
  44555. // This is an invalid filterset.
  44556. continue;
  44557. }
  44558. if (parents.length) {
  44559. for (j = 0; j < parents.length; j++) {
  44560. var parent = parents[j];
  44561. var mergedFilters = parent.filters.cloneWith(child.filters);
  44562. if (mergedFilters === null) {
  44563. // Filters could be added, but they didn't change the
  44564. // filters. This means that we only have to clone when
  44565. // the zoom levels or the attachment is different too.
  44566. if (parent.zoom === child.zoom && parent.attachment === child.attachment && parent.elements.join() === child.elements.join()) {
  44567. selectors.push(parent);
  44568. continue;
  44569. } else {
  44570. mergedFilters = parent.filters;
  44571. }
  44572. } else if (!mergedFilters) {
  44573. // The merged filters are invalid, that means we don't
  44574. // have to clone.
  44575. continue;
  44576. }
  44577. var clone = Object.create(SuperMap.CartoCSS.Tree.Selector.prototype);
  44578. clone.filters = mergedFilters;
  44579. clone.zoom = child.zoom;
  44580. clone.elements = parent.elements.concat(child.elements);
  44581. if (parent.attachment && child.attachment) {
  44582. clone.attachment = parent.attachment + '/' + child.attachment;
  44583. } else {
  44584. clone.attachment = child.attachment || parent.attachment;
  44585. }
  44586. clone.conditions = parent.conditions + child.conditions;
  44587. clone.index = child.index;
  44588. selectors.push(clone);
  44589. }
  44590. } else {
  44591. selectors.push(child);
  44592. }
  44593. }
  44594. var rules = [];
  44595. for (i = 0; i < this.rules.length; i++) {
  44596. var rule = this.rules[i]; // Recursively flatten any nested rulesets
  44597. if (rule instanceof SuperMap.CartoCSS.Tree.Ruleset) {
  44598. rule.flatten(result, selectors, env);
  44599. } else if (rule instanceof SuperMap.CartoCSS.Tree.Rule) {
  44600. rules.push(rule);
  44601. } else if (rule instanceof SuperMap.CartoCSS.Tree.Invalid) {
  44602. env.error(rule);
  44603. }
  44604. }
  44605. var index = rules.length ? rules[0].index : false;
  44606. for (i = 0; i < selectors.length; i++) {
  44607. // For specificity sort, use the position of the first rule to allow
  44608. // defining attachments that are under current element as a descendant
  44609. // selector.
  44610. if (index !== false) {
  44611. selectors[i].index = index;
  44612. }
  44613. result.push(new SuperMap.CartoCSS.Tree.Definition(selectors[i], rules.slice()));
  44614. }
  44615. return result;
  44616. }
  44617. }]);
  44618. return Ruleset;
  44619. }();
  44620. SuperMap.CartoCSS.Tree.Selector = /*#__PURE__*/function () {
  44621. function Selector(filters, zoom, elements, attachment, conditions, index) {
  44622. CartoCSS_classCallCheck(this, Selector);
  44623. this.elements = elements || [];
  44624. this.attachment = attachment;
  44625. this.filters = filters || {};
  44626. this.zoom = typeof zoom !== 'undefined' ? zoom : SuperMap.CartoCSS.Tree.Zoom.all;
  44627. this.conditions = conditions;
  44628. this.index = index;
  44629. }
  44630. CartoCSS_createClass(Selector, [{
  44631. key: "specificity",
  44632. value: function specificity() {
  44633. return this.elements.reduce(function (memo, e) {
  44634. var spec = e.specificity();
  44635. memo[0] += spec[0];
  44636. memo[1] += spec[1];
  44637. return memo;
  44638. }, [0, 0, this.conditions, this.index]);
  44639. }
  44640. }]);
  44641. return Selector;
  44642. }();
  44643. /*style:class Invalid ),*/
  44644. SuperMap.CartoCSS.Tree.URL = /*#__PURE__*/function () {
  44645. function URL(val, paths) {
  44646. CartoCSS_classCallCheck(this, URL);
  44647. this.is = 'uri';
  44648. this.value = val;
  44649. this.paths = paths;
  44650. }
  44651. CartoCSS_createClass(URL, [{
  44652. key: "toString",
  44653. value: function toString() {
  44654. return this.value.toString();
  44655. }
  44656. }, {
  44657. key: "ev",
  44658. value: function ev(ctx) {
  44659. return new SuperMap.CartoCSS.Tree.URL(this.value.ev(ctx), this.paths);
  44660. }
  44661. }]);
  44662. return URL;
  44663. }();
  44664. SuperMap.CartoCSS.Tree.Value = /*#__PURE__*/function () {
  44665. function Value(value) {
  44666. CartoCSS_classCallCheck(this, Value);
  44667. this.is = 'value';
  44668. this.value = value;
  44669. }
  44670. CartoCSS_createClass(Value, [{
  44671. key: "ev",
  44672. value: function ev(env) {
  44673. if (this.value.length === 1) {
  44674. return this.value[0].ev(env);
  44675. } else {
  44676. return new SuperMap.CartoCSS.Tree.Value(this.value.map(function (v) {
  44677. return v.ev(env);
  44678. }));
  44679. }
  44680. }
  44681. }, {
  44682. key: "toJS",
  44683. value: function toJS(env) {
  44684. //var v = this.value[0].value[0];
  44685. var val = this.ev(env);
  44686. var v = val.toString();
  44687. if (val.is === "color" || val.is === 'uri' || val.is === 'string' || val.is === 'keyword') {
  44688. v = "'" + v + "'";
  44689. } else if (val.is === 'field') {
  44690. // replace [varuable] by ctx['variable']
  44691. v = v.replace(/\[(.*)\]/g, "attributes['\_match1']");
  44692. } else if (val.value && CartoCSS_typeof(val.value) === "object") {
  44693. v = "[" + v + "]";
  44694. }
  44695. return "_value = " + v + ";";
  44696. }
  44697. }, {
  44698. key: "toString",
  44699. value: function toString(env, selector, sep, format) {
  44700. return this.value.map(function (e) {
  44701. return e.toString(env, format);
  44702. }).join(sep || ', ');
  44703. }
  44704. }, {
  44705. key: "clone",
  44706. value: function clone() {
  44707. var obj = Object.create(SuperMap.CartoCSS.Tree.Value.prototype);
  44708. if (Array.isArray(obj)) {
  44709. obj.value = this.value.slice();
  44710. } else {
  44711. obj.value = this.value;
  44712. }
  44713. obj.is = this.is;
  44714. return obj;
  44715. }
  44716. }]);
  44717. return Value;
  44718. }();
  44719. SuperMap.CartoCSS.Tree.Variable = /*#__PURE__*/function () {
  44720. function Variable(name, index, filename) {
  44721. CartoCSS_classCallCheck(this, Variable);
  44722. this.is = 'variable';
  44723. this.name = name;
  44724. this.index = index;
  44725. this.filename = filename;
  44726. }
  44727. CartoCSS_createClass(Variable, [{
  44728. key: "toString",
  44729. value: function toString() {
  44730. return this.name;
  44731. }
  44732. }, {
  44733. key: "ev",
  44734. value: function ev(env) {
  44735. if (this._css) {
  44736. return this._css;
  44737. }
  44738. var thisframe = env.frames.filter(function (f) {
  44739. return f.name === this.name;
  44740. }.bind(this));
  44741. if (thisframe.length) {
  44742. return thisframe[0].value.ev(env);
  44743. } else {
  44744. env.error({
  44745. message: 'variable ' + this.name + ' is undefined',
  44746. index: this.index,
  44747. type: 'runtime',
  44748. filename: this.filename
  44749. });
  44750. return {
  44751. is: 'undefined',
  44752. value: 'undefined'
  44753. };
  44754. }
  44755. }
  44756. }]);
  44757. return Variable;
  44758. }();
  44759. SuperMap.CartoCSS.Tree.Zoom = /*#__PURE__*/function () {
  44760. function Zoom(op, value, index) {
  44761. CartoCSS_classCallCheck(this, Zoom);
  44762. this.op = op;
  44763. this.value = value;
  44764. this.index = index;
  44765. }
  44766. CartoCSS_createClass(Zoom, [{
  44767. key: "setZoom",
  44768. value: function setZoom(zoom) {
  44769. this.zoom = zoom;
  44770. return this;
  44771. }
  44772. }, {
  44773. key: "ev",
  44774. value: function ev(env) {
  44775. var value = parseInt(this.value.ev(env).toString(), 10);
  44776. if (value > SuperMap.CartoCSS.Tree.Zoom.maxZoom || value < 0) {
  44777. env.error({
  44778. message: 'Only zoom levels between 0 and ' + SuperMap.CartoCSS.Tree.Zoom.maxZoom + ' supported.',
  44779. index: this.index
  44780. });
  44781. }
  44782. switch (this.op) {
  44783. case '=':
  44784. this.zoom = "zoom && zoom === " + value;
  44785. return this;
  44786. case '>':
  44787. this.zoom = "zoom && zoom > " + value;
  44788. break;
  44789. case '>=':
  44790. this.zoom = "zoom && zoom >= " + value;
  44791. break;
  44792. case '<':
  44793. this.zoom = "zoom && zoom < " + value;
  44794. break;
  44795. case '<=':
  44796. this.zoom = "zoom && zoom <= " + value;
  44797. break;
  44798. default:
  44799. return this;
  44800. break;
  44801. }
  44802. /*
  44803. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  44804. if (i >= start && i <= end) {
  44805. zoom |= (1 << i);
  44806. }
  44807. }
  44808. this.zoom = zoom;
  44809. this.zoom=value+this.op+"zoom";*/
  44810. return this;
  44811. }
  44812. }, {
  44813. key: "toString",
  44814. value: function toString() {
  44815. var str = '';
  44816. for (var i = 0; i <= SuperMap.CartoCSS.Tree.Zoom.maxZoom; i++) {
  44817. str += this.zoom & 1 << i ? 'X' : '.';
  44818. }
  44819. return str;
  44820. }
  44821. }]);
  44822. return Zoom;
  44823. }(); // Covers all zoomlevels from 0 to 22
  44824. SuperMap.CartoCSS.Tree.Zoom.all = 23;
  44825. SuperMap.CartoCSS.Tree.Zoom.maxZoom = 22;
  44826. SuperMap.CartoCSS.Tree.Zoom.ranges = {
  44827. 0: 1000000000,
  44828. 1: 500000000,
  44829. 2: 200000000,
  44830. 3: 100000000,
  44831. 4: 50000000,
  44832. 5: 25000000,
  44833. 6: 12500000,
  44834. 7: 6500000,
  44835. 8: 3000000,
  44836. 9: 1500000,
  44837. 10: 750000,
  44838. 11: 400000,
  44839. 12: 200000,
  44840. 13: 100000,
  44841. 14: 50000,
  44842. 15: 25000,
  44843. 16: 12500,
  44844. 17: 5000,
  44845. 18: 2500,
  44846. 19: 1500,
  44847. 20: 750,
  44848. 21: 500,
  44849. 22: 250,
  44850. 23: 100
  44851. };
  44852. ;// CONCATENATED MODULE: ./src/common/style/ThemeStyle.js
  44853. function ThemeStyle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  44854. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  44855. * This program are made available under the terms of the Apache License, Version 2.0
  44856. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  44857. /**
  44858. * @class SuperMap.ThemeStyle
  44859. * @classdesc 客户端专题图风格类。
  44860. * @category Visualization Theme
  44861. * @param {Object} options - 可选参数。
  44862. * @param {boolean} [options.fill=true] - 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  44863. * @param {string} [options.fillColor='#000000'] - 十六进制填充颜色。
  44864. * @param {number} [options.fillOpacity=1] - 填充不透明度。取值范围[0, 1]。
  44865. * @param {boolean} [options.stroke=false] - 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  44866. * @param {string} [options.strokeColor='#000000'] - 十六进制描边颜色。
  44867. * @param {number} [options.strokeOpacity=1] - 描边的不透明度。取值范围[0, 1]。
  44868. * @param {number} [options.strokeWidth=1] - 线宽度/描边宽度。
  44869. * @param {string} [options.strokeLinecap='butt'] - 线帽样式。strokeLinecap 有三种类型 “butt", "round", "square"。
  44870. * @param {string} [options.strokeLineJoin='iter'] - 线段连接样式。strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  44871. * @param {string} [options.strokeDashstyle='solid'] - 虚线类型。strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"。solid 表示实线。
  44872. * @param {number} [options.pointRadius=6] - 点半径,单位为像素。
  44873. * @param {number} [options.shadowBlur=0] - 阴影模糊度,(大于 0 有效;)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  44874. * @param {string} [options.shadowColor='#000000'] - 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  44875. * @param {number} [options.shadowOffsetX=0] - 阴影 X 方向偏移值。
  44876. * @param {number} [options.shadowOffsetY=0] - 阴影 Y 方向偏移值。
  44877. * @param {string} options.label - 专题要素附加文本标签内容。
  44878. * @param {string} [options.fontColor] - 附加文本字体颜色。
  44879. * @param {number} [options.fontSize=12] - 附加文本字体大小,单位是像素。
  44880. * @param {string} [options.fontStyle='normal'] - 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  44881. * @param {string} [options.fontVariant='normal'] - 附加文本字体变体。可设值:"normal", "small-caps"。
  44882. * @param {string} [options.fontWeight='normal'] - 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  44883. * @param {string} [options.fontFamily='arial,sans-serif'] - 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,
  44884. * 浏览器会使用它可识别的第一个可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称
  44885. * ("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  44886. * @param {string} [options.labelPosition='top'] - 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  44887. * @param {string} [options.labelAlign='center'] - 附加文本水平对齐。可以是 'left', 'right', 'center'。
  44888. * @param {string} [options.labelBaseline='middle'] - 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle' 。
  44889. * @param {number} [options.labelXOffset=0] - 附加文本在x轴方向的偏移量。
  44890. * @param {number} [options.labelYOffset=0] - 附加文本在y轴方向的偏移量。
  44891. */
  44892. var ThemeStyle = function ThemeStyle(options) {
  44893. ThemeStyle_classCallCheck(this, ThemeStyle);
  44894. options = options || {};
  44895. /**
  44896. * @member {boolean} [SuperMap.ThemeStyle.prototype.fill=true]
  44897. * @description 是否填充,不需要填充则设置为 false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  44898. */
  44899. this.fill = true;
  44900. /**
  44901. * @member {string} [SuperMap.ThemeStyle.prototype.fillColor="#000000"]
  44902. * @description 十六进制填充颜色。
  44903. */
  44904. this.fillColor = "#000000";
  44905. /**
  44906. * @member {number} [SuperMap.ThemeStyle.prototype.fillOpacity=1]
  44907. * @description 填充不透明度。取值范围[0, 1]。
  44908. */
  44909. this.fillOpacity = 1;
  44910. /**
  44911. * @member {boolean} [SuperMap.ThemeStyle.prototype.stroke=false]
  44912. * @description 是否描边,不需要描边则设置为false。如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染图层。
  44913. */
  44914. this.stroke = false;
  44915. /**
  44916. * @member {string} [SuperMap.ThemeStyle.prototype.strokeColor="#000000"]
  44917. * @description 十六进制描边颜色。
  44918. */
  44919. this.strokeColor = "#000000";
  44920. /**
  44921. * @member {number} [SuperMap.ThemeStyle.prototype.strokeOpacity=1]
  44922. * @description 描边的不透明度。取值范围[0, 1]。
  44923. */
  44924. this.strokeOpacity = 1;
  44925. /**
  44926. * @member {number} [SuperMap.ThemeStyle.prototype.strokeWidth=1]
  44927. * @description 线宽度/描边宽度。
  44928. */
  44929. this.strokeWidth = 1;
  44930. /**
  44931. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLinecap="butt"]
  44932. * @description 线帽样式;strokeLinecap 有三种类型 “butt", "round", "square" 。
  44933. */
  44934. this.strokeLinecap = "butt";
  44935. /**
  44936. * @member {string} [SuperMap.ThemeStyle.prototype.strokeLineJoin="miter"]
  44937. * @description 线段连接样式;strokeLineJoin 有三种类型 “miter", "round", "bevel"。
  44938. */
  44939. this.strokeLineJoin = "miter";
  44940. /**
  44941. * @member {string} [SuperMap.ThemeStyle.prototype.strokeDashstyle="solid"]
  44942. * @description 虚线类型; strokeDashstyle 有八种类型 “dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted";
  44943. * solid 表示实线。
  44944. */
  44945. this.strokeDashstyle = "solid";
  44946. /**
  44947. * @member {number} [SuperMap.ThemeStyle.prototype.pointRadius=6]
  44948. * @description 点半径。单位为像素。
  44949. */
  44950. this.pointRadius = 6;
  44951. /**
  44952. * @member {number} [SuperMap.ThemeStyle.prototype.shadowBlur=0]
  44953. * @description 阴影模糊度,(大于 0 有效)。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  44954. */
  44955. this.shadowBlur = 0;
  44956. /**
  44957. * @member {string} [SuperMap.ThemeStyle.prototype.shadowColor='#000000']
  44958. * @description 阴影颜色。注:请将 shadowColor 属性与 shadowBlur 属性一起使用,来创建阴影。
  44959. */
  44960. this.shadowColor = "#000000";
  44961. /**
  44962. * @member {number} [SuperMap.ThemeStyle.prototype.shadowOffsetX=0]
  44963. * @description 阴影 X 方向偏移值。
  44964. */
  44965. this.shadowOffsetX = 0;
  44966. /**
  44967. * @member {number} SuperMap.ThemeStyle.prototype.shadowOffsetY
  44968. * @description Y 方向偏移值。
  44969. */
  44970. this.shadowOffsetY = 0;
  44971. /**
  44972. * @member {string} [SuperMap.ThemeStyle.prototype.label]
  44973. * @description 专题要素附加文本标签内容。
  44974. */
  44975. this.label = "";
  44976. /**
  44977. * @member {boolean} [SuperMap.ThemeStyle.prototype.labelRect=false]
  44978. * @description 是否显示文本标签矩形背景。
  44979. */
  44980. this.labelRect = false;
  44981. /**
  44982. * @member {string} [SuperMap.ThemeStyle.prototype.fontColor]
  44983. * @description 附加文本字体颜色。
  44984. */
  44985. this.fontColor = "";
  44986. /**
  44987. * @member {number} [SuperMap.ThemeStyle.prototype.fontSize=12]
  44988. * @description 附加文本字体大小,单位是像素。
  44989. */
  44990. this.fontSize = 12;
  44991. /**
  44992. * @member {string} [SuperMap.ThemeStyle.prototype.fontStyle="normal"]
  44993. * @description 附加文本字体样式。可设值:"normal", "italic", "oblique"。
  44994. */
  44995. this.fontStyle = "normal";
  44996. /**
  44997. * @member {string} [SuperMap.ThemeStyle.prototype.fontVariant="normal"]
  44998. * @description 附加文本字体变体。可设值:"normal", "small-caps"。
  44999. */
  45000. this.fontVariant = "normal";
  45001. /**
  45002. * @member {string} [SuperMap.ThemeStyle.prototype.fontWeight="normal"]
  45003. * @description 附加文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"。
  45004. */
  45005. this.fontWeight = "normal";
  45006. /**
  45007. * @member {string} [SuperMap.ThemeStyle.prototype.fontFamily="arial,sans-serif"]
  45008. * @description 附加文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个
  45009. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。
  45010. */
  45011. this.fontFamily = "arial,sans-serif";
  45012. /**
  45013. * @member {string} [SuperMap.ThemeStyle.prototype.labelPosition='top']
  45014. * @description 附加文本位置, 可以是 'inside', 'left', 'right', 'top', 'bottom'。
  45015. */
  45016. this.labelPosition = "top";
  45017. /**
  45018. * @member {string} [SuperMap.ThemeStyle.prototype.labelAlign='center']
  45019. * @description 附加文本水平对齐。可以是 'left', 'right', 'center'。
  45020. */
  45021. this.labelAlign = "center";
  45022. /**
  45023. * @member {string} [SuperMap.ThemeStyle.prototype.labelBaseline='middle']
  45024. * @description 附加文本垂直对齐。 可以是 'top', 'bottom', 'middle'。
  45025. */
  45026. this.labelBaseline = "middle";
  45027. /**
  45028. * @member {number} [SuperMap.ThemeStyle.prototype.labelXOffset=0]
  45029. * @description 附加文本在 X 轴方向的偏移量。
  45030. */
  45031. this.labelXOffset = 0;
  45032. /**
  45033. * @member {number} [SuperMap.ThemeStyle.prototype.labelYOffset=0]
  45034. * @description 附加文本在 Y 轴方向的偏移量。
  45035. */
  45036. this.labelYOffset = 0;
  45037. Util.extend(this, options);
  45038. };
  45039. SuperMap.ThemeStyle = ThemeStyle;
  45040. ;// CONCATENATED MODULE: ./src/common/style/index.js
  45041. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45042. * This program are made available under the terms of the Apache License, Version 2.0
  45043. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45044. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeParameters.js
  45045. function ShapeParameters_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45046. 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); } }
  45047. function ShapeParameters_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeParameters_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeParameters_defineProperties(Constructor, staticProps); return Constructor; }
  45048. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45049. * This program are made available under the terms of the Apache License, Version 2.0
  45050. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45051. /**
  45052. * @class SuperMap.Feature.ShapeParameters
  45053. * @category Visualization Theme
  45054. * @classdesc 图形参数基类,此类不可实例化
  45055. */
  45056. var ShapeParameters = /*#__PURE__*/function () {
  45057. /**
  45058. * @function SuperMap.Feature.ShapeParameters.prototype.constructor
  45059. * @description 图形参数对象。
  45060. * @returns {SuperMap.Feature.ShapeParameters} 图形参数对象。
  45061. */
  45062. function ShapeParameters() {
  45063. ShapeParameters_classCallCheck(this, ShapeParameters);
  45064. /**
  45065. * @member {Array} [SuperMap.Feature.ShapeParameters.prototype.refOriginalPosition=[0,0]]
  45066. * @description 图形参考原点位置,图形的参考中心位置。
  45067. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  45068. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  45069. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  45070. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  45071. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  45072. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  45073. * refOriginalPosition 的值为 [0, 0] 时,图形的位置信息才是 canvas 绝对位置。
  45074. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  45075. */
  45076. this.refOriginalPosition = [0, 0];
  45077. /**
  45078. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataID
  45079. * @description 图形所关联数据的 ID(<{@link SuperMap.Feature.Vector}> 的 id)。
  45080. */
  45081. this.refDataID = null;
  45082. /**
  45083. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.isHoverByRefDataID
  45084. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  45085. */
  45086. this.isHoverByRefDataID = false;
  45087. /**
  45088. * @member {string} SuperMap.Feature.ShapeParameters.prototype.refDataHoverGroup
  45089. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  45090. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  45091. */
  45092. this.refDataHoverGroup = null;
  45093. /**
  45094. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.dataInfo
  45095. * @description 图形携带的附加数据。
  45096. */
  45097. this.dataInfo = null;
  45098. /**
  45099. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.clickable
  45100. * @description 是否可点击。
  45101. */
  45102. this.clickable = true;
  45103. /**
  45104. * @member {boolean} SuperMap.Feature.ShapeParameters.prototype.hoverable
  45105. * @description 是否可点击。
  45106. */
  45107. this.hoverable = true;
  45108. /**
  45109. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.style
  45110. * @description 图形样式对象,可设样式属性在子类中确定。
  45111. */
  45112. this.style = null;
  45113. /**
  45114. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.highlightStyle
  45115. * @description 高亮样式对象,可设样式属性与 style 的可设样式属性相同。
  45116. */
  45117. this.highlightStyle = {};
  45118. this.CLASS_NAME = "SuperMap.Feature.ShapeParameters";
  45119. }
  45120. /**
  45121. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  45122. * @description 销毁对象。
  45123. */
  45124. ShapeParameters_createClass(ShapeParameters, [{
  45125. key: "destroy",
  45126. value: function destroy() {
  45127. this.refOriginalPosition = null;
  45128. this.refDataID = null;
  45129. this.isHoverByRefDataID = null;
  45130. this.refDataHoverGroup = null;
  45131. this.dataInfo = null;
  45132. this.clickable = null;
  45133. this.hoverable = null;
  45134. this.style = null;
  45135. this.highlightStyle = null;
  45136. }
  45137. }]);
  45138. return ShapeParameters;
  45139. }();
  45140. SuperMap.Feature = SuperMap.Feature || {};
  45141. SuperMap.Feature.ShapeParameters = ShapeParameters;
  45142. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Point.js
  45143. function feature_Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Point_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Point_typeof(obj); }
  45144. function feature_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45145. 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); } }
  45146. function feature_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Point_defineProperties(Constructor, staticProps); return Constructor; }
  45147. function feature_Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Point_get = Reflect.get; } 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(receiver); } return desc.value; }; } return feature_Point_get(target, property, receiver || target); }
  45148. function feature_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  45149. 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 } }); if (superClass) feature_Point_setPrototypeOf(subClass, superClass); }
  45150. function feature_Point_setPrototypeOf(o, p) { feature_Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Point_setPrototypeOf(o, p); }
  45151. 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); }; }
  45152. function feature_Point_possibleConstructorReturn(self, call) { if (call && (feature_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Point_assertThisInitialized(self); }
  45153. function feature_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45154. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45155. function feature_Point_getPrototypeOf(o) { feature_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Point_getPrototypeOf(o); }
  45156. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45157. * This program are made available under the terms of the Apache License, Version 2.0
  45158. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45159. /**
  45160. * @class SuperMap.Feature.ShapeParameters.Point
  45161. * @category Visualization Theme
  45162. * @classdesc 点参数对象。
  45163. * @extends {SuperMap.Feature.ShapeParameters}
  45164. */
  45165. var Point_Point = /*#__PURE__*/function (_ShapeParameters) {
  45166. feature_Point_inherits(Point, _ShapeParameters);
  45167. var _super = feature_Point_createSuper(Point);
  45168. /**
  45169. * @function SuperMap.Feature.ShapeParameters.Point.prototype.constructor
  45170. * @description 创建一个图形点参数对象。
  45171. * @param {number} x - 点 x 坐标,必设参数。
  45172. * @param {number} y - 点 y 坐标,必设参数。
  45173. * @returns {SuperMap.Feature.ShapeParameters.Point} 标签参数对象。
  45174. */
  45175. function Point(x, y) {
  45176. var _this;
  45177. feature_Point_classCallCheck(this, Point);
  45178. _this = _super.call(this, x, y);
  45179. /**
  45180. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.x
  45181. * @description 点 x 坐标。
  45182. */
  45183. _this.x = !isNaN(x) ? x : 0;
  45184. /**
  45185. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.y
  45186. * @description 点 y 坐标。
  45187. */
  45188. _this.y = !isNaN(y) ? y : 0;
  45189. /**
  45190. * @member {number} SuperMap.Feature.ShapeParameters.Point.prototype.r
  45191. * @description 点的半径。
  45192. */
  45193. _this.r = 6;
  45194. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Point";
  45195. return _this;
  45196. }
  45197. /**
  45198. * @function SuperMap.Feature.ShapeParameters.Point.prototype.destroy
  45199. * @description 销毁对象。
  45200. */
  45201. feature_Point_createClass(Point, [{
  45202. key: "destroy",
  45203. value: function destroy() {
  45204. this.x = null;
  45205. this.y = null;
  45206. this.r = null;
  45207. feature_Point_get(feature_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  45208. }
  45209. }]);
  45210. return Point;
  45211. }(ShapeParameters);
  45212. /**
  45213. * @typedef {Object} SuperMap.Feature.ShapeParameters.Point.style
  45214. * @property {number} pointRadius - 点的半径,默认值:6。
  45215. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45216. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45217. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45218. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45219. * @property {string} strokeColor - 十六进制描边颜色。
  45220. * @property {number} strokeWidth - 描边宽度,默认值 1。
  45221. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45222. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45223. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45224. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45225. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45226. */
  45227. SuperMap.Feature = SuperMap.Feature || {};
  45228. SuperMap.Feature.ShapeParameters.Point = Point_Point;
  45229. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Line.js
  45230. function Line_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Line_typeof = function _typeof(obj) { return typeof obj; }; } else { Line_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Line_typeof(obj); }
  45231. function Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45232. 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); } }
  45233. function Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) Line_defineProperties(Constructor, staticProps); return Constructor; }
  45234. function Line_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Line_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Line_get(target, property, receiver || target); }
  45235. function Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Line_getPrototypeOf(object); if (object === null) break; } return object; }
  45236. 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 } }); if (superClass) Line_setPrototypeOf(subClass, superClass); }
  45237. function Line_setPrototypeOf(o, p) { Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Line_setPrototypeOf(o, p); }
  45238. 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); }; }
  45239. function Line_possibleConstructorReturn(self, call) { if (call && (Line_typeof(call) === "object" || typeof call === "function")) { return call; } return Line_assertThisInitialized(self); }
  45240. function Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45241. function Line_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45242. function Line_getPrototypeOf(o) { Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Line_getPrototypeOf(o); }
  45243. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45244. * This program are made available under the terms of the Apache License, Version 2.0
  45245. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45246. /**
  45247. * @class SuperMap.Feature.ShapeParameters.Line
  45248. * @category Visualization Theme
  45249. * @classdesc 线参数对象。
  45250. * @extends {SuperMap.Feature.ShapeParameters}
  45251. */
  45252. var Line_Line = /*#__PURE__*/function (_ShapeParameters) {
  45253. Line_inherits(Line, _ShapeParameters);
  45254. var _super = Line_createSuper(Line);
  45255. /**
  45256. * @function SuperMap.Feature.ShapeParameters.Line.prototype.constructor
  45257. * @description 创建一个图形线参数对象。
  45258. * @param {Array} pointList - 线要素节点数组,二维数组,必设参数。
  45259. * @returns {SuperMap.Feature.ShapeParameters.Line} 圆形参数对象。
  45260. */
  45261. function Line(pointList) {
  45262. var _this;
  45263. Line_classCallCheck(this, Line);
  45264. _this = _super.call(this, pointList);
  45265. /**
  45266. * @member {Array} SuperMap.Feature.ShapeParameters.Line.prototype.pointList
  45267. * @description 线要素节点数组,二维数组。
  45268. * 数组形如:
  45269. * (start code)
  45270. * [
  45271. * [10, 20], //节点
  45272. * [30, 40],
  45273. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  45274. * ]
  45275. * (end)
  45276. */
  45277. _this.pointList = pointList;
  45278. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Line";
  45279. return _this;
  45280. }
  45281. /**
  45282. * @function SuperMap.Feature.ShapeParameters.Line.prototype.destroy
  45283. * @description 销毁对象。
  45284. */
  45285. Line_createClass(Line, [{
  45286. key: "destroy",
  45287. value: function destroy() {
  45288. this.pointList = null;
  45289. Line_get(Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  45290. }
  45291. }]);
  45292. return Line;
  45293. }(ShapeParameters);
  45294. /**
  45295. * @typedef {Object} SuperMap.Feature.ShapeParameters.Line.style
  45296. * @property {string} strokeColor - 十六进制线颜色。
  45297. * @property {number} strokeWidth - 线宽度,默认值 1。
  45298. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  45299. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  45300. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  45301. * @property {number} strokeOpacity - 线的不透明度。取值范围[0, 1],默认值 1。
  45302. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45303. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45304. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45305. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45306. */
  45307. SuperMap.Feature = SuperMap.Feature || {};
  45308. SuperMap.Feature.ShapeParameters.Line = Line_Line;
  45309. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Polygon.js
  45310. function feature_Polygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Polygon_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Polygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Polygon_typeof(obj); }
  45311. function feature_Polygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45312. 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); } }
  45313. function feature_Polygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Polygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Polygon_defineProperties(Constructor, staticProps); return Constructor; }
  45314. function Polygon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Polygon_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Polygon_get(target, property, receiver || target); }
  45315. function Polygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Polygon_getPrototypeOf(object); if (object === null) break; } return object; }
  45316. 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 } }); if (superClass) feature_Polygon_setPrototypeOf(subClass, superClass); }
  45317. function feature_Polygon_setPrototypeOf(o, p) { feature_Polygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Polygon_setPrototypeOf(o, p); }
  45318. 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); }; }
  45319. function feature_Polygon_possibleConstructorReturn(self, call) { if (call && (feature_Polygon_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Polygon_assertThisInitialized(self); }
  45320. function feature_Polygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45321. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45322. function feature_Polygon_getPrototypeOf(o) { feature_Polygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Polygon_getPrototypeOf(o); }
  45323. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45324. * This program are made available under the terms of the Apache License, Version 2.0
  45325. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45326. /**
  45327. * @class SuperMap.Feature.ShapeParameters.Polygon
  45328. * @category Visualization Theme
  45329. * @classdesc 面参数对象。
  45330. * @extends {SuperMap.Feature.ShapeParameters}
  45331. */
  45332. var Polygon_Polygon = /*#__PURE__*/function (_ShapeParameters) {
  45333. feature_Polygon_inherits(Polygon, _ShapeParameters);
  45334. var _super = feature_Polygon_createSuper(Polygon);
  45335. /**
  45336. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.constructor
  45337. * @description 创建一个图形面参数对象。
  45338. * @param {Array} pointList - 横坐标,必设参数。
  45339. * @returns {SuperMap.Feature.ShapeParameters.Polygon} 标签参数对象。
  45340. */
  45341. function Polygon(pointList) {
  45342. var _this;
  45343. feature_Polygon_classCallCheck(this, Polygon);
  45344. _this = _super.call(this, pointList);
  45345. /**
  45346. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.pointList
  45347. * @description 面要素节点数组,二维数组。
  45348. * 数组形如:
  45349. * (start code)
  45350. * [
  45351. * [10, 20], //节点
  45352. * [30, 40],
  45353. * [25, 30] //最后一个节点和第一个节点不必相同,绘制时自动封闭
  45354. * ]
  45355. * (end)
  45356. */
  45357. _this.pointList = pointList;
  45358. /**
  45359. * @member {Array} SuperMap.Feature.ShapeParameters.Polygon.prototype.holePolygonPointLists
  45360. * @description 岛洞面多边形顶点数组(三维数组)
  45361. */
  45362. _this.holePolygonPointLists = null;
  45363. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Polygon";
  45364. return _this;
  45365. }
  45366. /**
  45367. * @function SuperMap.Feature.ShapeParameters.Polygon.prototype.destroy
  45368. * @description 销毁对象。
  45369. */
  45370. feature_Polygon_createClass(Polygon, [{
  45371. key: "destroy",
  45372. value: function destroy() {
  45373. this.pointList = null;
  45374. this.holePolygonPointLists = null;
  45375. Polygon_get(feature_Polygon_getPrototypeOf(Polygon.prototype), "destroy", this).call(this);
  45376. }
  45377. }]);
  45378. return Polygon;
  45379. }(ShapeParameters);
  45380. /**
  45381. * @typedef {Object} SuperMap.Feature.ShapeParameters.Polygon.style
  45382. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45383. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45384. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45385. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45386. * @property {string} strokeColor - 十六进制描边颜色。
  45387. * @property {number} strokeWidth - 描边宽度,默认值 1。
  45388. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45389. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  45390. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  45391. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  45392. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45393. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45394. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45395. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45396. */
  45397. SuperMap.Feature = SuperMap.Feature || {};
  45398. SuperMap.Feature.ShapeParameters.Polygon = Polygon_Polygon;
  45399. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Rectangle.js
  45400. function feature_Rectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Rectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Rectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Rectangle_typeof(obj); }
  45401. function feature_Rectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45402. 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); } }
  45403. function feature_Rectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Rectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Rectangle_defineProperties(Constructor, staticProps); return Constructor; }
  45404. function Rectangle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Rectangle_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Rectangle_get(target, property, receiver || target); }
  45405. function Rectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Rectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  45406. 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 } }); if (superClass) feature_Rectangle_setPrototypeOf(subClass, superClass); }
  45407. function feature_Rectangle_setPrototypeOf(o, p) { feature_Rectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Rectangle_setPrototypeOf(o, p); }
  45408. 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); }; }
  45409. function feature_Rectangle_possibleConstructorReturn(self, call) { if (call && (feature_Rectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Rectangle_assertThisInitialized(self); }
  45410. function feature_Rectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45411. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45412. function feature_Rectangle_getPrototypeOf(o) { feature_Rectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Rectangle_getPrototypeOf(o); }
  45413. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45414. * This program are made available under the terms of the Apache License, Version 2.0
  45415. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45416. /**
  45417. * @class SuperMap.Feature.ShapeParameters.Rectangle
  45418. * @category Visualization Theme
  45419. * @classdesc 矩形参数对象。
  45420. * @extends {SuperMap.Feature.ShapeParameters}
  45421. */
  45422. var Rectangle_Rectangle = /*#__PURE__*/function (_ShapeParameters) {
  45423. feature_Rectangle_inherits(Rectangle, _ShapeParameters);
  45424. var _super = feature_Rectangle_createSuper(Rectangle);
  45425. /**
  45426. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.constructor
  45427. * @description 创建一个图形矩形参数对象。
  45428. * @param {number} x - 矩形 x 坐标,必设参数。
  45429. * @param {number} y - 矩形 y 坐标,必设参数。
  45430. * @param {number} width - 矩形 width 坐标,必设参数。
  45431. * @param {number} height - 矩形 height 坐标,必设参数。
  45432. * @returns {SuperMap.Feature.ShapeParameters.Rectangle} 图形矩形参数对象。
  45433. */
  45434. function Rectangle(x, y, width, height) {
  45435. var _this;
  45436. feature_Rectangle_classCallCheck(this, Rectangle);
  45437. _this = _super.call(this, x, y, width, height);
  45438. /**
  45439. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.x
  45440. * @description 左上角 x 坐标。
  45441. */
  45442. _this.x = !isNaN(x) ? x : 0;
  45443. /**
  45444. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.y
  45445. * @description 左上角 y 坐标。
  45446. */
  45447. _this.y = !isNaN(x) ? y : 0;
  45448. /**
  45449. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.width
  45450. * @description 宽度。
  45451. */
  45452. _this.width = !isNaN(width) ? width : 0;
  45453. /**
  45454. * @member {number} SuperMap.Feature.ShapeParameters.Rectangle.prototype.height
  45455. * @description 高度。
  45456. */
  45457. _this.height = !isNaN(height) ? height : 0;
  45458. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Rectangle";
  45459. return _this;
  45460. }
  45461. /**
  45462. * @function SuperMap.Feature.ShapeParameters.Rectangle.prototype.destroy
  45463. * @description 销毁对象。
  45464. */
  45465. feature_Rectangle_createClass(Rectangle, [{
  45466. key: "destroy",
  45467. value: function destroy() {
  45468. this.x = null;
  45469. this.y = null;
  45470. this.width = null;
  45471. this.height = null;
  45472. Rectangle_get(feature_Rectangle_getPrototypeOf(Rectangle.prototype), "destroy", this).call(this);
  45473. }
  45474. }]);
  45475. return Rectangle;
  45476. }(ShapeParameters);
  45477. /**
  45478. * @typedef {Object} SuperMap.Feature.ShapeParameters.Rectangle.style
  45479. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45480. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45481. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45482. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45483. * @property {string} strokeColor - 十六进制描边颜色。
  45484. * @property {number} strokeWidth - 描边宽度,默认值 1。
  45485. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45486. * @property {string} strokeLinecap - 线帽样式;strokeLinecap 有三种类型 :“butt", "round", "square"; 默认为"butt"。
  45487. * @property {string} strokeLineJoin - 线段连接样式;strokeLineJoin 有三种类型: “miter", "round", "bevel"; 默认为"miter"。
  45488. * @property {string} strokeDashstyle - 虚线类型; strokeDashstyle 有八种类型 :“dot",“dash",“dashdot",“longdash",“longdashdot",“solid", "dashed", "dotted"; 默认值 "solid"。solid 表示实线。
  45489. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45490. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45491. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45492. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45493. */
  45494. SuperMap.Feature = SuperMap.Feature || {};
  45495. SuperMap.Feature.ShapeParameters.Rectangle = Rectangle_Rectangle;
  45496. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Sector.js
  45497. function Sector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Sector_typeof = function _typeof(obj) { return typeof obj; }; } else { Sector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Sector_typeof(obj); }
  45498. function Sector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45499. 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); } }
  45500. function Sector_createClass(Constructor, protoProps, staticProps) { if (protoProps) Sector_defineProperties(Constructor.prototype, protoProps); if (staticProps) Sector_defineProperties(Constructor, staticProps); return Constructor; }
  45501. function Sector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Sector_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Sector_get(target, property, receiver || target); }
  45502. function Sector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Sector_getPrototypeOf(object); if (object === null) break; } return object; }
  45503. 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 } }); if (superClass) Sector_setPrototypeOf(subClass, superClass); }
  45504. function Sector_setPrototypeOf(o, p) { Sector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Sector_setPrototypeOf(o, p); }
  45505. 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); }; }
  45506. function Sector_possibleConstructorReturn(self, call) { if (call && (Sector_typeof(call) === "object" || typeof call === "function")) { return call; } return Sector_assertThisInitialized(self); }
  45507. function Sector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45508. function Sector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45509. function Sector_getPrototypeOf(o) { Sector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Sector_getPrototypeOf(o); }
  45510. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45511. * This program are made available under the terms of the Apache License, Version 2.0
  45512. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45513. /**
  45514. * @class SuperMap.Feature.ShapeParameters.Sector
  45515. * @category Visualization Theme
  45516. * @classdesc 扇形参数对象。
  45517. * @extends {SuperMap.Feature.ShapeParameters}
  45518. */
  45519. var Sector = /*#__PURE__*/function (_ShapeParameters) {
  45520. Sector_inherits(Sector, _ShapeParameters);
  45521. var _super = Sector_createSuper(Sector);
  45522. /**
  45523. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.constructor
  45524. * @description 创建一个扇形参数对象。
  45525. * @param {number} x - 圆心 x 坐标,必设参数。
  45526. * @param {number} y - 圆心 y 坐标,必设参数。
  45527. * @param {number} r - 外圆半径,必设参数。
  45528. * @param {number} startAngle - 起始角度,必设参数。取值范围[0, 360)。
  45529. * @param {number} endAngle - 结束角度,必设参数。取值范围(0, 360]。
  45530. * @param {number} [r0=0] - 内圆半径,指定后将出现内弧,同时扇边长度为'r - r0'。取值范围[0, r)。
  45531. * @returns {SuperMap.Feature.ShapeParameters.Sector} 扇形参数对象。
  45532. */
  45533. function Sector(x, y, r, startAngle, endAngle, r0, clockWise) {
  45534. var _this;
  45535. Sector_classCallCheck(this, Sector);
  45536. _this = _super.call(this, x, y, r, startAngle, endAngle, r0, clockWise);
  45537. /**
  45538. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.x
  45539. * @description 圆心 x 坐标。
  45540. */
  45541. _this.x = !isNaN(x) ? x : 0;
  45542. /**
  45543. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.Y
  45544. * @description 圆心 Y 坐标。
  45545. */
  45546. _this.y = !isNaN(y) ? y : 0;
  45547. /**
  45548. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.r
  45549. * @description 外圆半径。
  45550. */
  45551. _this.r = !isNaN(r) ? r : 0;
  45552. /**
  45553. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.startAngle
  45554. * @description 起始角度。取值范围[0, 360),默认值:null。
  45555. */
  45556. _this.startAngle = !isNaN(startAngle) ? startAngle : 0;
  45557. /**
  45558. * @member {number} SuperMap.Feature.ShapeParameters.Sector.prototype.endAngle
  45559. * @description 结束角度。取值范围(0, 360],默认值:null。
  45560. */
  45561. _this.endAngle = !isNaN(endAngle) ? endAngle : 0;
  45562. /**
  45563. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.r0=0]
  45564. * @description 内圆半径,指定后将出现内弧,同时扇边长度为 r 减 r0。取值范围[0, r)。
  45565. */
  45566. _this.r0 = !isNaN(r0) ? r0 : 0;
  45567. /**
  45568. * @member {number} [SuperMap.Feature.ShapeParameters.Sector.prototype.clockWise=false]
  45569. * @description 是否是顺时针。默认值:false。
  45570. */
  45571. _this.clockWise = clockWise;
  45572. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Sector";
  45573. return _this;
  45574. }
  45575. /**
  45576. * @function SuperMap.Feature.ShapeParameters.Sector.prototype.destroy
  45577. * @description 销毁对象。
  45578. */
  45579. Sector_createClass(Sector, [{
  45580. key: "destroy",
  45581. value: function destroy() {
  45582. this.x = null;
  45583. this.y = null;
  45584. this.r = null;
  45585. this.startAngle = null;
  45586. this.endAngle = null;
  45587. this.r0 = null;
  45588. this.clockWise = null;
  45589. Sector_get(Sector_getPrototypeOf(Sector.prototype), "destroy", this).call(this);
  45590. }
  45591. }]);
  45592. return Sector;
  45593. }(ShapeParameters);
  45594. /**
  45595. * @typedef {Object} SuperMap.Feature.ShapeParameters.Sector.style
  45596. * @property {boolean} fill - 是否填充,不需要填充则设置为false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45597. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45598. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45599. * @property {boolean} stroke - 是否描边,不需要描边则设置为 false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45600. * @property {string} strokeColor - 十六进制描边颜色。
  45601. * @property {number} strokeWidth - 描边宽度,默认值 1。
  45602. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45603. * @property {number} shadowBlur - 阴影模糊度,(大于 0 有效; 默认值 0)。
  45604. * @property {string} shadowColor - 阴影颜色; 默认值 '#000000'。
  45605. * @property {number} shadowOffsetX - 阴影 X 方向偏移值; 默认值 0。
  45606. * @property {number} shadowOffsetY - 阴影 Y 方向偏移值; 默认值 0。
  45607. */
  45608. SuperMap.Feature = SuperMap.Feature || {};
  45609. SuperMap.Feature.ShapeParameters.Sector = Sector;
  45610. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Label.js
  45611. function Label_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Label_typeof = function _typeof(obj) { return typeof obj; }; } else { Label_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Label_typeof(obj); }
  45612. function Label_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45613. 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); } }
  45614. function Label_createClass(Constructor, protoProps, staticProps) { if (protoProps) Label_defineProperties(Constructor.prototype, protoProps); if (staticProps) Label_defineProperties(Constructor, staticProps); return Constructor; }
  45615. function Label_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Label_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Label_get(target, property, receiver || target); }
  45616. function Label_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Label_getPrototypeOf(object); if (object === null) break; } return object; }
  45617. 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 } }); if (superClass) Label_setPrototypeOf(subClass, superClass); }
  45618. function Label_setPrototypeOf(o, p) { Label_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Label_setPrototypeOf(o, p); }
  45619. 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); }; }
  45620. function Label_possibleConstructorReturn(self, call) { if (call && (Label_typeof(call) === "object" || typeof call === "function")) { return call; } return Label_assertThisInitialized(self); }
  45621. function Label_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45622. function Label_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45623. function Label_getPrototypeOf(o) { Label_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Label_getPrototypeOf(o); }
  45624. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45625. * This program are made available under the terms of the Apache License, Version 2.0
  45626. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45627. /**
  45628. * @class SuperMap.Feature.ShapeParameters.Label
  45629. * @category Visualization Theme
  45630. * @classdesc 标签参数对象。
  45631. * @extent {SuperMap.Feature.ShapeParameters}
  45632. */
  45633. var Label = /*#__PURE__*/function (_ShapeParameters) {
  45634. Label_inherits(Label, _ShapeParameters);
  45635. var _super = Label_createSuper(Label);
  45636. /**
  45637. * @function SuperMap.Feature.ShapeParameters.Label.prototype.constructor
  45638. * @description 创建一个标签参数对象。
  45639. * @param {number} x - 横坐标,必设参数。
  45640. * @param {number} y - 纵坐标,必设参数。
  45641. * @param {string} text - 图形中的附加文本,必设参数。
  45642. * @returns {SuperMap.Feature.ShapeParameters.Label} 标签参数对象。
  45643. */
  45644. function Label(x, y, text) {
  45645. var _this;
  45646. Label_classCallCheck(this, Label);
  45647. _this = _super.call(this, x, y, text);
  45648. /**
  45649. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.x
  45650. * @description 标签 x 坐标。
  45651. */
  45652. _this.x = x;
  45653. /**
  45654. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.y
  45655. * @description 标签 y 坐标。
  45656. */
  45657. _this.y = y;
  45658. /**
  45659. * @member {number} SuperMap.Feature.ShapeParameters.Label.prototype.text
  45660. * @description 标签的文本内容。
  45661. */
  45662. _this.text = text;
  45663. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Label";
  45664. return _this;
  45665. }
  45666. /**
  45667. * @function SuperMap.Feature.ShapeParameters.Label.prototype.destroy
  45668. * @description 销毁对象。
  45669. */
  45670. Label_createClass(Label, [{
  45671. key: "destroy",
  45672. value: function destroy() {
  45673. this.x = null;
  45674. this.y = null;
  45675. this.text = null;
  45676. Label_get(Label_getPrototypeOf(Label.prototype), "destroy", this).call(this);
  45677. }
  45678. }]);
  45679. return Label;
  45680. }(ShapeParameters);
  45681. /**
  45682. * @typedef {Object} SuperMap.Feature.ShapeParameters.Label.style
  45683. * @property {boolean} fill - 是否填充,不需要填充则设置为 false,默认值为 true。此属性与 stroke 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45684. * @property {string} fillColor - 十六进制填充颜色。默认值为 "#000000"。
  45685. * @property {number} fillOpacity - 填充不透明度。取值范围[0, 1],默认值 1。
  45686. * @property {boolean} stroke - 是否描边,不需要描边则设置为false,默认值为 false。此属性与 fill 不能同时为 false,如果 fill 与 stroke 同时为 false,将按 fill 与 stroke 的默认值渲染。
  45687. * @property {string} strokeColor - 十六进制描边颜色。
  45688. * @property {number} strokeOpacity - 描边的不透明度。取值范围[0, 1],默认值 1。
  45689. * @property {number} strokeWidth -描边宽度,默认值 1。
  45690. * @property {number} maxWidth - 最大宽度限制。默认值:null。
  45691. * @property {number} fontSize - 标签文本字体大小。默认值 12,单位是像素。
  45692. * @property {string} fontStyle - 标签文本字体样式。可设值:"normal", "italic", "oblique"; 默认值:"normal" 。
  45693. * @property {string} fontVariant - 标签文本字体变体。可设值:"normal", "small-caps"; 默认值:"normal" 。
  45694. * @property {string} fontWeight - 标签文本字体粗细。可设值:"normal", "bold", "bolder", "lighter"; 默认值:"normal" 。
  45695. * @property {string} fontFamily - 标签文本字体系列。fontFamily 值是字体族名称或/及类族名称的一个优先表,每个值逗号分割,浏览器会使用它可识别的第一个值。
  45696. * 可以使用具体的字体名称("times"、"courier"、"arial")或字体系列名称("serif"、"sans-serif"、"cursive"、"fantasy"、"monospace")。默认值:"arial,sans-serif".
  45697. * @property {string} labelBaseline - 标签文本垂直对齐, 可以是 'top', 'bottom', 'middle',默认值 'middle'。
  45698. * @property {string} labelAlign - 标签文本水平对齐。可以是 'left', 'right', 'center'; 默认值 'center'。
  45699. * @property {number} shadowBlur - 阴影模糊度,大于 0 有效。默认值:0。
  45700. * @property {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  45701. * @property {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  45702. * @property {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  45703. */
  45704. SuperMap.Feature = SuperMap.Feature || {};
  45705. SuperMap.Feature.ShapeParameters.Label = Label;
  45706. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Image.js
  45707. function feature_Image_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { feature_Image_typeof = function _typeof(obj) { return typeof obj; }; } else { feature_Image_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return feature_Image_typeof(obj); }
  45708. function feature_Image_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45709. 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); } }
  45710. function feature_Image_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Image_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Image_defineProperties(Constructor, staticProps); return Constructor; }
  45711. function feature_Image_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { feature_Image_get = Reflect.get; } 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(receiver); } return desc.value; }; } return feature_Image_get(target, property, receiver || target); }
  45712. function feature_Image_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = feature_Image_getPrototypeOf(object); if (object === null) break; } return object; }
  45713. 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 } }); if (superClass) feature_Image_setPrototypeOf(subClass, superClass); }
  45714. function feature_Image_setPrototypeOf(o, p) { feature_Image_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return feature_Image_setPrototypeOf(o, p); }
  45715. 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); }; }
  45716. function feature_Image_possibleConstructorReturn(self, call) { if (call && (feature_Image_typeof(call) === "object" || typeof call === "function")) { return call; } return feature_Image_assertThisInitialized(self); }
  45717. function feature_Image_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45718. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45719. function feature_Image_getPrototypeOf(o) { feature_Image_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return feature_Image_getPrototypeOf(o); }
  45720. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45721. * This program are made available under the terms of the Apache License, Version 2.0
  45722. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45723. /**
  45724. * @class SuperMap.Feature.ShapeParameters.Image
  45725. * @category Visualization Theme
  45726. * @classdesc 图片参数对象。
  45727. * @extends {SuperMap.Feature.ShapeParameters}
  45728. */
  45729. var Image_Image = /*#__PURE__*/function (_ShapeParameters) {
  45730. feature_Image_inherits(Image, _ShapeParameters);
  45731. var _super = feature_Image_createSuper(Image);
  45732. /**
  45733. * @function SuperMap.Feature.ShapeParameters.Image.prototype.constructor
  45734. * @description 创建一个图片参数对象。
  45735. * @param {number} x - 左上角横坐标,必设参数。
  45736. * @param {number} y - 左上角纵坐标,必设参数。
  45737. * @param {(string|Object)} image - 图片地址或Cavans对象,必设参数。
  45738. * @param {number} width - 绘制到画布上的宽度,默认为图片高度。
  45739. * @param {number} height - 绘制到画布上的高度,默认为图片高度。
  45740. * @param {number} sx - 从图片中裁剪的左上角横坐标。
  45741. * @param {number} sy - 从图片中裁剪的左上角纵坐标。
  45742. * @param {number} sWidth - 从图片中裁剪的宽度,默认为图片高度。
  45743. * @param {number} sHeight - 绘制到画布上的高度,默认为图片高度。
  45744. * @returns {SuperMap.Feature.ShapeParameters.Image} 圆形参数对象。
  45745. */
  45746. function Image(x, y, image, width, height, sx, sy, sWidth, sHeight) {
  45747. var _this;
  45748. feature_Image_classCallCheck(this, Image);
  45749. _this = _super.call(this, x, y, image, width, height, sx, sy, sWidth, sHeight);
  45750. /**
  45751. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.x
  45752. * @description 左上角横坐标,必设参数。
  45753. */
  45754. _this.x = x;
  45755. /**
  45756. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.y
  45757. * @description 左上角纵坐标,必设参数。
  45758. */
  45759. _this.y = y;
  45760. /**
  45761. * @member {(string|Object)} SuperMap.Feature.ShapeParameters.Image.prototype.image
  45762. * @description 图片地址。
  45763. */
  45764. _this.image = image;
  45765. /**
  45766. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.width
  45767. * @description 绘制到画布上的宽度,默认为图片高度。
  45768. */
  45769. _this.width = width;
  45770. /**
  45771. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.height
  45772. * @description 绘制到画布上的高度,默认为图片高度。
  45773. */
  45774. _this.height = height;
  45775. /**
  45776. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sx
  45777. * @description 从图片中裁剪的左上角横坐标。
  45778. */
  45779. _this.sx = sx;
  45780. /**
  45781. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sy
  45782. * @description 从图片中裁剪的左上角纵坐标。
  45783. */
  45784. _this.sy = sy;
  45785. /**
  45786. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sWidth
  45787. * @description 从图片中裁剪的宽度,默认为图片高度。
  45788. */
  45789. _this.sWidth = sWidth;
  45790. /**
  45791. * @member {number} SuperMap.Feature.ShapeParameters.Image.prototype.sHeight
  45792. * @description 绘制到画布上的高度,默认为图片高度。
  45793. */
  45794. _this.sHeight = sHeight;
  45795. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Image";
  45796. return _this;
  45797. }
  45798. /**
  45799. * @function SuperMap.Feature.ShapeParameters.Image.prototype.destroy
  45800. * @description 销毁对象。
  45801. */
  45802. feature_Image_createClass(Image, [{
  45803. key: "destroy",
  45804. value: function destroy() {
  45805. this.x = null;
  45806. this.y = null;
  45807. this.image = null;
  45808. this.width = null;
  45809. this.height = null;
  45810. this.sx = null;
  45811. this.sy = null;
  45812. this.sWidth = null;
  45813. this.sHeight = null;
  45814. feature_Image_get(feature_Image_getPrototypeOf(Image.prototype), "destroy", this).call(this);
  45815. }
  45816. }]);
  45817. return Image;
  45818. }(ShapeParameters);
  45819. SuperMap.Feature = SuperMap.Feature || {};
  45820. SuperMap.Feature.ShapeParameters.Image = Image_Image;
  45821. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Circle.js
  45822. function Circle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Circle_typeof = function _typeof(obj) { return typeof obj; }; } else { Circle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Circle_typeof(obj); }
  45823. function Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45824. 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); } }
  45825. function Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) Circle_defineProperties(Constructor, staticProps); return Constructor; }
  45826. function Circle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Circle_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Circle_get(target, property, receiver || target); }
  45827. function Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  45828. 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 } }); if (superClass) Circle_setPrototypeOf(subClass, superClass); }
  45829. function Circle_setPrototypeOf(o, p) { Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Circle_setPrototypeOf(o, p); }
  45830. 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); }; }
  45831. function Circle_possibleConstructorReturn(self, call) { if (call && (Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return Circle_assertThisInitialized(self); }
  45832. function Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  45833. function Circle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  45834. function Circle_getPrototypeOf(o) { Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Circle_getPrototypeOf(o); }
  45835. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45836. * This program are made available under the terms of the Apache License, Version 2.0
  45837. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45838. /**
  45839. * @class SuperMap.Feature.ShapeParameters.Circle
  45840. * @classdesc 圆形参数对象。
  45841. * @category Visualization Theme
  45842. * @extends {SuperMap.Feature.ShapeParameters}
  45843. */
  45844. var Circle_Circle = /*#__PURE__*/function (_ShapeParameters) {
  45845. Circle_inherits(Circle, _ShapeParameters);
  45846. var _super = Circle_createSuper(Circle);
  45847. /**
  45848. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.constructor
  45849. * @description 创建一个圆形参数对象。
  45850. * @param {number} x - 圆心 x 坐标,必设参数。
  45851. * @param {number} y - 圆心 y 坐标,必设参数。
  45852. * @param {number} r - 圆半径,必设参数。
  45853. * @returns {SuperMap.Feature.ShapeParameters.Circle} 圆形参数对象。
  45854. */
  45855. function Circle(x, y, r) {
  45856. var _this;
  45857. Circle_classCallCheck(this, Circle);
  45858. _this = _super.call(this, x, y, r);
  45859. /**
  45860. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.x
  45861. * @description 圆心 x 坐标。
  45862. */
  45863. _this.x = !isNaN(x) ? x : 0;
  45864. /**
  45865. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.y
  45866. * @description 圆心 y 坐标。
  45867. */
  45868. _this.y = !isNaN(y) ? y : 0;
  45869. /**
  45870. * @member {number} SuperMap.Feature.ShapeParameters.Circle.prototype.r
  45871. * @description 圆半径。
  45872. */
  45873. _this.r = !isNaN(r) ? r : 0;
  45874. _this.CLASS_NAME = "SuperMap.Feature.ShapeParameters.Circle";
  45875. return _this;
  45876. }
  45877. /**
  45878. * @function SuperMap.Feature.ShapeParameters.Circle.prototype.destroy
  45879. * @description 销毁对象。
  45880. */
  45881. Circle_createClass(Circle, [{
  45882. key: "destroy",
  45883. value: function destroy() {
  45884. this.x = null;
  45885. this.y = null;
  45886. this.r = null;
  45887. Circle_get(Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  45888. }
  45889. }]);
  45890. return Circle;
  45891. }(ShapeParameters);
  45892. SuperMap.Feature = SuperMap.Feature || {};
  45893. SuperMap.Feature.ShapeParameters.Circle = Circle_Circle;
  45894. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Eventful.js
  45895. function Eventful_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  45896. 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); } }
  45897. function Eventful_createClass(Constructor, protoProps, staticProps) { if (protoProps) Eventful_defineProperties(Constructor.prototype, protoProps); if (staticProps) Eventful_defineProperties(Constructor, staticProps); return Constructor; }
  45898. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  45899. * This program are made available under the terms of the Apache License, Version 2.0
  45900. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  45901. /**
  45902. * @class SuperMap.LevelRenderer.Eventful
  45903. * @category Visualization Theme
  45904. * @classdesc 事件分发器超类,所有支持事件处理的类均是此类的子类。
  45905. * 此类不可实例化。
  45906. * @private
  45907. */
  45908. var Eventful = /*#__PURE__*/function () {
  45909. /**
  45910. * @function SuperMap.LevelRenderer.Eventful.prototype.constructor
  45911. * @description 构造函数。对象可以通过 onxxxx 绑定事件。
  45912. * 支持的事件:
  45913. * Symbolizer properties:
  45914. * onclick - {function} 默认值:null。
  45915. * onmouseover - {function} 默认值:null。
  45916. * onmouseout - {function} 默认值:null。
  45917. * onmousemove - {function} 默认值:null。
  45918. * onmousewheel - {function} 默认值:null。
  45919. * onmousedown - {function} 默认值:null。
  45920. * onmouseup - {function} 默认值:null。
  45921. * ondragstart - {function} 默认值:null。
  45922. * ondragend - {function} 默认值:null。
  45923. * ondragenter - {function} 默认值:null。
  45924. * ondragleave - {function} 默认值:null。
  45925. * ondragover - {function} 默认值:null。
  45926. * ondrop - {function} 默认值:null。
  45927. */
  45928. function Eventful() {
  45929. Eventful_classCallCheck(this, Eventful);
  45930. /**
  45931. * @member {Object} SuperMap.LevelRenderer.Eventful.prototype._handlers
  45932. * @description 事件处理对象(事件分发器)。
  45933. */
  45934. this._handlers = {};
  45935. this.CLASS_NAME = "SuperMap.LevelRenderer.Eventful";
  45936. }
  45937. /**
  45938. * @function {Object} SuperMap.LevelRenderer.Eventful.prototype.destroy
  45939. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  45940. */
  45941. Eventful_createClass(Eventful, [{
  45942. key: "destroy",
  45943. value: function destroy() {
  45944. this._handlers = null;
  45945. }
  45946. /**
  45947. * @function SuperMap.LevelRenderer.Eventful.prototype.one
  45948. * @description 单次触发绑定,dispatch后销毁。
  45949. * @param {string} event - 事件名。
  45950. * @param {boolean} handler - 响应函数。
  45951. * @param {Object} context - context。
  45952. * @returns {SuperMap.LevelRenderer.Eventful} this
  45953. */
  45954. }, {
  45955. key: "one",
  45956. value: function one(event, handler, context) {
  45957. var _h = this._handlers;
  45958. if (!handler || !event) {
  45959. return this;
  45960. }
  45961. if (!_h[event]) {
  45962. _h[event] = [];
  45963. }
  45964. _h[event].push({
  45965. h: handler,
  45966. one: true,
  45967. ctx: context || this
  45968. });
  45969. return this;
  45970. }
  45971. /**
  45972. * @function SuperMap.LevelRenderer.Eventful.prototype.bind
  45973. * @description 绑定事件。
  45974. * @param {string} event - 事件名。
  45975. * @param {boolean} handler - 响应函数。
  45976. * @param {Object} context - context。
  45977. * @returns {SuperMap.LevelRenderer.Eventful} this
  45978. */
  45979. }, {
  45980. key: "bind",
  45981. value: function bind(event, handler, context) {
  45982. var _h = this._handlers;
  45983. if (!handler || !event) {
  45984. return this;
  45985. }
  45986. if (!_h[event]) {
  45987. _h[event] = [];
  45988. }
  45989. _h[event].push({
  45990. h: handler,
  45991. one: false,
  45992. ctx: context || this
  45993. });
  45994. return this;
  45995. }
  45996. /**
  45997. * @function SuperMap.LevelRenderer.Eventful.prototype.unbind
  45998. * @description 解绑事件。
  45999. * @param {string} event - 事件名。
  46000. * @param {boolean} handler - 响应函数。
  46001. * @returns {SuperMap.LevelRenderer.Eventful} this
  46002. */
  46003. }, {
  46004. key: "unbind",
  46005. value: function unbind(event, handler) {
  46006. var _h = this._handlers;
  46007. if (!event) {
  46008. this._handlers = {};
  46009. return this;
  46010. }
  46011. if (handler) {
  46012. if (_h[event]) {
  46013. var newList = [];
  46014. for (var i = 0, l = _h[event].length; i < l; i++) {
  46015. if (_h[event][i]['h'] != handler) {
  46016. newList.push(_h[event][i]);
  46017. }
  46018. }
  46019. _h[event] = newList;
  46020. }
  46021. if (_h[event] && _h[event].length === 0) {
  46022. delete _h[event];
  46023. }
  46024. } else {
  46025. delete _h[event];
  46026. }
  46027. return this;
  46028. }
  46029. /**
  46030. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatch
  46031. * @description 事件分发。
  46032. * @param {string} type - 事件类型。
  46033. * @returns {SuperMap.LevelRenderer.Eventful} this
  46034. */
  46035. }, {
  46036. key: "dispatch",
  46037. value: function dispatch(type) {
  46038. if (this._handlers[type]) {
  46039. var args = arguments;
  46040. var argLen = args.length;
  46041. if (argLen > 3) {
  46042. args = Array.prototype.slice.call(args, 1);
  46043. }
  46044. var _h = this._handlers[type];
  46045. var len = _h.length;
  46046. for (var i = 0; i < len;) {
  46047. // Optimize advise from backbone
  46048. switch (argLen) {
  46049. case 1:
  46050. _h[i]['h'].call(_h[i]['ctx']);
  46051. break;
  46052. case 2:
  46053. _h[i]['h'].call(_h[i]['ctx'], args[1]);
  46054. break;
  46055. case 3:
  46056. _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
  46057. break;
  46058. default:
  46059. // have more than 2 given arguments
  46060. _h[i]['h'].apply(_h[i]['ctx'], args);
  46061. break;
  46062. }
  46063. if (_h[i]['one']) {
  46064. _h.splice(i, 1);
  46065. len--;
  46066. } else {
  46067. i++;
  46068. }
  46069. }
  46070. }
  46071. return this;
  46072. }
  46073. /**
  46074. * @function SuperMap.LevelRenderer.Eventful.prototype.dispatchWithContext
  46075. * @description 带有context的事件分发,最后一个参数是事件回调的 context。
  46076. * @param {string} type - 事件类型。
  46077. * @returns {SuperMap.LevelRenderer.Eventful} this
  46078. */
  46079. }, {
  46080. key: "dispatchWithContext",
  46081. value: function dispatchWithContext(type) {
  46082. if (this._handlers[type]) {
  46083. var args = arguments;
  46084. var argLen = args.length;
  46085. if (argLen > 4) {
  46086. args = Array.prototype.slice.call(args, 1, args.length - 1);
  46087. }
  46088. var ctx = args[args.length - 1];
  46089. var _h = this._handlers[type];
  46090. var len = _h.length;
  46091. for (var i = 0; i < len;) {
  46092. // Optimize advise from backbone
  46093. switch (argLen) {
  46094. case 1:
  46095. _h[i]['h'].call(ctx);
  46096. break;
  46097. case 2:
  46098. _h[i]['h'].call(ctx, args[1]);
  46099. break;
  46100. case 3:
  46101. _h[i]['h'].call(ctx, args[1], args[2]);
  46102. break;
  46103. default:
  46104. // have more than 2 given arguments
  46105. _h[i]['h'].apply(ctx, args);
  46106. break;
  46107. }
  46108. if (_h[i]['one']) {
  46109. _h.splice(i, 1);
  46110. len--;
  46111. } else {
  46112. i++;
  46113. }
  46114. }
  46115. }
  46116. return this;
  46117. }
  46118. }]);
  46119. return Eventful;
  46120. }();
  46121. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Vector.js
  46122. function levelRenderer_Vector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46123. 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); } }
  46124. function levelRenderer_Vector_createClass(Constructor, protoProps, staticProps) { if (protoProps) levelRenderer_Vector_defineProperties(Constructor.prototype, protoProps); if (staticProps) levelRenderer_Vector_defineProperties(Constructor, staticProps); return Constructor; }
  46125. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  46126. * This program are made available under the terms of the Apache License, Version 2.0
  46127. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46128. /**
  46129. * @private
  46130. * @class SuperMap.LevelRenderer.Tool.Vector
  46131. * @category Visualization Theme
  46132. * @classdesc LevelRenderer 二维向量类
  46133. *
  46134. */
  46135. var levelRenderer_Vector_Vector = /*#__PURE__*/function () {
  46136. /**
  46137. * @function SuperMap.LevelRenderer.Tool.Vector.constructor
  46138. * @description 构造函数
  46139. */
  46140. function Vector() {
  46141. levelRenderer_Vector_classCallCheck(this, Vector);
  46142. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  46143. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Vector";
  46144. }
  46145. /**
  46146. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.create
  46147. * @description 创建一个向量。
  46148. *
  46149. * @param {number} x - x坐标
  46150. * @param {number} y - Y坐标
  46151. * @return {Vector2} 向量。
  46152. */
  46153. levelRenderer_Vector_createClass(Vector, [{
  46154. key: "create",
  46155. value: function create(x, y) {
  46156. var ArrayCtor = this.ArrayCtor;
  46157. var out = new ArrayCtor(2);
  46158. out[0] = x || 0;
  46159. out[1] = y || 0;
  46160. return out;
  46161. }
  46162. /**
  46163. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.copy
  46164. * @description 复制一个向量。
  46165. *
  46166. * @param {Vector2} out - 基础向量。
  46167. * @param {Vector2} v - 向量。
  46168. * @return {Vector2} 克隆向量。
  46169. */
  46170. }, {
  46171. key: "copy",
  46172. value: function copy(out, v) {
  46173. out[0] = v[0];
  46174. out[1] = v[1];
  46175. return out;
  46176. }
  46177. /**
  46178. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.set
  46179. * @description 设置向量的两个项。
  46180. *
  46181. * @param {Vector2} out - 基础向量。
  46182. * @param {number} a - 项 a。
  46183. * @param {number} b - 项 b。
  46184. * @return {Vector2} 结果。
  46185. */
  46186. }, {
  46187. key: "set",
  46188. value: function set(out, a, b) {
  46189. out[0] = a;
  46190. out[1] = b;
  46191. return out;
  46192. }
  46193. /**
  46194. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.add
  46195. * @description 向量相加。
  46196. *
  46197. * @param {Vector2} out - 基础向量。
  46198. * @param {Vector2} v1 - 向量 v1。
  46199. * @param {Vector2} v2 - 向量 v2。
  46200. * @return {Vector2} 结果。
  46201. */
  46202. }, {
  46203. key: "add",
  46204. value: function add(out, v1, v2) {
  46205. out[0] = v1[0] + v2[0];
  46206. out[1] = v1[1] + v2[1];
  46207. return out;
  46208. }
  46209. /**
  46210. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scaleAndAdd
  46211. * @description 向量缩放后相加。
  46212. * @param {Vector2} out - 基础向量。
  46213. * @param {Vector2} v1 - 向量 v1。
  46214. * @param {Vector2} v2 - 向量 v2(缩放向量)。
  46215. * @param {number} a - 缩放参数。
  46216. * @return {Vector2} 结果。
  46217. */
  46218. }, {
  46219. key: "scaleAndAdd",
  46220. value: function scaleAndAdd(out, v1, v2, a) {
  46221. out[0] = v1[0] + v2[0] * a;
  46222. out[1] = v1[1] + v2[1] * a;
  46223. return out;
  46224. }
  46225. /**
  46226. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.sub
  46227. * @description 向量相减。
  46228. * @param {Vector2} out - 基础向量。
  46229. * @param {Vector2} v1 - 向量 v1。
  46230. * @param {Vector2} v2 - 向量 v2。
  46231. * @return {Vector2} 结果。
  46232. */
  46233. }, {
  46234. key: "sub",
  46235. value: function sub(out, v1, v2) {
  46236. out[0] = v1[0] - v2[0];
  46237. out[1] = v1[1] - v2[1];
  46238. return out;
  46239. }
  46240. /**
  46241. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.len
  46242. * @description 向量长度。
  46243. * @param {Vector2} v - 向量。
  46244. * @return {number} 向量长度。
  46245. */
  46246. }, {
  46247. key: "len",
  46248. value: function len(v) {
  46249. return Math.sqrt(this.lenSquare(v));
  46250. }
  46251. /**
  46252. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lenSquare
  46253. * @description 向量长度平方。
  46254. * @param {Vector2} v - 向量。
  46255. * @return {number} 向量长度平方。
  46256. */
  46257. }, {
  46258. key: "lenSquare",
  46259. value: function lenSquare(v) {
  46260. return v[0] * v[0] + v[1] * v[1];
  46261. }
  46262. /**
  46263. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.mul
  46264. * @description 向量乘法。
  46265. * @param {Vector2} out - 基础向量。
  46266. * @param {Vector2} v1 - 向量 v1。
  46267. * @param {Vector2} v2 - 向量 v2。
  46268. * @return {Vector2} 结果。
  46269. */
  46270. }, {
  46271. key: "mul",
  46272. value: function mul(out, v1, v2) {
  46273. out[0] = v1[0] * v2[0];
  46274. out[1] = v1[1] * v2[1];
  46275. return out;
  46276. }
  46277. /**
  46278. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.div
  46279. * @description 向量除法。
  46280. *
  46281. * @param {Vector2} out - 基础向量。
  46282. * @param {Vector2} v1 - 向量 v1。
  46283. * @param {Vector2} v2 - 向量 v2。
  46284. * @return {Vector2} 结果。
  46285. */
  46286. }, {
  46287. key: "div",
  46288. value: function div(out, v1, v2) {
  46289. out[0] = v1[0] / v2[0];
  46290. out[1] = v1[1] / v2[1];
  46291. return out;
  46292. }
  46293. /**
  46294. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dot
  46295. * @description 向量点乘。
  46296. *
  46297. * @param {Vector2} v1 - 向量 v1。
  46298. * @param {Vector2} v2 - 向量 v2。
  46299. * @return {number} 向量点乘。
  46300. */
  46301. }, {
  46302. key: "dot",
  46303. value: function dot(v1, v2) {
  46304. return v1[0] * v2[0] + v1[1] * v2[1];
  46305. }
  46306. /**
  46307. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.scale
  46308. * @description 向量缩放。
  46309. *
  46310. * @param {Vector2} out - 基础向量。
  46311. * @param {Vector2} v - 向量v。
  46312. * @param {number} s -缩放参数。
  46313. * @return {Vector2} 结果。
  46314. */
  46315. }, {
  46316. key: "scale",
  46317. value: function scale(out, v, s) {
  46318. out[0] = v[0] * s;
  46319. out[1] = v[1] * s;
  46320. return out;
  46321. }
  46322. /**
  46323. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.normalize
  46324. * @description 向量归一化。
  46325. *
  46326. * @param {Vector2} out - 基础向量。
  46327. * @param {Vector2} v - 向量 v。
  46328. * @return {Vector2} 结果。
  46329. */
  46330. }, {
  46331. key: "normalize",
  46332. value: function normalize(out, v) {
  46333. var d = this.len(v);
  46334. if (d === 0) {
  46335. out[0] = 0;
  46336. out[1] = 0;
  46337. } else {
  46338. out[0] = v[0] / d;
  46339. out[1] = v[1] / d;
  46340. }
  46341. return out;
  46342. }
  46343. /**
  46344. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distance
  46345. * @description 计算向量间距离。
  46346. *
  46347. * @param {Vector2} v1 - 向量 v1。
  46348. * @param {Vector2} v2 - 向量 v2。
  46349. * @return {number} 向量间距离。
  46350. */
  46351. }, {
  46352. key: "distance",
  46353. value: function distance(v1, v2) {
  46354. return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));
  46355. }
  46356. /**
  46357. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distanceSquare
  46358. * @description 向量距离平方。
  46359. *
  46360. * @param {Vector2} v1 - 向量 v1。
  46361. * @param {Vector2} v2 - 向量 v2。
  46362. * @return {number} 向量距离平方。
  46363. */
  46364. }, {
  46365. key: "distanceSquare",
  46366. value: function distanceSquare(v1, v2) {
  46367. return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
  46368. }
  46369. /**
  46370. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.negate
  46371. * @description 求负向量。
  46372. *
  46373. * @param {Vector2} out - 基础向量。
  46374. * @param {Vector2} v - 向量 v。
  46375. * @return {Vector2} 负向量。
  46376. */
  46377. }, {
  46378. key: "negate",
  46379. value: function negate(out, v) {
  46380. out[0] = -v[0];
  46381. out[1] = -v[1];
  46382. return out;
  46383. }
  46384. /**
  46385. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lerp
  46386. * @description 两点之间线性插值。
  46387. *
  46388. * @param {Vector2} out - 基础向量。
  46389. * @param {Vector2} v1 - 向量 v1。
  46390. * @param {Vector2} v2 - 向量 v2。
  46391. * @param {number} t
  46392. * @return {Vector2} 结果。
  46393. */
  46394. }, {
  46395. key: "lerp",
  46396. value: function lerp(out, v1, v2, t) {
  46397. out[0] = v1[0] + t * (v2[0] - v1[0]);
  46398. out[1] = v1[1] + t * (v2[1] - v1[1]);
  46399. return out;
  46400. }
  46401. /**
  46402. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.applyTransform
  46403. * @description 矩阵左乘向量。
  46404. *
  46405. * @param {Vector2} out - 基础向量。
  46406. * @param {Vector2} v1 - 向量 v1。
  46407. * @param {Vector2} v2 - 向量 v2。
  46408. * @return {Vector2} 结果。
  46409. */
  46410. }, {
  46411. key: "applyTransform",
  46412. value: function applyTransform(out, v, m) {
  46413. var x = v[0];
  46414. var y = v[1];
  46415. out[0] = m[0] * x + m[2] * y + m[4];
  46416. out[1] = m[1] * x + m[3] * y + m[5];
  46417. return out;
  46418. }
  46419. /**
  46420. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.min
  46421. * @description 求两个向量最小值。
  46422. * @param {Vector2} out - 基础向量。
  46423. * @param {Vector2} v1 - 向量 v1。
  46424. * @param {Vector2} v2 - 向量 v2。
  46425. * @return {Vector2} 结果。
  46426. */
  46427. }, {
  46428. key: "min",
  46429. value: function min(out, v1, v2) {
  46430. out[0] = Math.min(v1[0], v2[0]);
  46431. out[1] = Math.min(v1[1], v2[1]);
  46432. return out;
  46433. }
  46434. /**
  46435. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.max
  46436. * @description 求两个向量最大值。
  46437. *
  46438. * @param {Vector2} out - 基础向量。
  46439. * @param {Vector2} v1 - 向量 v1。
  46440. * @param {Vector2} v2 - 向量 v2。
  46441. * @return {Vector2} 结果。
  46442. */
  46443. }, {
  46444. key: "max",
  46445. value: function max(out, v1, v2) {
  46446. out[0] = Math.max(v1[0], v2[0]);
  46447. out[1] = Math.max(v1[1], v2[1]);
  46448. return out;
  46449. }
  46450. /**
  46451. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.length
  46452. * @description 向量长度。
  46453. *
  46454. * @param {Vector2} v - 向量。
  46455. * @return {number} 向量长度。
  46456. */
  46457. }, {
  46458. key: "length",
  46459. value: function length(v) {
  46460. return this.len(v);
  46461. }
  46462. /**
  46463. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.lengthSquare
  46464. * @description 向量长度平方。
  46465. *
  46466. * @param {Vector2} v - 向量。
  46467. * @return {number} 向量长度平方。
  46468. */
  46469. }, {
  46470. key: "lengthSquare",
  46471. value: function lengthSquare(v) {
  46472. return this.lenSquare(v);
  46473. }
  46474. /**
  46475. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.dist
  46476. * @description 计算向量间距离。
  46477. *
  46478. * @param {Vector2} v1 - 向量 v1。
  46479. * @param {Vector2} v2 - 向量 v2。
  46480. * @return {number} 向量间距离。
  46481. */
  46482. }, {
  46483. key: "dist",
  46484. value: function dist(v1, v2) {
  46485. return this.distance(v1, v2);
  46486. }
  46487. /**
  46488. * @function SuperMap.LevelRenderer.Tool.Vector.prototype.distSquare
  46489. * @description 向量距离平方。
  46490. *
  46491. * @param {Vector2} v1 - 向量 v1。
  46492. * @param {Vector2} v2 - 向量 v2。
  46493. * @return {number} 向量距离平方
  46494. */
  46495. }, {
  46496. key: "distSquare",
  46497. value: function distSquare(v1, v2) {
  46498. return this.distanceSquare(v1, v2);
  46499. }
  46500. }]);
  46501. return Vector;
  46502. }();
  46503. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Curve.js
  46504. function levelRenderer_Curve_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  46505. 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); } }
  46506. function Curve_createClass(Constructor, protoProps, staticProps) { if (protoProps) Curve_defineProperties(Constructor.prototype, protoProps); if (staticProps) Curve_defineProperties(Constructor, staticProps); return Constructor; }
  46507. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  46508. * This program are made available under the terms of the Apache License, Version 2.0
  46509. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  46510. /**
  46511. * @class SuperMap.LevelRenderer.Tool.Curve
  46512. * @category Visualization Theme
  46513. * @classdesc LevelRenderer 工具-曲线
  46514. * @private
  46515. */
  46516. var Curve_Curve = /*#__PURE__*/function () {
  46517. /**
  46518. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.constructor
  46519. * @description 构造函数。
  46520. */
  46521. function Curve() {
  46522. levelRenderer_Curve_classCallCheck(this, Curve);
  46523. /**
  46524. * @member {SuperMap.LevelRenderer.Tool.Vector} SuperMap.LevelRenderer.Tool.Curve.prototype.vector
  46525. * @description 矢量工具。
  46526. */
  46527. this.vector = new levelRenderer_Vector_Vector();
  46528. /**
  46529. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.EPSILON
  46530. * @description e。
  46531. */
  46532. this.EPSILON = 1e-4;
  46533. /**
  46534. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.THREE_SQRT
  46535. * @description 3 的平方根。
  46536. */
  46537. this.THREE_SQRT = Math.sqrt(3);
  46538. /**
  46539. * @member {number} SuperMap.LevelRenderer.Tool.Curve.prototype.ONE_THIRD
  46540. * @description 1/3。
  46541. */
  46542. this.ONE_THIRD = 1 / 3;
  46543. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Curve";
  46544. }
  46545. /*
  46546. * Method: evalCubicCoeff
  46547. *
  46548. * Parameters:
  46549. * a - {number} 值。
  46550. * b - {number} 值。
  46551. * c - {number} 值。
  46552. * d - {number} 值。
  46553. * t - {number} 值。
  46554. *
  46555. * Returns:
  46556. * {number}
  46557. */
  46558. /*
  46559. evalCubicCoeff: function(a, b, c, d, t){
  46560. return ((a * t + b) * t + c) * t + d;
  46561. },
  46562. */
  46563. /**
  46564. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isAroundZero
  46565. * @description 判断一个值是否趋于0,判断参考值:1e-4。
  46566. * @param {number} val - 值。
  46567. * @returns {boolean} 值是否趋于0。
  46568. */
  46569. Curve_createClass(Curve, [{
  46570. key: "isAroundZero",
  46571. value: function isAroundZero(val) {
  46572. return val > -this.EPSILON && val < this.EPSILON;
  46573. }
  46574. /**
  46575. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.isNotAroundZero
  46576. * @description 判断一个值是否不趋于0,判断参考值:1e-4。
  46577. * @param {number} val - 值。
  46578. * @returns {boolean} 值是否不趋于0。
  46579. */
  46580. }, {
  46581. key: "isNotAroundZero",
  46582. value: function isNotAroundZero(val) {
  46583. return val > this.EPSILON || val < -this.EPSILON;
  46584. }
  46585. /**
  46586. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicAt
  46587. * @description 计算三次贝塞尔值
  46588. * @param {number} p0 - 点p0。
  46589. * @param {number} p1 - 点p1。
  46590. * @param {number} p2 - 点p2。
  46591. * @param {number} p3 - 点p3。
  46592. * @param {number} t - t值。
  46593. * @returns {number} 三次贝塞尔值。
  46594. */
  46595. }, {
  46596. key: "cubicAt",
  46597. value: function cubicAt(p0, p1, p2, p3, t) {
  46598. var onet = 1 - t;
  46599. return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);
  46600. }
  46601. /**
  46602. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicDerivativeAt
  46603. * @description 计算三次贝塞尔导数值
  46604. * @param {number} p0 - 点p0。
  46605. * @param {number} p1 - 点p1。
  46606. * @param {number} p2 - 点p2。
  46607. * @param {number} p3 - 点p3。
  46608. * @param {number} t - t值。
  46609. * @returns {number} 三次贝塞尔导数值。
  46610. */
  46611. }, {
  46612. key: "cubicDerivativeAt",
  46613. value: function cubicDerivativeAt(p0, p1, p2, p3, t) {
  46614. var onet = 1 - t;
  46615. return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);
  46616. }
  46617. /**
  46618. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  46619. * @description 计算三次贝塞尔方程根,使用盛金公式
  46620. * @param {number} p0 - 点p0。
  46621. * @param {number} p1 - 点p1。
  46622. * @param {number} p2 - 点p2。
  46623. * @param {number} p3 - 点p3。
  46624. * @param {number} val - 值。
  46625. * @param {Array.<number>} roots - 有效根数目。
  46626. * @returns {number} 有效根。
  46627. */
  46628. }, {
  46629. key: "cubicRootAt",
  46630. value: function cubicRootAt(p0, p1, p2, p3, val, roots) {
  46631. // Evaluate roots of cubic functions
  46632. var a = p3 + 3 * (p1 - p2) - p0;
  46633. var b = 3 * (p2 - p1 * 2 + p0);
  46634. var c = 3 * (p1 - p0);
  46635. var d = p0 - val;
  46636. var A = b * b - 3 * a * c;
  46637. var B = b * c - 9 * a * d;
  46638. var C = c * c - 3 * b * d;
  46639. var n = 0;
  46640. if (this.isAroundZero(A) && this.isAroundZero(B)) {
  46641. if (this.isAroundZero(b)) {
  46642. roots[0] = 0;
  46643. } else {
  46644. var t1 = -c / b; //t1, t2, t3, b is not zero
  46645. if (t1 >= 0 && t1 <= 1) {
  46646. roots[n++] = t1;
  46647. }
  46648. }
  46649. } else {
  46650. var disc = B * B - 4 * A * C;
  46651. if (this.isAroundZero(disc)) {
  46652. var K = B / A;
  46653. var _t2 = -b / a + K; // t1, a is not zero
  46654. var t2 = -K / 2; // t2, t3
  46655. if (_t2 >= 0 && _t2 <= 1) {
  46656. roots[n++] = _t2;
  46657. }
  46658. if (t2 >= 0 && t2 <= 1) {
  46659. roots[n++] = t2;
  46660. }
  46661. } else if (disc > 0) {
  46662. var discSqrt = Math.sqrt(disc);
  46663. var Y1 = A * b + 1.5 * a * (-B + discSqrt);
  46664. var Y2 = A * b + 1.5 * a * (-B - discSqrt);
  46665. if (Y1 < 0) {
  46666. Y1 = -Math.pow(-Y1, this.ONE_THIRD);
  46667. } else {
  46668. Y1 = Math.pow(Y1, this.ONE_THIRD);
  46669. }
  46670. if (Y2 < 0) {
  46671. Y2 = -Math.pow(-Y2, this.ONE_THIRD);
  46672. } else {
  46673. Y2 = Math.pow(Y2, this.ONE_THIRD);
  46674. }
  46675. var _t3 = (-b - (Y1 + Y2)) / (3 * a);
  46676. if (_t3 >= 0 && _t3 <= 1) {
  46677. roots[n++] = _t3;
  46678. }
  46679. } else {
  46680. var T = (2 * A * b - 3 * a * B) / (2 * Math.sqrt(A * A * A));
  46681. var theta = Math.acos(T) / 3;
  46682. var ASqrt = Math.sqrt(A);
  46683. var tmp = Math.cos(theta);
  46684. var _t4 = (-b - 2 * ASqrt * tmp) / (3 * a);
  46685. var _t5 = (-b + ASqrt * (tmp + this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  46686. var t3 = (-b + ASqrt * (tmp - this.THREE_SQRT * Math.sin(theta))) / (3 * a);
  46687. if (_t4 >= 0 && _t4 <= 1) {
  46688. roots[n++] = _t4;
  46689. }
  46690. if (_t5 >= 0 && _t5 <= 1) {
  46691. roots[n++] = _t5;
  46692. }
  46693. if (t3 >= 0 && t3 <= 1) {
  46694. roots[n++] = t3;
  46695. }
  46696. }
  46697. }
  46698. return n;
  46699. }
  46700. /**
  46701. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicRootAt
  46702. * @description 计算三次贝塞尔方程极限值的位置
  46703. * @param {number} p0 - 点p0。
  46704. * @param {number} p1 - 点p1。
  46705. * @param {number} p2 - 点p2。
  46706. * @param {number} p3 - 点p3。
  46707. * @param {Array.<number>} extrema - 值。
  46708. * @returns {number} 有效数目。
  46709. */
  46710. }, {
  46711. key: "cubicExtrema",
  46712. value: function cubicExtrema(p0, p1, p2, p3, extrema) {
  46713. var b = 6 * p2 - 12 * p1 + 6 * p0;
  46714. var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
  46715. var c = 3 * p1 - 3 * p0;
  46716. var n = 0;
  46717. if (this.isAroundZero(a)) {
  46718. if (this.isNotAroundZero(b)) {
  46719. var t1 = -c / b;
  46720. if (t1 >= 0 && t1 <= 1) {
  46721. extrema[n++] = t1;
  46722. }
  46723. }
  46724. } else {
  46725. var disc = b * b - 4 * a * c;
  46726. if (this.isAroundZero(disc)) {
  46727. extrema[0] = -b / (2 * a);
  46728. } else if (disc > 0) {
  46729. var discSqrt = Math.sqrt(disc);
  46730. var _t6 = (-b + discSqrt) / (2 * a);
  46731. var t2 = (-b - discSqrt) / (2 * a);
  46732. if (_t6 >= 0 && _t6 <= 1) {
  46733. extrema[n++] = _t6;
  46734. }
  46735. if (t2 >= 0 && t2 <= 1) {
  46736. extrema[n++] = t2;
  46737. }
  46738. }
  46739. }
  46740. return n;
  46741. }
  46742. /**
  46743. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicSubdivide
  46744. * @description 细分三次贝塞尔曲线
  46745. * @param {number} p0 - 点p0。
  46746. * @param {number} p1 - 点p1。
  46747. * @param {number} p2 - 点p2。
  46748. * @param {number} p3 - 点p3。
  46749. * @param {number} t - t值。
  46750. * @param {Array.<number>} out - 投射点。
  46751. * @returns {number} 投射点。
  46752. */
  46753. }, {
  46754. key: "cubicSubdivide",
  46755. value: function cubicSubdivide(p0, p1, p2, p3, t, out) {
  46756. var p01 = (p1 - p0) * t + p0;
  46757. var p12 = (p2 - p1) * t + p1;
  46758. var p23 = (p3 - p2) * t + p2;
  46759. var p012 = (p12 - p01) * t + p01;
  46760. var p123 = (p23 - p12) * t + p12;
  46761. var p0123 = (p123 - p012) * t + p012; // Seg0
  46762. out[0] = p0;
  46763. out[1] = p01;
  46764. out[2] = p012;
  46765. out[3] = p0123; // Seg1
  46766. out[4] = p0123;
  46767. out[5] = p123;
  46768. out[6] = p23;
  46769. out[7] = p3;
  46770. }
  46771. /**
  46772. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.cubicProjectPoint
  46773. * @description 投射点到三次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  46774. * @param {number} x0 - 点p0横坐标。
  46775. * @param {number} y0 - 点p0纵坐标。
  46776. * @param {number} x1 - 点p1横坐标。
  46777. * @param {number} y1 - 点p1纵坐标。
  46778. * @param {number} x2 - 点p2横坐标。
  46779. * @param {number} y2 - 点p2纵坐标。
  46780. * @param {number} x3 - 点p3横坐标。
  46781. * @param {number} y3 - 点p3纵坐标。
  46782. * @param {number} x - 点p横坐标。
  46783. * @param {number} y - 点p纵坐标。
  46784. * @param {Array.<number>} out - 投射点。
  46785. * @returns {number} 投射点。
  46786. */
  46787. }, {
  46788. key: "cubicProjectPoint",
  46789. value: function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {
  46790. // 临时变量
  46791. var _v0 = this.vector.create();
  46792. var _v1 = this.vector.create();
  46793. var _v2 = this.vector.create(); // var _v3 = vector.create();
  46794. // http://pomax.github.io/bezierinfo/#projections
  46795. var t;
  46796. var interval = 0.005;
  46797. var d = Infinity;
  46798. _v0[0] = x;
  46799. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  46800. // PENDING
  46801. for (var _t = 0; _t < 1; _t += 0.05) {
  46802. _v1[0] = this.cubicAt(x0, x1, x2, x3, _t);
  46803. _v1[1] = this.cubicAt(y0, y1, y2, y3, _t);
  46804. var d1 = this.vector.distSquare(_v0, _v1);
  46805. if (d1 < d) {
  46806. t = _t;
  46807. d = d1;
  46808. }
  46809. }
  46810. d = Infinity; // At most 32 iteration
  46811. for (var i = 0; i < 32; i++) {
  46812. if (interval < this.EPSILON) {
  46813. break;
  46814. }
  46815. var prev = t - interval;
  46816. var next = t + interval; // t - interval
  46817. _v1[0] = this.cubicAt(x0, x1, x2, x3, prev);
  46818. _v1[1] = this.cubicAt(y0, y1, y2, y3, prev);
  46819. var _d = this.vector.distSquare(_v1, _v0);
  46820. if (prev >= 0 && _d < d) {
  46821. t = prev;
  46822. d = _d;
  46823. } else {
  46824. // t + interval
  46825. _v2[0] = this.cubicAt(x0, x1, x2, x3, next);
  46826. _v2[1] = this.cubicAt(y0, y1, y2, y3, next);
  46827. var d2 = this.vector.distSquare(_v2, _v0);
  46828. if (next <= 1 && d2 < d) {
  46829. t = next;
  46830. d = d2;
  46831. } else {
  46832. interval *= 0.5;
  46833. }
  46834. }
  46835. } // t
  46836. if (out) {
  46837. out[0] = this.cubicAt(x0, x1, x2, x3, t);
  46838. out[1] = this.cubicAt(y0, y1, y2, y3, t);
  46839. } // console.log(interval, i);
  46840. return Math.sqrt(d);
  46841. }
  46842. /**
  46843. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  46844. * @description 计算二次方贝塞尔值。
  46845. * @param {number} p0 - 点p0。
  46846. * @param {number} p1 - 点p1。
  46847. * @param {number} p2 - 点p2。
  46848. * @param {number} t - t值。
  46849. * @returns {number} 二次方贝塞尔值。
  46850. */
  46851. }, {
  46852. key: "quadraticAt",
  46853. value: function quadraticAt(p0, p1, p2, t) {
  46854. var onet = 1 - t;
  46855. return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
  46856. }
  46857. /**
  46858. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticAt
  46859. * @description 计算二次方贝塞尔导数值。
  46860. * @param {number} p0 - 点p0。
  46861. * @param {number} p1 - 点p1。
  46862. * @param {number} p2 - 点p2。
  46863. * @param {number} t - t值。
  46864. * @returns {number} 二次方贝塞尔导数值。
  46865. */
  46866. }, {
  46867. key: "quadraticDerivativeAt",
  46868. value: function quadraticDerivativeAt(p0, p1, p2, t) {
  46869. return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
  46870. }
  46871. /**
  46872. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticRootAt
  46873. * @description 计算二次方贝塞尔方程根
  46874. * @param {number} p0 - 点p0。
  46875. * @param {number} p1 - 点p1。
  46876. * @param {number} p2 - 点p2。
  46877. * @param {number} val - 值。
  46878. * @param {Array.<number>} roots - 有效根数目。
  46879. * @returns {number} 有效根数目。
  46880. */
  46881. }, {
  46882. key: "quadraticRootAt",
  46883. value: function quadraticRootAt(p0, p1, p2, val, roots) {
  46884. var a = p0 - 2 * p1 + p2;
  46885. var b = 2 * (p1 - p0);
  46886. var c = p0 - val;
  46887. var n = 0;
  46888. if (this.isAroundZero(a)) {
  46889. if (this.isNotAroundZero(b)) {
  46890. var t1 = -c / b;
  46891. if (t1 >= 0 && t1 <= 1) {
  46892. roots[n++] = t1;
  46893. }
  46894. }
  46895. } else {
  46896. var disc = b * b - 4 * a * c;
  46897. if (this.isAroundZero(disc)) {
  46898. var _t7 = -b / (2 * a);
  46899. if (_t7 >= 0 && _t7 <= 1) {
  46900. roots[n++] = _t7;
  46901. }
  46902. } else if (disc > 0) {
  46903. var discSqrt = Math.sqrt(disc);
  46904. var _t8 = (-b + discSqrt) / (2 * a);
  46905. var t2 = (-b - discSqrt) / (2 * a);
  46906. if (_t8 >= 0 && _t8 <= 1) {
  46907. roots[n++] = _t8;
  46908. }
  46909. if (t2 >= 0 && t2 <= 1) {
  46910. roots[n++] = t2;
  46911. }
  46912. }
  46913. }
  46914. return n;
  46915. }
  46916. /**
  46917. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticExtremum
  46918. * @description 计算二次贝塞尔方程极限值
  46919. * @param {number} p0 - 点p0。
  46920. * @param {number} p1 - 点p1。
  46921. * @param {number} p2 - 点p2。
  46922. * @returns {number} 二次贝塞尔方程极限值。
  46923. */
  46924. }, {
  46925. key: "quadraticExtremum",
  46926. value: function quadraticExtremum(p0, p1, p2) {
  46927. var divider = p0 + p2 - 2 * p1;
  46928. if (divider === 0) {
  46929. // p1 is center of p0 and p2
  46930. return 0.5;
  46931. } else {
  46932. return (p0 - p1) / divider;
  46933. }
  46934. }
  46935. /**
  46936. * @function SuperMap.LevelRenderer.Tool.Curve.prototype.quadraticProjectPoint
  46937. * @description 投射点到二次贝塞尔曲线上,返回投射距离。投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
  46938. * @param {number} x0 - 点p0横坐标。
  46939. * @param {number} y0 - 点p0纵坐标。
  46940. * @param {number} x1 - 点p1横坐标。
  46941. * @param {number} y1 - 点p1纵坐标。
  46942. * @param {number} x2 - 点p2横坐标。
  46943. * @param {number} y2 - 点p2纵坐标。
  46944. * @param {number} x - 点p横坐标。
  46945. * @param {number} y - 点p纵坐标。
  46946. * @param {Array.<number>} out - 投射点。
  46947. * @returns {number} 投射距离。
  46948. */
  46949. }, {
  46950. key: "quadraticProjectPoint",
  46951. value: function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {
  46952. // 临时变量
  46953. var _v0 = this.vector.create();
  46954. var _v1 = this.vector.create();
  46955. var _v2 = this.vector.create(); // http://pomax.github.io/bezierinfo/#projections
  46956. var t;
  46957. var interval = 0.005;
  46958. var d = Infinity;
  46959. _v0[0] = x;
  46960. _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值
  46961. // PENDING
  46962. for (var _t = 0; _t < 1; _t += 0.05) {
  46963. _v1[0] = this.quadraticAt(x0, x1, x2, _t);
  46964. _v1[1] = this.quadraticAt(y0, y1, y2, _t);
  46965. var d1 = this.vector.distSquare(_v0, _v1);
  46966. if (d1 < d) {
  46967. t = _t;
  46968. d = d1;
  46969. }
  46970. }
  46971. d = Infinity; // At most 32 iteration
  46972. for (var i = 0; i < 32; i++) {
  46973. if (interval < this.EPSILON) {
  46974. break;
  46975. }
  46976. var prev = t - interval;
  46977. var next = t + interval; // t - interval
  46978. _v1[0] = this.quadraticAt(x0, x1, x2, prev);
  46979. _v1[1] = this.quadraticAt(y0, y1, y2, prev);
  46980. var _d2 = this.vector.distSquare(_v1, _v0);
  46981. if (prev >= 0 && _d2 < d) {
  46982. t = prev;
  46983. d = _d2;
  46984. } else {
  46985. // t + interval
  46986. _v2[0] = this.quadraticAt(x0, x1, x2, next);
  46987. _v2[1] = this.quadraticAt(y0, y1, y2, next);
  46988. var d2 = this.vector.distSquare(_v2, _v0);
  46989. if (next <= 1 && d2 < d) {
  46990. t = next;
  46991. d = d2;
  46992. } else {
  46993. interval *= 0.5;
  46994. }
  46995. }
  46996. } // t
  46997. if (out) {
  46998. out[0] = this.quadraticAt(x0, x1, x2, t);
  46999. out[1] = this.quadraticAt(y0, y1, y2, t);
  47000. } // console.log(interval, i);
  47001. return Math.sqrt(d);
  47002. }
  47003. }]);
  47004. return Curve;
  47005. }();
  47006. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Area.js
  47007. function Area_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47008. 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); } }
  47009. function Area_createClass(Constructor, protoProps, staticProps) { if (protoProps) Area_defineProperties(Constructor.prototype, protoProps); if (staticProps) Area_defineProperties(Constructor, staticProps); return Constructor; }
  47010. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47011. * This program are made available under the terms of the Apache License, Version 2.0
  47012. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47013. /**
  47014. * @class SuperMap.LevelRenderer.Tool.Area
  47015. * @category Visualization Theme
  47016. * @classdesc LevelRenderer 工具-图形范围判断
  47017. * @private
  47018. */
  47019. var Area = /*#__PURE__*/function () {
  47020. /**
  47021. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.constructor
  47022. * @description 构造函数。
  47023. */
  47024. function Area() {
  47025. Area_classCallCheck(this, Area);
  47026. /**
  47027. * @member {SuperMap.LevelRenderer.Tool.Util} SuperMap.LevelRenderer.Tool.Areal.prototype.util
  47028. * @description 基础工具对象。
  47029. */
  47030. this.util = new Util_Util();
  47031. /**
  47032. * @member {SuperMap.LevelRenderer.Tool.Curve} SuperMap.LevelRenderer.Tool.Areal.prototype.curve
  47033. * @description 曲线工具对象
  47034. */
  47035. this.curve = new Curve_Curve();
  47036. /**
  47037. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._ctx
  47038. * @description Cavans2D 渲染上下文
  47039. */
  47040. this._ctx = null;
  47041. /**
  47042. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCache
  47043. * @description 文本宽度缓存
  47044. */
  47045. this._textWidthCache = {};
  47046. /**
  47047. * @member {Object} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCache
  47048. * @description 文本高度缓存
  47049. */
  47050. this._textHeightCache = {};
  47051. /**
  47052. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textWidthCacheCounter
  47053. * @description 文本宽度缓存数量
  47054. */
  47055. this._textWidthCacheCounter = 0;
  47056. /**
  47057. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype._textHeightCacheCounter
  47058. * @description 文本高度缓存数量
  47059. */
  47060. this._textHeightCacheCounter = 0;
  47061. /**
  47062. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.TEXT_CACHE_MAX
  47063. * @description 文本最大缓存数量
  47064. */
  47065. this.TEXT_CACHE_MAX = 5000;
  47066. /**
  47067. * @member {number} SuperMap.LevelRenderer.Tool.Areal.prototype.PI2
  47068. * @description 2*PI 的值
  47069. */
  47070. this.PI2 = Math.PI * 2;
  47071. /**
  47072. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.roots
  47073. * @description 临时数组
  47074. */
  47075. this.roots = [-1, -1, -1];
  47076. /**
  47077. * @member {Array} SuperMap.LevelRenderer.Tool.Areal.prototype.extrema
  47078. * @description 临时数组
  47079. */
  47080. this.extrema = [-1, -1];
  47081. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Area";
  47082. }
  47083. /**
  47084. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.normalizeRadian
  47085. * @description 弧度标准化函数。
  47086. * @param {number} angle - 弧度值。
  47087. * @returns {number} 标准化后的弧度值。
  47088. */
  47089. Area_createClass(Area, [{
  47090. key: "normalizeRadian",
  47091. value: function normalizeRadian(angle) {
  47092. angle %= this.PI2;
  47093. if (angle < 0) {
  47094. angle += this.PI2;
  47095. }
  47096. return angle;
  47097. }
  47098. /**
  47099. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInside
  47100. * @description 包含判断。
  47101. * @param {Object} shape - 图形。
  47102. * @param {number} area - 目标区域。
  47103. * @param {number} x - 横坐标。
  47104. * @param {number} y - 纵坐标。
  47105. * @returns {boolean} 图形是否包含鼠标位置。
  47106. */
  47107. }, {
  47108. key: "isInside",
  47109. value: function isInside(shape, area, x, y) {
  47110. if (!area || !shape) {
  47111. // 无参数或不支持类型
  47112. return false;
  47113. }
  47114. var zoneType = shape.type;
  47115. this._ctx = this._ctx || this.util.getContext(); // 未实现或不可用时则数学运算,主要是line,brokenLine,ring
  47116. var _mathReturn = this._mathMethod(shape, area, x, y);
  47117. if (typeof _mathReturn != 'undefined') {
  47118. return _mathReturn;
  47119. }
  47120. if (shape.buildPath && this._ctx.isPointInPath) {
  47121. return this._buildPathMethod(shape, this._ctx, area, x, y);
  47122. } // 上面的方法都行不通时
  47123. switch (zoneType) {
  47124. case 'ellipse': // Todo,不精确
  47125. case 'smicellipse':
  47126. // Todo,不精确
  47127. return true;
  47128. // 旋轮曲线 不准确
  47129. case 'trochoid':
  47130. var _r = area.location == 'out' ? area.r1 + area.r2 + area.d : area.r1 - area.r2 + area.d;
  47131. return this.isInsideCircle(area, x, y, _r);
  47132. // 玫瑰线 不准确
  47133. case 'rose':
  47134. return this.isInsideCircle(area, x, y, area.maxr);
  47135. // 路径,椭圆,曲线等-----------------13
  47136. default:
  47137. return false;
  47138. // Todo,暂不支持
  47139. }
  47140. }
  47141. /**
  47142. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._mathMethod
  47143. * @description 包含判断。用数学方法判断,三个方法中最快,但是支持的shape少。
  47144. * @param {Object} shape - 图形。
  47145. * @param {number} area - 目标区域。
  47146. * @param {number} x - 横坐标。
  47147. * @param {number} y - 纵坐标。
  47148. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  47149. */
  47150. }, {
  47151. key: "_mathMethod",
  47152. value: function _mathMethod(shape, area, x, y) {
  47153. var zoneType = shape.type; // 在矩形内则部分图形需要进一步判断
  47154. switch (zoneType) {
  47155. // 贝塞尔曲线
  47156. case 'bezier-curve':
  47157. if (typeof area.cpX2 === 'undefined') {
  47158. return this.isInsideQuadraticStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47159. }
  47160. return this.isInsideCubicStroke(area.xStart, area.yStart, area.cpX1, area.cpY1, area.cpX2, area.cpY2, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47161. // 线
  47162. case 'line':
  47163. return this.isInsideLine(area.xStart, area.yStart, area.xEnd, area.yEnd, area.lineWidth, x, y);
  47164. // 折线
  47165. case 'broken-line':
  47166. return this.isInsideBrokenLine(area.pointList, area.lineWidth, x, y);
  47167. // 扩展折线
  47168. case 'smicbroken-line':
  47169. {
  47170. // SMIC-修改 - start
  47171. var icX = x;
  47172. var icY = y;
  47173. if (shape.refOriginalPosition) {
  47174. icX = x - shape.refOriginalPosition[0];
  47175. icY = y - shape.refOriginalPosition[1];
  47176. }
  47177. return this.isInsideBrokenLine(area.pointList, area.lineWidth, icX, icY);
  47178. }
  47179. //初始代码:
  47180. // return isInsideBrokenLine(
  47181. // area.pointList, area.lineWidth, x, y
  47182. // );
  47183. // SMIC-修改 - end
  47184. // 圆环
  47185. case 'ring':
  47186. return this.isInsideRing(area.x, area.y, area.r0, area.r, x, y);
  47187. case 'smicring':
  47188. {
  47189. var areaX = area.x;
  47190. var areaY = area.y;
  47191. if (shape.refOriginalPosition) {
  47192. areaX = area.x + shape.refOriginalPosition[0];
  47193. areaY = area.y + shape.refOriginalPosition[1];
  47194. }
  47195. return this.isInsideRing(areaX, areaY, area.r0, area.r, x, y);
  47196. }
  47197. // 圆形
  47198. case 'circle':
  47199. return this.isInsideCircle(area.x, area.y, area.r, x, y);
  47200. // 扩展-点
  47201. case 'smicpoint':
  47202. {
  47203. // SMIC-修改 - start
  47204. var _icX = x;
  47205. var _icY = y;
  47206. if (shape.refOriginalPosition) {
  47207. _icX = x - shape.refOriginalPosition[0];
  47208. _icY = y - shape.refOriginalPosition[1];
  47209. }
  47210. return this.isInsideCircle(area.x, area.y, area.r, _icX, _icY);
  47211. }
  47212. //初始代码:
  47213. // 无
  47214. // SMIC-修改 - end
  47215. // 扇形
  47216. case 'sector':
  47217. {
  47218. var startAngle = area.startAngle * Math.PI / 180;
  47219. var endAngle = area.endAngle * Math.PI / 180;
  47220. if (!area.clockWise) {
  47221. startAngle = -startAngle;
  47222. endAngle = -endAngle;
  47223. }
  47224. return this.isInsideSector(area.x, area.y, area.r0, area.r, startAngle, endAngle, !area.clockWise, x, y);
  47225. }
  47226. //初始代码:
  47227. // 无
  47228. // SMIC-增加 - end
  47229. // 扇形
  47230. case 'smicsector':
  47231. {
  47232. var _startAngle = area.startAngle * Math.PI / 180;
  47233. var _endAngle = area.endAngle * Math.PI / 180;
  47234. if (!area.clockWise) {
  47235. _startAngle = -_startAngle;
  47236. _endAngle = -_endAngle;
  47237. }
  47238. var _areaX = area.x;
  47239. var _areaY = area.y;
  47240. if (shape.refOriginalPosition) {
  47241. _areaX = area.x + shape.refOriginalPosition[0];
  47242. _areaY = area.y + shape.refOriginalPosition[1];
  47243. }
  47244. return this.isInsideSector(_areaX, _areaY, area.r0, area.r, _startAngle, _endAngle, !area.clockWise, x, y);
  47245. }
  47246. // 多边形
  47247. case 'path':
  47248. return this.isInsidePath(area.pathArray, Math.max(area.lineWidth, 5), area.brushType, x, y);
  47249. case 'polygon':
  47250. case 'star':
  47251. case 'smicstar':
  47252. case 'isogon':
  47253. case 'smicisogon':
  47254. return this.isInsidePolygon(area.pointList, x, y);
  47255. // 扩展多边形
  47256. case 'smicpolygon':
  47257. {
  47258. // SMIC-修改 - start
  47259. var _icX2 = x;
  47260. var _icY2 = y;
  47261. if (shape.refOriginalPosition) {
  47262. _icX2 = x - shape.refOriginalPosition[0];
  47263. _icY2 = y - shape.refOriginalPosition[1];
  47264. } //岛洞面
  47265. if (shape.holePolygonPointLists && shape.holePolygonPointLists.length > 0) {
  47266. var isOnBase = this.isInsidePolygon(area.pointList, _icX2, _icY2); // 遍历岛洞子面
  47267. var holePLS = shape.holePolygonPointLists;
  47268. var isOnHole = false;
  47269. for (var i = 0, holePLSen = holePLS.length; i < holePLSen; i++) {
  47270. var holePL = holePLS[i];
  47271. var isOnSubHole = this.isInsidePolygon(holePL, _icX2, _icY2);
  47272. if (isOnSubHole === true) {
  47273. isOnHole = true;
  47274. }
  47275. } // 捕获判断
  47276. return isOnBase === true && isOnHole === false;
  47277. } else {
  47278. return this.isInsidePolygon(area.pointList, _icX2, _icY2);
  47279. }
  47280. }
  47281. // 初始代码:
  47282. // 无
  47283. // SMIC-修改 - end
  47284. // 文本
  47285. case 'text':
  47286. var rect = area.__rect || shape.getRect(area);
  47287. return this.isInsideRect(rect.x, rect.y, rect.width, rect.height, x, y);
  47288. // 扩展文本
  47289. case 'smictext':
  47290. //用文本背景矩形判断
  47291. var textBg = shape.getTextBackground(area);
  47292. return this.isInsidePolygon(textBg, x, y);
  47293. //初始代码:
  47294. // 无
  47295. // SMIC-修改 - end
  47296. // 矩形
  47297. case 'rectangle':
  47298. case 'image':
  47299. // 图片
  47300. return this.isInsideRect(area.x, area.y, area.width, area.height, x, y);
  47301. case 'smicimage':
  47302. {
  47303. var _areaX2 = area.x;
  47304. var _areaY2 = area.y;
  47305. if (shape.refOriginalPosition) {
  47306. _areaX2 = area.x + shape.refOriginalPosition[0];
  47307. _areaY2 = area.y + shape.refOriginalPosition[1];
  47308. }
  47309. return this.isInsideRect(_areaX2, _areaY2, area.width, area.height, x, y);
  47310. }
  47311. //// 扩展矩形
  47312. //case 'smicpolygon':
  47313. // // SMIC-修改 - start
  47314. // var icX = x;
  47315. // var icY = y;
  47316. // if(shape.refOriginalPosition) {
  47317. // icX = x - shape.refOriginalPosition[0];
  47318. // icY = y - shape.refOriginalPosition[1];
  47319. // }
  47320. // return this.isInsideRect(
  47321. // area.x, area.y, area.width, area.height, icX, icY
  47322. // );
  47323. //初始代码:
  47324. // 无
  47325. // SMIC-修改 - end
  47326. }
  47327. }
  47328. /**
  47329. * @function SuperMap.LevelRenderer.Tool.Areal.prototype._buildPathMethod
  47330. * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。
  47331. * @param {Object} shape - 图形。
  47332. * @param {Object} context - 上下文。
  47333. * @param {number} area - 目标区域。
  47334. * @param {number} x - 横坐标。
  47335. * @param {number} y - 纵坐标。
  47336. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
  47337. */
  47338. }, {
  47339. key: "_buildPathMethod",
  47340. value: function _buildPathMethod(shape, context, area, x, y) {
  47341. // 图形类实现路径创建了则用类的path
  47342. context.beginPath();
  47343. shape.buildPath(context, area);
  47344. context.closePath();
  47345. return context.isPointInPath(x, y);
  47346. }
  47347. /**
  47348. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isOutside
  47349. * @description 图形是否不包含鼠标位置。
  47350. * @param {Object} shape - 图形。
  47351. * @param {number} area - 目标区域。
  47352. * @param {number} x - 横坐标。
  47353. * @param {number} y - 纵坐标。
  47354. * @returns {boolean} 图形是否不包含鼠标位置, true表示坐标处在图形外。
  47355. */
  47356. }, {
  47357. key: "isOutside",
  47358. value: function isOutside(shape, area, x, y) {
  47359. return !this.isInside(shape, area, x, y);
  47360. }
  47361. /**
  47362. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideLine
  47363. * @description 线段包含判断。
  47364. * @param {number} x0 - 线起始点横坐标。
  47365. * @param {number} y0 - 线起始点纵坐标。
  47366. * @param {number} x1 - 线终点横坐标。
  47367. * @param {number} y1 - 线终点纵坐标。
  47368. * @param {number} lineWidth - 线宽。
  47369. * @param {number} x - 鼠标位置横坐标。
  47370. * @param {number} y - 鼠标位置纵坐标。
  47371. * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形内。
  47372. */
  47373. }, {
  47374. key: "isInsideLine",
  47375. value: function isInsideLine(x0, y0, x1, y1, lineWidth, x, y) {
  47376. if (lineWidth === 0) {
  47377. return false;
  47378. }
  47379. var _l = Math.max(lineWidth, 5);
  47380. var _a = 0;
  47381. var _b = 0; // Quick reject
  47382. 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) {
  47383. return false;
  47384. }
  47385. if (x0 !== x1) {
  47386. _a = (y0 - y1) / (x0 - x1);
  47387. _b = (x0 * y1 - x1 * y0) / (x0 - x1);
  47388. } else {
  47389. return Math.abs(x - x0) <= _l / 2;
  47390. }
  47391. var tmp = _a * x - y + _b;
  47392. var _s = tmp * tmp / (_a * _a + 1);
  47393. return _s <= _l / 2 * _l / 2;
  47394. }
  47395. /**
  47396. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCubicStroke
  47397. * @description 三次贝塞尔曲线描边包含判断。
  47398. * @param {number} x0 - 点1横坐标。
  47399. * @param {number} y0 - 点1纵坐标。
  47400. * @param {number} x1 - 点2横坐标。
  47401. * @param {number} y1 - 点2纵坐标。
  47402. * @param {number} x2 - 点3纵坐标。
  47403. * @param {number} y2 - 点3纵坐标。
  47404. * @param {number} lineWidth - 线宽。
  47405. * @param {number} x - 鼠标位置横坐标。
  47406. * @param {number} y - 鼠标位置纵坐标。
  47407. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47408. */
  47409. }, {
  47410. key: "isInsideCubicStroke",
  47411. value: function isInsideCubicStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
  47412. if (lineWidth === 0) {
  47413. return false;
  47414. }
  47415. var _l = Math.max(lineWidth, 5); // Quick reject
  47416. 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) {
  47417. return false;
  47418. }
  47419. var d = this.curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);
  47420. return d <= _l / 2;
  47421. }
  47422. /**
  47423. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideQuadraticStroke
  47424. * @description 二次贝塞尔曲线描边包含判断。
  47425. * @param {number} x0 - 点1横坐标。
  47426. * @param {number} y0 - 点1纵坐标。
  47427. * @param {number} x1 - 点2横坐标。
  47428. * @param {number} y1 - 点2纵坐标。
  47429. * @param {number} x2 - 点3纵坐标。
  47430. * @param {number} y2 - 点3纵坐标。
  47431. * @param {number} lineWidth - 线宽。
  47432. * @param {number} x - 鼠标位置横坐标。
  47433. * @param {number} y - 鼠标位置纵坐标。
  47434. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47435. */
  47436. }, {
  47437. key: "isInsideQuadraticStroke",
  47438. value: function isInsideQuadraticStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
  47439. if (lineWidth === 0) {
  47440. return false;
  47441. }
  47442. var _l = Math.max(lineWidth, 5); // Quick reject
  47443. 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) {
  47444. return false;
  47445. }
  47446. var d = this.curve.quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);
  47447. return d <= _l / 2;
  47448. }
  47449. /**
  47450. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideArcStroke
  47451. * @description 圆弧描边包含判断。
  47452. * @param {number} cx - 圆心横坐标。
  47453. * @param {number} cy - 圆心纵坐标。
  47454. * @param {number} r - 圆半径。
  47455. * @param {number} startAngle - 起始角度。
  47456. * @param {number} endAngle - 终止角度。
  47457. * @param {number} anticlockwise - 顺时针还是逆时针。
  47458. * @param {number} lineWidth - 线宽。
  47459. * @param {number} x - 鼠标位置横坐标。
  47460. * @param {number} y - 鼠标位置纵坐标。
  47461. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47462. */
  47463. }, {
  47464. key: "isInsideArcStroke",
  47465. value: function isInsideArcStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {
  47466. var PI2 = this.PI2;
  47467. if (lineWidth === 0) {
  47468. return false;
  47469. }
  47470. var _l = Math.max(lineWidth, 5);
  47471. x -= cx;
  47472. y -= cy;
  47473. var d = Math.sqrt(x * x + y * y);
  47474. if (d - _l > r || d + _l < r) {
  47475. return false;
  47476. }
  47477. if (Math.abs(startAngle - endAngle) >= PI2) {
  47478. // Is a circle
  47479. return true;
  47480. }
  47481. if (anticlockwise) {
  47482. var tmp = startAngle;
  47483. startAngle = this.normalizeRadian(endAngle);
  47484. endAngle = this.normalizeRadian(tmp);
  47485. } else {
  47486. startAngle = this.normalizeRadian(startAngle);
  47487. endAngle = this.normalizeRadian(endAngle);
  47488. }
  47489. if (startAngle > endAngle) {
  47490. endAngle += PI2;
  47491. }
  47492. var angle = Math.atan2(y, x);
  47493. if (angle < 0) {
  47494. angle += PI2;
  47495. }
  47496. return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;
  47497. }
  47498. /**
  47499. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideBrokenLine
  47500. * @description 图形 BrokenLine 是否包含鼠标位置, true表示坐标处在图形内。
  47501. * @param {Array} points - 曲线点对象。
  47502. * @param {number} lineWidth - 线宽。
  47503. * @param {number} x - 鼠标位置横坐标。
  47504. * @param {number} y - 鼠标位置纵坐标。
  47505. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47506. */
  47507. }, {
  47508. key: "isInsideBrokenLine",
  47509. value: function isInsideBrokenLine(points, lineWidth, x, y) {
  47510. var _lineWidth = Math.max(lineWidth, 10);
  47511. for (var i = 0, l = points.length - 1; i < l; i++) {
  47512. var x0 = points[i][0];
  47513. var y0 = points[i][1];
  47514. var x1 = points[i + 1][0];
  47515. var y1 = points[i + 1][1];
  47516. if (this.isInsideLine(x0, y0, x1, y1, _lineWidth, x, y)) {
  47517. return true;
  47518. }
  47519. }
  47520. return false;
  47521. }
  47522. /**
  47523. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRing
  47524. * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。
  47525. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47526. */
  47527. }, {
  47528. key: "isInsideRing",
  47529. value: function isInsideRing(cx, cy, r0, r, x, y) {
  47530. var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
  47531. return d < r * r && d > r0 * r0;
  47532. }
  47533. /**
  47534. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideRect
  47535. * @description 图形 Rect 是否包含鼠标位置, true表示坐标处在图形内。
  47536. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47537. */
  47538. }, {
  47539. key: "isInsideRect",
  47540. value: function isInsideRect(x0, y0, width, height, x, y) {
  47541. return x >= x0 && x <= x0 + width && y >= y0 && y <= y0 + height;
  47542. }
  47543. /**
  47544. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideCircle
  47545. * @description 图形 Circle 是否包含鼠标位置, true表示坐标处在图形内。
  47546. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47547. */
  47548. }, {
  47549. key: "isInsideCircle",
  47550. value: function isInsideCircle(x0, y0, r, x, y) {
  47551. return (x - x0) * (x - x0) + (y - y0) * (y - y0) < r * r;
  47552. }
  47553. /**
  47554. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsideSector
  47555. * @description 图形 Sector 是否包含鼠标位置, true表示坐标处在图形内。
  47556. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47557. */
  47558. }, {
  47559. key: "isInsideSector",
  47560. value: function isInsideSector(cx, cy, r0, r, startAngle, endAngle, anticlockwise, x, y) {
  47561. return this.isInsideArcStroke(cx, cy, (r0 + r) / 2, startAngle, endAngle, anticlockwise, r - r0, x, y);
  47562. }
  47563. /**
  47564. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePolygon
  47565. * @description 图形 Polygon 是否包含鼠标位置, true表示坐标处在图形内。与 canvas 一样采用 non-zero winding rule
  47566. * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
  47567. */
  47568. }, {
  47569. key: "isInsidePolygon",
  47570. value: function isInsidePolygon(points, x, y) {
  47571. var N = points.length;
  47572. var w = 0;
  47573. for (var i = 0, j = N - 1; i < N; i++) {
  47574. var x0 = points[j][0];
  47575. var y0 = points[j][1];
  47576. var x1 = points[i][0];
  47577. var y1 = points[i][1];
  47578. w += this.windingLine(x0, y0, x1, y1, x, y);
  47579. j = i;
  47580. }
  47581. return w !== 0;
  47582. }
  47583. /**
  47584. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingLine
  47585. */
  47586. }, {
  47587. key: "windingLine",
  47588. value: function windingLine(x0, y0, x1, y1, x, y) {
  47589. if (y > y0 && y > y1 || y < y0 && y < y1) {
  47590. return 0;
  47591. }
  47592. if (y1 == y0) {
  47593. return 0;
  47594. }
  47595. var dir = y1 < y0 ? 1 : -1;
  47596. var t = (y - y0) / (y1 - y0);
  47597. var x_ = t * (x1 - x0) + x0;
  47598. return x_ > x ? dir : 0;
  47599. }
  47600. /**
  47601. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.swapExtrema
  47602. */
  47603. }, {
  47604. key: "swapExtrema",
  47605. value: function swapExtrema() {
  47606. var tmp = this.extrema[0];
  47607. this.extrema[0] = this.extrema[1];
  47608. this.extrema[1] = tmp;
  47609. }
  47610. /**
  47611. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingCubic
  47612. */
  47613. }, {
  47614. key: "windingCubic",
  47615. value: function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
  47616. var curve = this.curve;
  47617. var roots = this.roots;
  47618. var extrema = this.extrema; // Quick reject
  47619. if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
  47620. return 0;
  47621. }
  47622. var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
  47623. if (nRoots === 0) {
  47624. return 0;
  47625. } else {
  47626. var w = 0;
  47627. var nExtrema = -1;
  47628. var y0_, y1_;
  47629. for (var i = 0; i < nRoots; i++) {
  47630. var t = roots[i];
  47631. var x_ = curve.cubicAt(x0, x1, x2, x3, t);
  47632. if (x_ < x) {
  47633. // Quick reject
  47634. continue;
  47635. }
  47636. if (nExtrema < 0) {
  47637. nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
  47638. if (extrema[1] < extrema[0] && nExtrema > 1) {
  47639. this.swapExtrema();
  47640. }
  47641. y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
  47642. if (nExtrema > 1) {
  47643. y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
  47644. }
  47645. }
  47646. if (nExtrema == 2) {
  47647. // 分成三段单调函数
  47648. if (t < extrema[0]) {
  47649. w += y0_ < y0 ? 1 : -1;
  47650. } else if (t < extrema[1]) {
  47651. w += y1_ < y0_ ? 1 : -1;
  47652. } else {
  47653. w += y3 < y1_ ? 1 : -1;
  47654. }
  47655. } else {
  47656. // 分成两段单调函数
  47657. if (t < extrema[0]) {
  47658. w += y0_ < y0 ? 1 : -1;
  47659. } else {
  47660. w += y3 < y0_ ? 1 : -1;
  47661. }
  47662. }
  47663. }
  47664. return w;
  47665. }
  47666. }
  47667. /**
  47668. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingQuadratic
  47669. */
  47670. }, {
  47671. key: "windingQuadratic",
  47672. value: function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
  47673. var curve = this.curve;
  47674. var roots = this.roots; // Quick reject
  47675. if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
  47676. return 0;
  47677. }
  47678. var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
  47679. if (nRoots === 0) {
  47680. return 0;
  47681. } else {
  47682. var t = curve.quadraticExtremum(y0, y1, y2);
  47683. if (t >= 0 && t <= 1) {
  47684. var w = 0;
  47685. var y_ = curve.quadraticAt(y0, y1, y2, t);
  47686. for (var i = 0; i < nRoots; i++) {
  47687. var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
  47688. if (x_ > x) {
  47689. continue;
  47690. }
  47691. if (roots[i] < t) {
  47692. w += y_ < y0 ? 1 : -1;
  47693. } else {
  47694. w += y2 < y_ ? 1 : -1;
  47695. }
  47696. }
  47697. return w;
  47698. } else {
  47699. var _x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
  47700. if (_x_ > x) {
  47701. return 0;
  47702. }
  47703. return y2 < y0 ? 1 : -1;
  47704. }
  47705. }
  47706. }
  47707. /**
  47708. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.windingArc
  47709. * // TODO Arc 旋转
  47710. */
  47711. }, {
  47712. key: "windingArc",
  47713. value: function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {
  47714. var roots = this.roots;
  47715. var PI2 = this.PI2;
  47716. y -= cy;
  47717. if (y > r || y < -r) {
  47718. return 0;
  47719. }
  47720. var tmp = Math.sqrt(r * r - y * y);
  47721. roots[0] = -tmp;
  47722. roots[1] = tmp;
  47723. if (Math.abs(startAngle - endAngle) >= PI2) {
  47724. // Is a circle
  47725. startAngle = 0;
  47726. endAngle = PI2;
  47727. var dir = anticlockwise ? 1 : -1;
  47728. if (x >= roots[0] + cx && x <= roots[1] + cx) {
  47729. return dir;
  47730. } else {
  47731. return 0;
  47732. }
  47733. }
  47734. if (anticlockwise) {
  47735. var _tmp = startAngle;
  47736. startAngle = this.normalizeRadian(endAngle);
  47737. endAngle = this.normalizeRadian(_tmp);
  47738. } else {
  47739. startAngle = this.normalizeRadian(startAngle);
  47740. endAngle = this.normalizeRadian(endAngle);
  47741. }
  47742. if (startAngle > endAngle) {
  47743. endAngle += PI2;
  47744. }
  47745. var w = 0;
  47746. for (var i = 0; i < 2; i++) {
  47747. var x_ = roots[i];
  47748. if (x_ + cx > x) {
  47749. var angle = Math.atan2(y, x_);
  47750. var _dir = anticlockwise ? 1 : -1;
  47751. if (angle < 0) {
  47752. angle = PI2 + angle;
  47753. }
  47754. if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {
  47755. if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
  47756. _dir = -_dir;
  47757. }
  47758. w += _dir;
  47759. }
  47760. }
  47761. }
  47762. return w;
  47763. }
  47764. /**
  47765. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.isInsidePath
  47766. * @description 与 canvas 一样采用 non-zero winding rule
  47767. */
  47768. }, {
  47769. key: "isInsidePath",
  47770. value: function isInsidePath(pathArray, lineWidth, brushType, x, y) {
  47771. var w = 0;
  47772. var xi = 0;
  47773. var yi = 0;
  47774. var x0 = 0;
  47775. var y0 = 0;
  47776. var beginSubpath = true;
  47777. var firstCmd = true;
  47778. brushType = brushType || 'fill';
  47779. var hasStroke = brushType === 'stroke' || brushType === 'both';
  47780. var hasFill = brushType === 'fill' || brushType === 'both'; // var roots = [-1, -1, -1];
  47781. for (var i = 0; i < pathArray.length; i++) {
  47782. var seg = pathArray[i];
  47783. var p = seg.points; // Begin a new subpath
  47784. if (beginSubpath || seg.command === 'M') {
  47785. if (i > 0) {
  47786. // Close previous subpath
  47787. if (hasFill) {
  47788. w += this.windingLine(xi, yi, x0, y0, x, y);
  47789. }
  47790. if (w !== 0) {
  47791. return true;
  47792. }
  47793. }
  47794. x0 = p[p.length - 2];
  47795. y0 = p[p.length - 1];
  47796. beginSubpath = false;
  47797. if (firstCmd && seg.command !== 'A') {
  47798. // 如果第一个命令不是M, 是lineTo, bezierCurveTo
  47799. // 等绘制命令的话,是会从该绘制的起点开始算的
  47800. // Arc 会在之后做单独处理所以这里忽略
  47801. firstCmd = false;
  47802. xi = x0;
  47803. yi = y0;
  47804. }
  47805. }
  47806. switch (seg.command) {
  47807. case 'M':
  47808. xi = p[0];
  47809. yi = p[1];
  47810. break;
  47811. case 'L':
  47812. if (hasStroke) {
  47813. if (this.isInsideLine(xi, yi, p[0], p[1], lineWidth, x, y)) {
  47814. return true;
  47815. }
  47816. }
  47817. if (hasFill) {
  47818. w += this.windingLine(xi, yi, p[0], p[1], x, y);
  47819. }
  47820. xi = p[0];
  47821. yi = p[1];
  47822. break;
  47823. case 'C':
  47824. if (hasStroke) {
  47825. if (this.isInsideCubicStroke(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], lineWidth, x, y)) {
  47826. return true;
  47827. }
  47828. }
  47829. if (hasFill) {
  47830. w += this.windingCubic(xi, yi, p[0], p[1], p[2], p[3], p[4], p[5], x, y);
  47831. }
  47832. xi = p[4];
  47833. yi = p[5];
  47834. break;
  47835. case 'Q':
  47836. if (hasStroke) {
  47837. if (this.isInsideQuadraticStroke(xi, yi, p[0], p[1], p[2], p[3], lineWidth, x, y)) {
  47838. return true;
  47839. }
  47840. }
  47841. if (hasFill) {
  47842. w += this.windingQuadratic(xi, yi, p[0], p[1], p[2], p[3], x, y);
  47843. }
  47844. xi = p[2];
  47845. yi = p[3];
  47846. break;
  47847. case 'A':
  47848. // TODO Arc 旋转
  47849. // TODO Arc 判断的开销比较大
  47850. var cx = p[0];
  47851. var cy = p[1];
  47852. var rx = p[2];
  47853. var ry = p[3];
  47854. var theta = p[4];
  47855. var dTheta = p[5];
  47856. var x1 = Math.cos(theta) * rx + cx;
  47857. var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令
  47858. if (!firstCmd) {
  47859. w += this.windingLine(xi, yi, x1, y1);
  47860. } else {
  47861. firstCmd = false; // 第一个命令起点还未定义
  47862. x0 = x1;
  47863. y0 = y1;
  47864. } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
  47865. var _x = (x - cx) * ry / rx + cx;
  47866. if (hasStroke) {
  47867. if (this.isInsideArcStroke(cx, cy, ry, theta, theta + dTheta, 1 - p[7], lineWidth, _x, y)) {
  47868. return true;
  47869. }
  47870. }
  47871. if (hasFill) {
  47872. w += this.windingArc(cx, cy, ry, theta, theta + dTheta, 1 - p[7], _x, y);
  47873. }
  47874. xi = Math.cos(theta + dTheta) * rx + cx;
  47875. yi = Math.sin(theta + dTheta) * ry + cy;
  47876. break;
  47877. case 'z':
  47878. if (hasStroke) {
  47879. if (this.isInsideLine(xi, yi, x0, y0, lineWidth, x, y)) {
  47880. return true;
  47881. }
  47882. }
  47883. beginSubpath = true;
  47884. break;
  47885. }
  47886. }
  47887. if (hasFill) {
  47888. w += this.windingLine(xi, yi, x0, y0, x, y);
  47889. }
  47890. return w !== 0;
  47891. }
  47892. /**
  47893. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextWidth
  47894. * @description 测算多行文本宽度
  47895. */
  47896. }, {
  47897. key: "getTextWidth",
  47898. value: function getTextWidth(text, textFont) {
  47899. var key = text + ':' + textFont;
  47900. if (this._textWidthCache[key]) {
  47901. return this._textWidthCache[key];
  47902. }
  47903. this._ctx = this._ctx || this.util.getContext();
  47904. this._ctx.save();
  47905. if (textFont) {
  47906. this._ctx.font = textFont;
  47907. }
  47908. text = (text + '').split('\n');
  47909. var width = 0;
  47910. for (var i = 0, l = text.length; i < l; i++) {
  47911. width = Math.max(this._ctx.measureText(text[i]).width, width);
  47912. }
  47913. this._ctx.restore();
  47914. this._textWidthCache[key] = width;
  47915. if (++this._textWidthCacheCounter > this.TEXT_CACHE_MAX) {
  47916. // 内存释放
  47917. this._textWidthCacheCounter = 0;
  47918. this._textWidthCache = {};
  47919. }
  47920. return width;
  47921. }
  47922. /**
  47923. * @function SuperMap.LevelRenderer.Tool.Areal.prototype.getTextHeight
  47924. * @description 测算多行文本高度
  47925. */
  47926. }, {
  47927. key: "getTextHeight",
  47928. value: function getTextHeight(text, textFont) {
  47929. var key = text + ':' + textFont;
  47930. if (this._textHeightCache[key]) {
  47931. return this._textHeightCache[key];
  47932. }
  47933. this._ctx = this._ctx || this.util.getContext();
  47934. this._ctx.save();
  47935. if (textFont) {
  47936. this._ctx.font = textFont;
  47937. }
  47938. text = (text + '').split('\n'); // 比较粗暴
  47939. //var height = (this._ctx.measureText('国').width + 2) * text.length; //打包不支持中文,替换掉
  47940. var height = (this._ctx.measureText('ZH').width + 2) * text.length;
  47941. this._ctx.restore();
  47942. this._textHeightCache[key] = height;
  47943. if (++this._textHeightCacheCounter > this.TEXT_CACHE_MAX) {
  47944. // 内存释放
  47945. this._textHeightCacheCounter = 0;
  47946. this._textHeightCache = {};
  47947. }
  47948. return height;
  47949. }
  47950. }]);
  47951. return Area;
  47952. }();
  47953. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/ComputeBoundingBox.js
  47954. function ComputeBoundingBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  47955. 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); } }
  47956. function ComputeBoundingBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) ComputeBoundingBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) ComputeBoundingBox_defineProperties(Constructor, staticProps); return Constructor; }
  47957. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  47958. * This program are made available under the terms of the Apache License, Version 2.0
  47959. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  47960. /**
  47961. * @class SuperMap.LevelRenderer.Tool.ComputeBoundingBox
  47962. * @category Visualization Theme
  47963. * @classdesc LevelRenderer 工具-图形 Bounds 计算
  47964. * @private
  47965. */
  47966. var ComputeBoundingBox = /*#__PURE__*/function () {
  47967. /**
  47968. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.constructor
  47969. * @description 构造函数。
  47970. */
  47971. function ComputeBoundingBox() {
  47972. ComputeBoundingBox_classCallCheck(this, ComputeBoundingBox);
  47973. if (arguments.length === 3) {
  47974. this.computeBoundingBox(arguments);
  47975. }
  47976. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.ComputeBoundingBox";
  47977. }
  47978. /**
  47979. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.computeBoundingBox
  47980. * @description 从顶点数组中计算出最小包围盒,写入'min'和'max'中。
  47981. * @param {Array.<Object>} points - 顶点数组。
  47982. * @param {Array} min - 最小
  47983. * @param {Array} max - 最大
  47984. */
  47985. ComputeBoundingBox_createClass(ComputeBoundingBox, [{
  47986. key: "computeBoundingBox",
  47987. value: function computeBoundingBox(points, min, max) {
  47988. if (points.length === 0) {
  47989. return;
  47990. }
  47991. var left = points[0][0];
  47992. var right = points[0][0];
  47993. var top = points[0][1];
  47994. var bottom = points[0][1];
  47995. for (var i = 1; i < points.length; i++) {
  47996. var p = points[i];
  47997. if (p[0] < left) {
  47998. left = p[0];
  47999. }
  48000. if (p[0] > right) {
  48001. right = p[0];
  48002. }
  48003. if (p[1] < top) {
  48004. top = p[1];
  48005. }
  48006. if (p[1] > bottom) {
  48007. bottom = p[1];
  48008. }
  48009. }
  48010. min[0] = left;
  48011. min[1] = top;
  48012. max[0] = right;
  48013. max[1] = bottom;
  48014. }
  48015. /**
  48016. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.cubeBezier
  48017. * @description 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入'min'和'max'中。原:computeCubeBezierBoundingBox。
  48018. * @param {Array.<number>} p0 - 三阶贝塞尔曲线p0点
  48019. * @param {Array.<number>} p1 - 三阶贝塞尔曲线p1点
  48020. * @param {Array.<number>} p2 - 三阶贝塞尔曲线p2点
  48021. * @param {Array.<number>} p3 - 三阶贝塞尔曲线p3点
  48022. * @param {Array.<number>} min - 最小
  48023. * @param {Array.<number>} max - 最大
  48024. */
  48025. }, {
  48026. key: "cubeBezier",
  48027. value: function cubeBezier(p0, p1, p2, p3, min, max) {
  48028. var curve = new Curve_Curve();
  48029. var xDim = [];
  48030. curve.cubicExtrema(p0[0], p1[0], p2[0], p3[0], xDim);
  48031. for (var i = 0; i < xDim.length; i++) {
  48032. xDim[i] = curve.cubicAt(p0[0], p1[0], p2[0], p3[0], xDim[i]);
  48033. }
  48034. var yDim = [];
  48035. curve.cubicExtrema(p0[1], p1[1], p2[1], p3[1], yDim);
  48036. for (var _i = 0; _i < yDim.length; _i++) {
  48037. yDim[_i] = curve.cubicAt(p0[1], p1[1], p2[1], p3[1], yDim[_i]);
  48038. }
  48039. xDim.push(p0[0], p3[0]);
  48040. yDim.push(p0[1], p3[1]);
  48041. var left = Math.min.apply(null, xDim);
  48042. var right = Math.max.apply(null, xDim);
  48043. var top = Math.min.apply(null, yDim);
  48044. var bottom = Math.max.apply(null, yDim);
  48045. min[0] = left;
  48046. min[1] = top;
  48047. max[0] = right;
  48048. max[1] = bottom;
  48049. }
  48050. /**
  48051. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.quadraticBezier
  48052. * @description 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入'min'和'max'中。原:computeQuadraticBezierBoundingBox。
  48053. * @param {Array.<number>} p0 - 二阶贝塞尔曲线p0点
  48054. * @param {Array.<number>} p1 - 二阶贝塞尔曲线p1点
  48055. * @param {Array.<number>} p2 - 二阶贝塞尔曲线p2点
  48056. * @param {Array.<number>} min - 最小
  48057. * @param {Array.<number>} max - 最大
  48058. */
  48059. }, {
  48060. key: "quadraticBezier",
  48061. value: function quadraticBezier(p0, p1, p2, min, max) {
  48062. var curve = new Curve_Curve(); // Find extremities, where derivative in x dim or y dim is zero
  48063. var t1 = curve.quadraticExtremum(p0[0], p1[0], p2[0]);
  48064. var t2 = curve.quadraticExtremum(p0[1], p1[1], p2[1]);
  48065. t1 = Math.max(Math.min(t1, 1), 0);
  48066. t2 = Math.max(Math.min(t2, 1), 0);
  48067. var ct1 = 1 - t1;
  48068. var ct2 = 1 - t2;
  48069. var x1 = ct1 * ct1 * p0[0] + 2 * ct1 * t1 * p1[0] + t1 * t1 * p2[0];
  48070. var y1 = ct1 * ct1 * p0[1] + 2 * ct1 * t1 * p1[1] + t1 * t1 * p2[1];
  48071. var x2 = ct2 * ct2 * p0[0] + 2 * ct2 * t2 * p1[0] + t2 * t2 * p2[0];
  48072. var y2 = ct2 * ct2 * p0[1] + 2 * ct2 * t2 * p1[1] + t2 * t2 * p2[1];
  48073. min[0] = Math.min(p0[0], p2[0], x1, x2);
  48074. min[1] = Math.min(p0[1], p2[1], y1, y2);
  48075. max[0] = Math.max(p0[0], p2[0], x1, x2);
  48076. max[1] = Math.max(p0[1], p2[1], y1, y2);
  48077. }
  48078. /**
  48079. * @function SuperMap.LevelRenderer.Tool.ComputeBoundingBox.prototype.arc
  48080. * @description 从圆弧中计算出最小包围盒,写入'min'和'max'中。原:computeArcBoundingBox。
  48081. * @param {number} x - 圆弧中心点 x
  48082. * @param {number} y - 圆弧中心点 y
  48083. * @param {number} r - 圆弧半径
  48084. * @param {number} startAngle - 圆弧开始角度
  48085. * @param {number} endAngle - 圆弧结束角度
  48086. * @param {number} anticlockwise - 是否是顺时针
  48087. * @param {number} min - 最小
  48088. * @param {number} max - 最大
  48089. */
  48090. }, {
  48091. key: "arc",
  48092. value: function arc(x, y, r, startAngle, endAngle, anticlockwise, min, max) {
  48093. var vec2 = new levelRenderer_Vector_Vector();
  48094. var start = vec2.create();
  48095. var end = vec2.create();
  48096. var extremity = vec2.create();
  48097. start[0] = Math.cos(startAngle) * r + x;
  48098. start[1] = Math.sin(startAngle) * r + y;
  48099. end[0] = Math.cos(endAngle) * r + x;
  48100. end[1] = Math.sin(endAngle) * r + y;
  48101. vec2.min(min, start, end);
  48102. vec2.max(max, start, end); // Thresh to [0, Math.PI * 2]
  48103. startAngle = startAngle % (Math.PI * 2);
  48104. if (startAngle < 0) {
  48105. startAngle = startAngle + Math.PI * 2;
  48106. }
  48107. endAngle = endAngle % (Math.PI * 2);
  48108. if (endAngle < 0) {
  48109. endAngle = endAngle + Math.PI * 2;
  48110. }
  48111. if (startAngle > endAngle && !anticlockwise) {
  48112. endAngle += Math.PI * 2;
  48113. } else if (startAngle < endAngle && anticlockwise) {
  48114. startAngle += Math.PI * 2;
  48115. }
  48116. if (anticlockwise) {
  48117. var tmp = endAngle;
  48118. endAngle = startAngle;
  48119. startAngle = tmp;
  48120. } // var number = 0;
  48121. // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
  48122. for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
  48123. if (angle > startAngle) {
  48124. extremity[0] = Math.cos(angle) * r + x;
  48125. extremity[1] = Math.sin(angle) * r + y;
  48126. vec2.min(min, extremity, min);
  48127. vec2.max(max, extremity, max);
  48128. }
  48129. }
  48130. }
  48131. }]);
  48132. return ComputeBoundingBox;
  48133. }();
  48134. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Env.js
  48135. function Env_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48136. 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); } }
  48137. function Env_createClass(Constructor, protoProps, staticProps) { if (protoProps) Env_defineProperties(Constructor.prototype, protoProps); if (staticProps) Env_defineProperties(Constructor, staticProps); return Constructor; }
  48138. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48139. * This program are made available under the terms of the Apache License, Version 2.0
  48140. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48141. /**
  48142. * @class SuperMap.LevelRenderer.Tool.Env
  48143. * @category Visualization Theme
  48144. * @classdesc 环境识别
  48145. * @private
  48146. */
  48147. var Env = /*#__PURE__*/function () {
  48148. function Env() {
  48149. Env_classCallCheck(this, Env);
  48150. // Zepto.js
  48151. // (c) 2010-2013 Thomas Fuchs
  48152. // Zepto.js may be freely distributed under the MIT license.
  48153. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Env";
  48154. var me = this;
  48155. function detect(ua) {
  48156. var os = me.os = {};
  48157. var browser = me.browser = {};
  48158. var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
  48159. var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
  48160. var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
  48161. var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
  48162. var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
  48163. var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
  48164. var touchpad = webos && ua.match(/TouchPad/);
  48165. var kindle = ua.match(/Kindle\/([\d.]+)/);
  48166. var silk = ua.match(/Silk\/([\d._]+)/);
  48167. var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
  48168. var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
  48169. var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
  48170. var playbook = ua.match(/PlayBook/);
  48171. var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
  48172. var firefox = ua.match(/Firefox\/([\d.]+)/);
  48173. var ie = ua.match(/MSIE ([\d.]+)/);
  48174. var safari = webkit && ua.match(/Mobile\//) && !chrome;
  48175. var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome; // Todo: clean this up with a better OS/browser seperation:
  48176. // - discern (more) between multiple browsers on android
  48177. // - decide if kindle fire in silk mode is android or not
  48178. // - Firefox on Android doesn't specify the Android version
  48179. // - possibly devide in os, device and browser hashes
  48180. /*eslint-disable*/
  48181. if (browser.webkit = !!webkit) {
  48182. browser.version = webkit[1];
  48183. }
  48184. if (android) {
  48185. os.android = true;
  48186. os.version = android[2];
  48187. }
  48188. if (iphone && !ipod) {
  48189. os.ios = os.iphone = true;
  48190. os.version = iphone[2].replace(/_/g, '.');
  48191. }
  48192. if (ipad) {
  48193. os.ios = os.ipad = true;
  48194. os.version = ipad[2].replace(/_/g, '.');
  48195. }
  48196. if (ipod) {
  48197. os.ios = os.ipod = true;
  48198. os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
  48199. }
  48200. if (webos) {
  48201. os.webos = true;
  48202. os.version = webos[2];
  48203. }
  48204. if (touchpad) {
  48205. os.touchpad = true;
  48206. }
  48207. if (blackberry) {
  48208. os.blackberry = true;
  48209. os.version = blackberry[2];
  48210. }
  48211. if (bb10) {
  48212. os.bb10 = true;
  48213. os.version = bb10[2];
  48214. }
  48215. if (rimtabletos) {
  48216. os.rimtabletos = true;
  48217. os.version = rimtabletos[2];
  48218. }
  48219. if (playbook) {
  48220. browser.playbook = true;
  48221. }
  48222. if (kindle) {
  48223. os.kindle = true;
  48224. os.version = kindle[1];
  48225. }
  48226. if (silk) {
  48227. browser.silk = true;
  48228. browser.version = silk[1];
  48229. }
  48230. if (!silk && os.android && ua.match(/Kindle Fire/)) {
  48231. browser.silk = true;
  48232. }
  48233. if (chrome) {
  48234. browser.chrome = true;
  48235. browser.version = chrome[1];
  48236. }
  48237. if (firefox) {
  48238. browser.firefox = true;
  48239. browser.version = firefox[1];
  48240. }
  48241. if (ie) {
  48242. browser.ie = true;
  48243. browser.version = ie[1];
  48244. }
  48245. if (safari && (ua.match(/Safari/) || !!os.ios)) {
  48246. browser.safari = true;
  48247. }
  48248. if (webview) {
  48249. browser.webview = true;
  48250. }
  48251. if (ie) {
  48252. browser.ie = true;
  48253. browser.version = ie[1];
  48254. }
  48255. os.tablet = !!(ipad || playbook || android && !ua.match(/Mobile/) || firefox && ua.match(/Tablet/) || ie && !ua.match(/Phone/) && ua.match(/Touch/));
  48256. 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/)));
  48257. return {
  48258. browser: browser,
  48259. os: os,
  48260. // 原生canvas支持
  48261. canvasSupported: document.createElement('canvas').getContext ? true : false
  48262. };
  48263. }
  48264. return detect(navigator.userAgent);
  48265. }
  48266. Env_createClass(Env, [{
  48267. key: "destory",
  48268. value: function destory() {
  48269. return true;
  48270. }
  48271. }]);
  48272. return Env;
  48273. }();
  48274. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Event.js
  48275. function Event_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48276. 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); } }
  48277. function Event_createClass(Constructor, protoProps, staticProps) { if (protoProps) Event_defineProperties(Constructor.prototype, protoProps); if (staticProps) Event_defineProperties(Constructor, staticProps); return Constructor; }
  48278. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48279. * This program are made available under the terms of the Apache License, Version 2.0
  48280. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48281. /**
  48282. * @class SuperMap.LevelRenderer.Tool.Event
  48283. * @category Visualization Theme
  48284. * @classdesc LevelRenderer 工具-事件辅助类
  48285. * @private
  48286. */
  48287. var Event_Event = /*#__PURE__*/function () {
  48288. /**
  48289. * @function SuperMap.LevelRenderer.Tool.Event.prototype.constructor
  48290. * @description 构造函数。
  48291. */
  48292. function Event() {
  48293. Event_classCallCheck(this, Event);
  48294. /**
  48295. * @member {function} SuperMap.LevelRenderer.Tool.Event.prototype.stop
  48296. * @description 停止冒泡和阻止默认行为
  48297. */
  48298. this.stop = typeof window.addEventListener === 'function' ? function (e) {
  48299. e.preventDefault();
  48300. e.stopPropagation();
  48301. e.cancelBubble = true;
  48302. } : function (e) {
  48303. e.returnValue = false;
  48304. e.cancelBubble = true;
  48305. };
  48306. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Event";
  48307. }
  48308. /**
  48309. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getX
  48310. * @description 提取鼠标(手指)x坐标。
  48311. * @param {Event} e - 事件。
  48312. * @returns {number} 鼠标(手指)x坐标。
  48313. */
  48314. Event_createClass(Event, [{
  48315. key: "getX",
  48316. value: function getX(e) {
  48317. 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;
  48318. }
  48319. /**
  48320. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getY
  48321. * @description 提取鼠标(手指)y坐标。
  48322. * @param {Event} e - 事件。
  48323. * @returns {number} 鼠标(手指)y坐标。
  48324. */
  48325. }, {
  48326. key: "getY",
  48327. value: function getY(e) {
  48328. 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;
  48329. }
  48330. /**
  48331. * @function SuperMap.LevelRenderer.Tool.Event.prototype.getDelta
  48332. * @description 提取鼠标滚轮变化。
  48333. * @param {Event} e - 事件。
  48334. * @returns {number} 滚轮变化,正值说明滚轮是向上滚动,如果是负值说明滚轮是向下滚动。
  48335. */
  48336. }, {
  48337. key: "getDelta",
  48338. value: function getDelta(e) {
  48339. return typeof e.zrenderDelta != 'undefined' && e.zrenderDelta || typeof e.wheelDelta != 'undefined' && e.wheelDelta || typeof e.detail != 'undefined' && -e.detail;
  48340. }
  48341. }]);
  48342. return Event;
  48343. }();
  48344. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Http.js
  48345. function Http_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Http_typeof = function _typeof(obj) { return typeof obj; }; } else { Http_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Http_typeof(obj); }
  48346. function Http_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48347. 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); } }
  48348. function Http_createClass(Constructor, protoProps, staticProps) { if (protoProps) Http_defineProperties(Constructor.prototype, protoProps); if (staticProps) Http_defineProperties(Constructor, staticProps); return Constructor; }
  48349. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48350. * This program are made available under the terms of the Apache License, Version 2.0
  48351. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48352. /**
  48353. * @private
  48354. * @class SuperMap.LevelRenderer.Tool.Http
  48355. * @category Visualization Theme
  48356. * @classdesc LevelRenderer 工具-Http
  48357. */
  48358. var Http = /*#__PURE__*/function () {
  48359. /**
  48360. * @function SuperMap.LevelRenderer.Tool.Http.constructor
  48361. * @description 构造函数。
  48362. */
  48363. function Http() {
  48364. Http_classCallCheck(this, Http);
  48365. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Http";
  48366. }
  48367. /**
  48368. * @function SuperMap.LevelRenderer.Tool.Http.prototype.get
  48369. * @description get请求。
  48370. * @param {(string|IHTTPGetOption)} url - 请求url
  48371. * @param {function} onsuccess - 请求成功函数
  48372. * @param {function} onerror - 请求失败函数
  48373. * @param {Object} opts - 额外参数
  48374. * @returns {number} cos值
  48375. */
  48376. Http_createClass(Http, [{
  48377. key: "get",
  48378. value: function get(url, onsuccess, onerror) {
  48379. if (Http_typeof(url) === 'object') {
  48380. var obj = url;
  48381. url = obj.url;
  48382. onsuccess = obj.onsuccess;
  48383. onerror = obj.onerror;
  48384. }
  48385. var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP');
  48386. xhr.open('GET', url, true);
  48387. xhr.onreadystatechange = function () {
  48388. if (xhr.readyState == 4) {
  48389. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
  48390. onsuccess && onsuccess(xhr.responseText);
  48391. } else {
  48392. onerror && onerror();
  48393. }
  48394. xhr.onreadystatechange = new Function();
  48395. xhr = null;
  48396. }
  48397. };
  48398. xhr.send(null);
  48399. }
  48400. }]);
  48401. return Http;
  48402. }();
  48403. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Config.js
  48404. function Config_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48405. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48406. * This program are made available under the terms of the Apache License, Version 2.0
  48407. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48408. var Config = function Config() {
  48409. Config_classCallCheck(this, Config);
  48410. };
  48411. /**
  48412. * @enum EVENT
  48413. * @description 事件
  48414. * @type {Object}
  48415. * @private
  48416. */
  48417. Config.EVENT = {
  48418. //窗口大小变化
  48419. RESIZE: 'resize',
  48420. //鼠标按钮被(手指)按下,事件对象是:目标图形元素或空
  48421. CLICK: 'click',
  48422. //双击事件
  48423. DBLCLICK: 'dblclick',
  48424. //鼠标滚轮变化,事件对象是:目标图形元素或空
  48425. MOUSEWHEEL: 'mousewheel',
  48426. //鼠标(手指)被移动,事件对象是:目标图形元素或空
  48427. MOUSEMOVE: 'mousemove',
  48428. //鼠标移到某图形元素之上,事件对象是:目标图形元素
  48429. MOUSEOVER: 'mouseover',
  48430. //鼠标从某图形元素移开,事件对象是:目标图形元素
  48431. MOUSEOUT: 'mouseout',
  48432. //鼠标按钮(手指)被按下,事件对象是:目标图形元素或空
  48433. MOUSEDOWN: 'mousedown',
  48434. //鼠标按键(手指)被松开,事件对象是:目标图形元素或空
  48435. MOUSEUP: 'mouseup',
  48436. //全局离开,MOUSEOUT触发比较频繁,一次离开优化绑定
  48437. GLOBALOUT: 'globalout',
  48438. // 一次成功元素拖拽的行为事件过程是:
  48439. // dragstart > dragenter > dragover [> dragleave] > drop > dragend
  48440. //开始拖拽时触发,事件对象是:被拖拽图形元素
  48441. DRAGSTART: 'dragstart',
  48442. //拖拽完毕时触发(在drop之后触发),事件对象是:被拖拽图形元素
  48443. DRAGEND: 'dragend',
  48444. //拖拽图形元素进入目标图形元素时触发,事件对象是:目标图形元素
  48445. DRAGENTER: 'dragenter',
  48446. //拖拽图形元素在目标图形元素上移动时触发,事件对象是:目标图形元素
  48447. DRAGOVER: 'dragover',
  48448. //拖拽图形元素离开目标图形元素时触发,事件对象是:目标图形元素
  48449. DRAGLEAVE: 'dragleave',
  48450. //拖拽图形元素放在目标图形元素内时触发,事件对象是:目标图形元素
  48451. DROP: 'drop',
  48452. //touch end - start < delay is click
  48453. touchClickDelay: 300
  48454. };
  48455. /**
  48456. * @enum catchBrushException
  48457. * @description 是否异常捕获
  48458. * @type {boolean}
  48459. * @private
  48460. */
  48461. Config.catchBrushException = false;
  48462. /**
  48463. * @enum debugMode
  48464. * @description debug 日志选项:catchBrushException 为 true 下有效。
  48465. * 0 : 不生成debug数据,发布用
  48466. * 1 : 异常抛出,调试用
  48467. * 2 : 控制台输出,调试用
  48468. * @type {boolean}
  48469. * @private
  48470. */
  48471. Config.debugMode = 0;
  48472. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Log.js
  48473. function Log_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48474. 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); } }
  48475. function Log_createClass(Constructor, protoProps, staticProps) { if (protoProps) Log_defineProperties(Constructor.prototype, protoProps); if (staticProps) Log_defineProperties(Constructor, staticProps); return Constructor; }
  48476. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48477. * This program are made available under the terms of the Apache License, Version 2.0
  48478. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48479. /**
  48480. * @private
  48481. * @class SuperMap.LevelRenderer.Tool.Log
  48482. * @category Visualization Theme
  48483. * @classdesc LevelRenderer 工具-日志
  48484. */
  48485. var Log = /*#__PURE__*/function () {
  48486. /**
  48487. * @function SuperMap.LevelRenderer.Tool.Log.constructor
  48488. * @description 构造函数。
  48489. */
  48490. function Log() {
  48491. Log_classCallCheck(this, Log);
  48492. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Log";
  48493. return function () {
  48494. if (Config.debugMode === 0) {
  48495. return;
  48496. } else if (Config.debugMode == 1) {
  48497. for (var k in arguments) {
  48498. throw new Error(arguments[k]);
  48499. }
  48500. } else if (Config.debugMode > 1) {
  48501. for (var _k in arguments) {
  48502. console.log(arguments[_k]);
  48503. }
  48504. }
  48505. };
  48506. /* for debug
  48507. return function(mes) {
  48508. document.getElementById('wrong-message').innerHTML =
  48509. mes + ' ' + (new Date() - 0)
  48510. + '<br/>'
  48511. + document.getElementById('wrong-message').innerHTML;
  48512. };
  48513. */
  48514. }
  48515. Log_createClass(Log, [{
  48516. key: "destory",
  48517. value: function destory() {
  48518. return true;
  48519. }
  48520. }]);
  48521. return Log;
  48522. }();
  48523. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Math.js
  48524. function Math_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48525. 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); } }
  48526. function Math_createClass(Constructor, protoProps, staticProps) { if (protoProps) Math_defineProperties(Constructor.prototype, protoProps); if (staticProps) Math_defineProperties(Constructor, staticProps); return Constructor; }
  48527. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48528. * This program are made available under the terms of the Apache License, Version 2.0
  48529. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48530. /**
  48531. * @private
  48532. * @class SuperMap.LevelRenderer.Tool.Math
  48533. * @category Visualization Theme
  48534. * @classdesc LevelRenderer 工具-数学辅助类
  48535. */
  48536. var MathTool = /*#__PURE__*/function () {
  48537. /**
  48538. * @function SuperMap.LevelRenderer.Tool.Math.constructor
  48539. * @description 构造函数。
  48540. */
  48541. function MathTool() {
  48542. Math_classCallCheck(this, MathTool);
  48543. /**
  48544. * @member {number} SuperMap.LevelRenderer.Tool.Math._radians
  48545. * @description 角度与弧度转化参数
  48546. */
  48547. this._radians = window.Math.PI / 180;
  48548. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Math";
  48549. }
  48550. /**
  48551. * @function SuperMap.LevelRenderer.Tool.Math.prototype.sin
  48552. * @description 正弦函数。
  48553. * @param {number} angle - 弧度(角度)参数。
  48554. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  48555. * @returns {number} sin 值。
  48556. */
  48557. Math_createClass(MathTool, [{
  48558. key: "sin",
  48559. value: function sin(angle, isDegrees) {
  48560. return window.Math.sin(isDegrees ? angle * this._radians : angle);
  48561. }
  48562. /**
  48563. * @function SuperMap.LevelRenderer.Tool.Math.prototype.cos
  48564. * @description 余弦函数。
  48565. * @param {number} angle - 弧度(角度)参数。
  48566. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  48567. * @returns {number} cos 值。
  48568. */
  48569. }, {
  48570. key: "cos",
  48571. value: function cos(angle, isDegrees) {
  48572. return window.Math.cos(isDegrees ? angle * this._radians : angle);
  48573. }
  48574. /**
  48575. * @function SuperMap.LevelRenderer.Tool.Math.prototype.degreeToRadian
  48576. * @description 角度转弧度。
  48577. * @param {number} angle - 弧度(角度)参数。
  48578. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  48579. * @returns {number} 弧度值。
  48580. */
  48581. }, {
  48582. key: "degreeToRadian",
  48583. value: function degreeToRadian(angle) {
  48584. return angle * this._radians;
  48585. }
  48586. /**
  48587. * @function SuperMap.LevelRenderer.Tool.Math.prototype.radianToDegree
  48588. * @description 弧度转角度。
  48589. * @param {number} angle - 弧度(角度)参数。
  48590. * @param {boolean} [isDegrees=false] - angle参数是否为角度计算,angle为以弧度计量的角度。
  48591. * @returns {number} 角度。
  48592. */
  48593. }, {
  48594. key: "radianToDegree",
  48595. value: function radianToDegree(angle) {
  48596. return angle / this._radians;
  48597. }
  48598. }]);
  48599. return MathTool;
  48600. }();
  48601. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Matrix.js
  48602. function Matrix_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48603. 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); } }
  48604. function Matrix_createClass(Constructor, protoProps, staticProps) { if (protoProps) Matrix_defineProperties(Constructor.prototype, protoProps); if (staticProps) Matrix_defineProperties(Constructor, staticProps); return Constructor; }
  48605. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48606. * This program are made available under the terms of the Apache License, Version 2.0
  48607. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48608. /**
  48609. * @private
  48610. * @class SuperMap.LevelRenderer.Tool.Matrix
  48611. * @category Visualization Theme
  48612. * @classdesc LevelRenderer 工具-3x2矩阵操作类
  48613. */
  48614. var Matrix = /*#__PURE__*/function () {
  48615. /**
  48616. * @function SuperMap.LevelRenderer.Tool.Matrix.constructor
  48617. * @description 构造函数。
  48618. */
  48619. function Matrix() {
  48620. Matrix_classCallCheck(this, Matrix);
  48621. /**
  48622. * @member {Object} SuperMap.LevelRenderer.Tool.Matrix.prototype.ArrayCtor
  48623. * @description 数组类型控制
  48624. */
  48625. this.ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;
  48626. this.CLASS_NAME = "SuperMap.LevelRenderer.Tool.Matrix";
  48627. }
  48628. /**
  48629. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.create
  48630. * @description 创建一个单位矩阵。
  48631. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  48632. */
  48633. Matrix_createClass(Matrix, [{
  48634. key: "create",
  48635. value: function create() {
  48636. var ArrayCtor = this.ArrayCtor;
  48637. var out = new ArrayCtor(6);
  48638. this.identity(out);
  48639. return out;
  48640. }
  48641. /**
  48642. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.identity
  48643. * @description 设置矩阵为单位矩阵。
  48644. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48645. * @returns {(Float32Array|Array.<number>)} 单位矩阵。
  48646. */
  48647. }, {
  48648. key: "identity",
  48649. value: function identity(out) {
  48650. out[0] = 1;
  48651. out[1] = 0;
  48652. out[2] = 0;
  48653. out[3] = 1;
  48654. out[4] = 0;
  48655. out[5] = 0;
  48656. return out;
  48657. }
  48658. /**
  48659. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.copy
  48660. * @description 复制矩阵。
  48661. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48662. * @returns {(Float32Array|Array.<number>)} 克隆矩阵。
  48663. */
  48664. }, {
  48665. key: "copy",
  48666. value: function copy(out, m) {
  48667. out[0] = m[0];
  48668. out[1] = m[1];
  48669. out[2] = m[2];
  48670. out[3] = m[3];
  48671. out[4] = m[4];
  48672. out[5] = m[5];
  48673. return out;
  48674. }
  48675. /**
  48676. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  48677. * @description 矩阵相乘。
  48678. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48679. * @param {(Float32Array|Array.<number>)} m1 - 矩阵m1。
  48680. * @param {(Float32Array|Array.<number>)} m2- 矩阵m2。
  48681. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48682. */
  48683. }, {
  48684. key: "mul",
  48685. value: function mul(out, m1, m2) {
  48686. out[0] = m1[0] * m2[0] + m1[2] * m2[1];
  48687. out[1] = m1[1] * m2[0] + m1[3] * m2[1];
  48688. out[2] = m1[0] * m2[2] + m1[2] * m2[3];
  48689. out[3] = m1[1] * m2[2] + m1[3] * m2[3];
  48690. out[4] = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
  48691. out[5] = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
  48692. return out;
  48693. }
  48694. /**
  48695. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mul
  48696. * @description 平移变换。
  48697. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48698. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  48699. * @param {(Float32Array|Array.<number>)} v- 平移参数。
  48700. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48701. */
  48702. }, {
  48703. key: "translate",
  48704. value: function translate(out, a, v) {
  48705. out[0] = a[0];
  48706. out[1] = a[1];
  48707. out[2] = a[2];
  48708. out[3] = a[3];
  48709. out[4] = a[4] + v[0];
  48710. out[5] = a[5] + v[1];
  48711. return out;
  48712. }
  48713. /**
  48714. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.rotate
  48715. * @description 平移变换。
  48716. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48717. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  48718. * @param {(Float32Array|Array.<number>)} rad - 旋转参数。
  48719. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48720. */
  48721. }, {
  48722. key: "rotate",
  48723. value: function rotate(out, a, rad) {
  48724. var aa = a[0];
  48725. var ac = a[2];
  48726. var atx = a[4];
  48727. var ab = a[1];
  48728. var ad = a[3];
  48729. var aty = a[5];
  48730. var st = Math.sin(rad);
  48731. var ct = Math.cos(rad);
  48732. out[0] = aa * ct + ab * st;
  48733. out[1] = -aa * st + ab * ct;
  48734. out[2] = ac * ct + ad * st;
  48735. out[3] = -ac * st + ct * ad;
  48736. out[4] = ct * atx + st * aty;
  48737. out[5] = ct * aty - st * atx;
  48738. return out;
  48739. }
  48740. /**
  48741. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.scale
  48742. * @description 缩放变换。
  48743. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48744. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  48745. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  48746. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48747. */
  48748. }, {
  48749. key: "scale",
  48750. value: function scale(out, a, v) {
  48751. var vx = v[0];
  48752. var vy = v[1];
  48753. out[0] = a[0] * vx;
  48754. out[1] = a[1] * vy;
  48755. out[2] = a[2] * vx;
  48756. out[3] = a[3] * vy;
  48757. out[4] = a[4] * vx;
  48758. out[5] = a[5] * vy;
  48759. return out;
  48760. }
  48761. /**
  48762. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.invert
  48763. * @description 求逆矩阵。
  48764. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48765. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  48766. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48767. */
  48768. }, {
  48769. key: "invert",
  48770. value: function invert(out, a) {
  48771. var aa = a[0];
  48772. var ac = a[2];
  48773. var atx = a[4];
  48774. var ab = a[1];
  48775. var ad = a[3];
  48776. var aty = a[5];
  48777. var det = aa * ad - ab * ac;
  48778. if (!det) {
  48779. return null;
  48780. }
  48781. det = 1.0 / det;
  48782. out[0] = ad * det;
  48783. out[1] = -ab * det;
  48784. out[2] = -ac * det;
  48785. out[3] = aa * det;
  48786. out[4] = (ac * aty - ad * atx) * det;
  48787. out[5] = (ab * atx - aa * aty) * det;
  48788. return out;
  48789. }
  48790. /**
  48791. * @function SuperMap.LevelRenderer.Tool.Matrix.prototype.mulVector
  48792. * @description 矩阵左乘向量。
  48793. * @param {(Float32Array|Array.<number>)} out - 单位矩阵。
  48794. * @param {(Float32Array|Array.<number>)} a - 矩阵。
  48795. * @param {(Float32Array|Array.<number>)} v - 缩放参数。
  48796. * @returns {(Float32Array|Array.<number>)} 结果矩阵。
  48797. */
  48798. }, {
  48799. key: "mulVector",
  48800. value: function mulVector(out, a, v) {
  48801. var aa = a[0];
  48802. var ac = a[2];
  48803. var atx = a[4];
  48804. var ab = a[1];
  48805. var ad = a[3];
  48806. var aty = a[5];
  48807. out[0] = v[0] * aa + v[1] * ac + atx;
  48808. out[1] = v[0] * ab + v[1] * ad + aty;
  48809. return out;
  48810. }
  48811. }]);
  48812. return Matrix;
  48813. }();
  48814. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SUtil.js
  48815. function SUtil_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  48816. 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); } }
  48817. function SUtil_createClass(Constructor, protoProps, staticProps) { if (protoProps) SUtil_defineProperties(Constructor.prototype, protoProps); if (staticProps) SUtil_defineProperties(Constructor, staticProps); return Constructor; }
  48818. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  48819. * This program are made available under the terms of the Apache License, Version 2.0
  48820. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  48821. var SUtil_SUtil = /*#__PURE__*/function () {
  48822. function SUtil() {
  48823. SUtil_classCallCheck(this, SUtil);
  48824. }
  48825. SUtil_createClass(SUtil, null, [{
  48826. key: "SUtil_smoothBezier",
  48827. /**
  48828. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothBezier
  48829. * @description 贝塞尔平滑曲线。
  48830. * @private
  48831. * @param {Array} points - 线段顶点数组。
  48832. * @param {number} smooth - 平滑等级, 0-1。
  48833. * @param {boolean} isLoop - isLoop。
  48834. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  48835. * @param {Array} [originalPosition=[0, 0]] - 参考原点。
  48836. * @return {Array} 生成的平滑节点数组。
  48837. */
  48838. value: function SUtil_smoothBezier(points, smooth, isLoop, constraint, originalPosition) {
  48839. if (!originalPosition || originalPosition !== 2) {
  48840. originalPosition = [0, 0];
  48841. }
  48842. var __OP = originalPosition;
  48843. var cps = [];
  48844. var v = [];
  48845. var v1 = [];
  48846. var v2 = [];
  48847. var hasConstraint = !!constraint;
  48848. var min, max;
  48849. if (hasConstraint) {
  48850. min = [Infinity, Infinity];
  48851. max = [-Infinity, -Infinity];
  48852. var _len = points.length;
  48853. for (var i = 0; i < _len; i++) {
  48854. SUtil.Util_vector.min(min, min, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  48855. SUtil.Util_vector.max(max, max, [points[i][0] + __OP[0], points[i][1] + __OP[1]]);
  48856. } // 与指定的包围盒做并集
  48857. SUtil.Util_vector.min(min, min, constraint[0]);
  48858. SUtil.Util_vector.max(max, max, constraint[1]);
  48859. }
  48860. var len = points.length;
  48861. for (var _i = 0; _i < len; _i++) {
  48862. var point = [points[_i][0] + __OP[0], points[_i][1] + __OP[1]];
  48863. var prevPoint = void 0;
  48864. var nextPoint = void 0;
  48865. if (isLoop) {
  48866. prevPoint = [points[_i ? _i - 1 : len - 1][0] + __OP[0], points[_i ? _i - 1 : len - 1][1] + __OP[1]];
  48867. nextPoint = [points[(_i + 1) % len][0] + __OP[0], points[(_i + 1) % len][1] + __OP[1]];
  48868. } else {
  48869. if (_i === 0 || _i === len - 1) {
  48870. cps.push([points[_i][0] + __OP[0], points[_i][1] + __OP[1]]);
  48871. continue;
  48872. } else {
  48873. prevPoint = [points[_i - 1][0] + __OP[0], points[_i - 1][1] + __OP[1]];
  48874. nextPoint = [points[_i + 1][0] + __OP[0], points[_i + 1][1] + __OP[1]];
  48875. }
  48876. }
  48877. SUtil.Util_vector.sub(v, nextPoint, prevPoint); // use degree to scale the handle length
  48878. SUtil.Util_vector.scale(v, v, smooth);
  48879. var d0 = SUtil.Util_vector.distance(point, prevPoint);
  48880. var d1 = SUtil.Util_vector.distance(point, nextPoint);
  48881. var sum = d0 + d1;
  48882. if (sum !== 0) {
  48883. d0 /= sum;
  48884. d1 /= sum;
  48885. }
  48886. SUtil.Util_vector.scale(v1, v, -d0);
  48887. SUtil.Util_vector.scale(v2, v, d1);
  48888. var cp0 = SUtil.Util_vector.add([], point, v1);
  48889. var cp1 = SUtil.Util_vector.add([], point, v2);
  48890. if (hasConstraint) {
  48891. SUtil.Util_vector.max(cp0, cp0, min);
  48892. SUtil.Util_vector.min(cp0, cp0, max);
  48893. SUtil.Util_vector.max(cp1, cp1, min);
  48894. SUtil.Util_vector.min(cp1, cp1, max);
  48895. }
  48896. cps.push(cp0);
  48897. cps.push(cp1);
  48898. }
  48899. if (isLoop) {
  48900. cps.push(cps.shift());
  48901. }
  48902. return cps;
  48903. }
  48904. /**
  48905. * @function SuperMap.LevelRenderer.SUtil.SUtil_smoothSpline
  48906. * @description 插值折线。
  48907. * @private
  48908. * @param {Array} points - 线段顶点数组。
  48909. * @param {boolean} isLoop - isLoop。
  48910. * @param {Array} constraint - 将计算出来的控制点约束在一个包围盒内,比如 [[0, 0], [100, 100]], 这个包围盒会与整个折线的包围盒做一个并集用来约束控制点。
  48911. * @param {Array} originalPosition - 参考原点。默认值:[0, 0]。
  48912. * @return {Array} 生成的平滑节点数组。
  48913. */
  48914. }, {
  48915. key: "SUtil_smoothSpline",
  48916. value: function SUtil_smoothSpline(points, isLoop, constraint, originalPosition) {
  48917. if (!originalPosition || originalPosition !== 2) {
  48918. originalPosition = [0, 0];
  48919. }
  48920. var __OP = originalPosition;
  48921. var len = points.length;
  48922. var ret = [];
  48923. var distance = 0;
  48924. for (var i = 1; i < len; i++) {
  48925. 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]]);
  48926. }
  48927. var segs = distance / 5;
  48928. segs = segs < len ? len : segs;
  48929. for (var _i2 = 0; _i2 < segs; _i2++) {
  48930. var pos = _i2 / (segs - 1) * (isLoop ? len : len - 1);
  48931. var idx = Math.floor(pos);
  48932. var w = pos - idx;
  48933. var p0 = void 0;
  48934. var p1 = [points[idx % len][0] + __OP[0], points[idx % len][1] + __OP[1]];
  48935. var p2 = void 0;
  48936. var p3 = void 0;
  48937. if (!isLoop) {
  48938. p0 = [points[idx === 0 ? idx : idx - 1][0] + __OP[0], points[idx === 0 ? idx : idx - 1][1] + __OP[1]];
  48939. p2 = [points[idx > len - 2 ? len - 1 : idx + 1][0] + __OP[0], points[idx > len - 2 ? len - 1 : idx + 1][1] + __OP[1]];
  48940. p3 = [points[idx > len - 3 ? len - 1 : idx + 2][0] + __OP[0], points[idx > len - 3 ? len - 1 : idx + 2][1] + __OP[1]];
  48941. } else {
  48942. p0 = [points[(idx - 1 + len) % len][0] + __OP[0], points[(idx - 1 + len) % len][1] + __OP[1]];
  48943. p2 = [points[(idx + 1) % len][0] + __OP[0], points[(idx + 1) % len][1] + __OP[1]];
  48944. p3 = [points[(idx + 2) % len][0] + __OP[0], points[(idx + 2) % len][1] + __OP[1]];
  48945. }
  48946. var w2 = w * w;
  48947. var w3 = w * w2;
  48948. 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)]);
  48949. }
  48950. return ret; // inner Function
  48951. function interpolate(p0, p1, p2, p3, t, t2, t3) {
  48952. var v0 = (p2 - p0) * 0.5;
  48953. var v1 = (p3 - p1) * 0.5;
  48954. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  48955. }
  48956. }
  48957. /**
  48958. * @function SuperMap.LevelRenderer.SUtil.SUtil_dashedLineTo
  48959. * @description 虚线 lineTo。
  48960. */
  48961. }, {
  48962. key: "SUtil_dashedLineTo",
  48963. value: function SUtil_dashedLineTo(ctx, x1, y1, x2, y2, dashLength, customDashPattern) {
  48964. // http://msdn.microsoft.com/en-us/library/ie/dn265063(v=vs.85).aspx
  48965. var dashPattern = [5, 5];
  48966. dashLength = typeof dashLength != 'number' ? 5 : dashLength;
  48967. if (ctx.setLineDash) {
  48968. dashPattern[0] = dashLength;
  48969. dashPattern[1] = dashLength;
  48970. if (customDashPattern && customDashPattern instanceof Array) {
  48971. ctx.setLineDash(customDashPattern);
  48972. } else {
  48973. ctx.setLineDash(dashPattern);
  48974. } // ctx.setLineDash(dashPattern);
  48975. ctx.moveTo(x1, y1);
  48976. ctx.lineTo(x2, y2);
  48977. return;
  48978. }
  48979. var dx = x2 - x1;
  48980. var dy = y2 - y1;
  48981. var numDashes = Math.floor(Math.sqrt(dx * dx + dy * dy) / dashLength);
  48982. dx = dx / numDashes;
  48983. dy = dy / numDashes;
  48984. var flag = true;
  48985. for (var i = 0; i < numDashes; ++i) {
  48986. if (flag) {
  48987. ctx.moveTo(x1, y1);
  48988. } else {
  48989. ctx.lineTo(x1, y1);
  48990. }
  48991. flag = !flag;
  48992. x1 += dx;
  48993. y1 += dy;
  48994. }
  48995. ctx.lineTo(x2, y2);
  48996. }
  48997. }]);
  48998. return SUtil;
  48999. }(); // 把所有工具对象放到全局静态变量上,以便直接调用工具方法,
  49000. // 避免使用工具时频繁的创建工具对象带来的性能消耗。
  49001. SUtil_SUtil.Util_area = new Area();
  49002. SUtil_SUtil.Util_color = new Color();
  49003. SUtil_SUtil.Util_computeBoundingBox = new ComputeBoundingBox();
  49004. SUtil_SUtil.Util_curve = new Curve_Curve();
  49005. SUtil_SUtil.Util_env = new Env();
  49006. SUtil_SUtil.Util_event = new Event_Event();
  49007. SUtil_SUtil.Util_http = new Http();
  49008. SUtil_SUtil.Util_log = new Log();
  49009. SUtil_SUtil.Util_math = new MathTool();
  49010. SUtil_SUtil.Util_matrix = new Matrix();
  49011. SUtil_SUtil.Util = new Util_Util();
  49012. SUtil_SUtil.Util_vector = new levelRenderer_Vector_Vector();
  49013. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Transformable.js
  49014. function Transformable_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49015. 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); } }
  49016. function Transformable_createClass(Constructor, protoProps, staticProps) { if (protoProps) Transformable_defineProperties(Constructor.prototype, protoProps); if (staticProps) Transformable_defineProperties(Constructor, staticProps); return Constructor; }
  49017. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  49018. * This program are made available under the terms of the Apache License, Version 2.0
  49019. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49020. /**
  49021. * @private
  49022. * @class SuperMap.LevelRenderer.Transformable
  49023. * @category Visualization Theme
  49024. * @classdesc 可变换超类,所有支持 Canvas Transform 变换操作的类均是此类的子类。此类不可实例化。
  49025. */
  49026. var Transformable = /*#__PURE__*/function () {
  49027. /**
  49028. * @function SuperMap.LevelRenderer.Transformable.constructor
  49029. * @description 构造函数。
  49030. */
  49031. function Transformable() {
  49032. Transformable_classCallCheck(this, Transformable);
  49033. /**
  49034. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.position
  49035. * @description 平移, 默认值:[0, 0]。
  49036. */
  49037. this.position = [0, 0];
  49038. /**
  49039. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.rotation
  49040. * @description 旋转,可以通过数组二三项指定旋转的原点, 默认值:[0, 0, 0]。
  49041. */
  49042. this.rotation = [0, 0, 0];
  49043. /**
  49044. * @member {Array.<number>} SuperMap.LevelRenderer.Transformable.prototype.scale
  49045. * @description 缩放,可以通过数组三四项指定缩放的原点, 默认值:[1, 1, 0, 0]。
  49046. */
  49047. this.scale = [1, 1, 0, 0];
  49048. /**
  49049. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needLocalTransform
  49050. * @description 是否变换。默认值:false。
  49051. */
  49052. this.needLocalTransform = false;
  49053. /**
  49054. * @member {boolean} SuperMap.LevelRenderer.Transformable.prototype.needTransform
  49055. * @description 是否有坐标变换。默认值:false。
  49056. */
  49057. this.needTransform = false;
  49058. this.CLASS_NAME = "SuperMap.LevelRenderer.Transformable";
  49059. /**
  49060. * @function SuperMap.LevelRenderer.Transformable.prototype.lookAt
  49061. * @description 设置图形的朝向。
  49062. */
  49063. this.lookAt = function () {
  49064. var v = SUtil_SUtil.Util_vector.create(); // {Array.<Number>|Float32Array} target
  49065. return function (target) {
  49066. if (!this.transform) {
  49067. this.transform = SUtil_SUtil.Util_matrix.create();
  49068. }
  49069. var m = this.transform;
  49070. SUtil_SUtil.Util_vector.sub(v, target, this.position);
  49071. if (isAroundZero(v[0]) && isAroundZero(v[1])) {
  49072. return;
  49073. }
  49074. SUtil_SUtil.Util_vector.normalize(v, v); // Y Axis
  49075. // TODO Scale origin ?
  49076. m[2] = v[0] * this.scale[1];
  49077. m[3] = v[1] * this.scale[1]; // X Axis
  49078. m[0] = v[1] * this.scale[0];
  49079. m[1] = -v[0] * this.scale[0]; // Position
  49080. m[4] = this.position[0];
  49081. m[5] = this.position[1];
  49082. this.decomposeTransform();
  49083. function isAroundZero(val) {
  49084. var EPSILON = 5e-5;
  49085. return val > -EPSILON && val < EPSILON;
  49086. }
  49087. };
  49088. }();
  49089. }
  49090. /**
  49091. * @function SuperMap.LevelRenderer.Transformable.prototype.destroy
  49092. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  49093. */
  49094. Transformable_createClass(Transformable, [{
  49095. key: "destroy",
  49096. value: function destroy() {
  49097. this.position = null;
  49098. this.rotation = null;
  49099. this.scale = null;
  49100. this.needLocalTransform = null;
  49101. this.needTransform = null;
  49102. }
  49103. /**
  49104. * @function SuperMap.LevelRenderer.Transformable.prototype.updateNeedTransform
  49105. * @description 更新 needLocalTransform
  49106. */
  49107. }, {
  49108. key: "updateNeedTransform",
  49109. value: function updateNeedTransform() {
  49110. this.needLocalTransform = isNotAroundZero(this.rotation[0]) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);
  49111. function isNotAroundZero(val) {
  49112. var EPSILON = 5e-5;
  49113. return val > EPSILON || val < -EPSILON;
  49114. }
  49115. }
  49116. /**
  49117. * @function SuperMap.LevelRenderer.Transformable.prototype.updateTransform
  49118. * @description 判断是否需要有坐标变换,更新 needTransform 属性。如果有坐标变换, 则从 position, rotation, scale 以及父节点的 transform 计算出自身的 transform 矩阵
  49119. */
  49120. }, {
  49121. key: "updateTransform",
  49122. value: function updateTransform() {
  49123. this.updateNeedTransform();
  49124. if (this.parent) {
  49125. this.needTransform = this.needLocalTransform || this.parent.needTransform;
  49126. } else {
  49127. this.needTransform = this.needLocalTransform;
  49128. }
  49129. if (!this.needTransform) {
  49130. return;
  49131. }
  49132. var origin = [0, 0];
  49133. var m = this.transform || SUtil_SUtil.Util_matrix.create();
  49134. SUtil_SUtil.Util_matrix.identity(m);
  49135. if (this.needLocalTransform) {
  49136. if (isNotAroundZero(this.scale[0]) || isNotAroundZero(this.scale[1])) {
  49137. origin[0] = -this.scale[2] || 0;
  49138. origin[1] = -this.scale[3] || 0;
  49139. var haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  49140. if (haveOrigin) {
  49141. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  49142. }
  49143. SUtil_SUtil.Util_matrix.scale(m, m, this.scale);
  49144. if (haveOrigin) {
  49145. origin[0] = -origin[0];
  49146. origin[1] = -origin[1];
  49147. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  49148. }
  49149. }
  49150. if (this.rotation instanceof Array) {
  49151. if (this.rotation[0] !== 0) {
  49152. origin[0] = -this.rotation[1] || 0;
  49153. origin[1] = -this.rotation[2] || 0;
  49154. var _haveOrigin = isNotAroundZero(origin[0]) || isNotAroundZero(origin[1]);
  49155. if (_haveOrigin) {
  49156. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  49157. }
  49158. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation[0]);
  49159. if (_haveOrigin) {
  49160. origin[0] = -origin[0];
  49161. origin[1] = -origin[1];
  49162. SUtil_SUtil.Util_matrix.translate(m, m, origin);
  49163. }
  49164. }
  49165. } else {
  49166. if (this.rotation !== 0) {
  49167. SUtil_SUtil.Util_matrix.rotate(m, m, this.rotation);
  49168. }
  49169. }
  49170. if (isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1])) {
  49171. SUtil_SUtil.Util_matrix.translate(m, m, this.position);
  49172. }
  49173. } // 保存这个变换矩阵
  49174. this.transform = m; // 应用父节点变换
  49175. if (this.parent && this.parent.needTransform) {
  49176. if (this.needLocalTransform) {
  49177. SUtil_SUtil.Util_matrix.mul(this.transform, this.parent.transform, this.transform);
  49178. } else {
  49179. SUtil_SUtil.Util_matrix.copy(this.transform, this.parent.transform);
  49180. }
  49181. }
  49182. function isNotAroundZero(val) {
  49183. var EPSILON = 5e-5;
  49184. return val > EPSILON || val < -EPSILON;
  49185. }
  49186. }
  49187. /**
  49188. * @function SuperMap.LevelRenderer.Transformable.prototype.setTransform
  49189. * @description 将自己的 transform 应用到 context 上。
  49190. *
  49191. * @param {Context2D} ctx - Context2D 上下文。
  49192. */
  49193. }, {
  49194. key: "setTransform",
  49195. value: function setTransform(ctx) {
  49196. if (this.needTransform) {
  49197. var m = this.transform;
  49198. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  49199. }
  49200. }
  49201. /**
  49202. * @function SuperMap.LevelRenderer.Transformable.prototype.decomposeTransform
  49203. * @description 分解`transform`矩阵到`position`, `rotation`, `scale` 。
  49204. */
  49205. }, {
  49206. key: "decomposeTransform",
  49207. value: function decomposeTransform() {
  49208. if (!this.transform) {
  49209. return;
  49210. }
  49211. var m = this.transform;
  49212. var sx = m[0] * m[0] + m[1] * m[1];
  49213. var position = this.position;
  49214. var scale = this.scale;
  49215. var rotation = this.rotation;
  49216. if (isNotAroundZero(sx - 1)) {
  49217. sx = Math.sqrt(sx);
  49218. }
  49219. var sy = m[2] * m[2] + m[3] * m[3];
  49220. if (isNotAroundZero(sy - 1)) {
  49221. sy = Math.sqrt(sy);
  49222. }
  49223. position[0] = m[4];
  49224. position[1] = m[5];
  49225. scale[0] = sx;
  49226. scale[1] = sy;
  49227. scale[2] = scale[3] = 0;
  49228. rotation[0] = Math.atan2(-m[1] / sy, m[0] / sx);
  49229. rotation[1] = rotation[2] = 0;
  49230. function isNotAroundZero(val) {
  49231. var EPSILON = 5e-5;
  49232. return val > EPSILON || val < -EPSILON;
  49233. }
  49234. }
  49235. }]);
  49236. return Transformable;
  49237. }();
  49238. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Shape.js
  49239. function Shape_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Shape_typeof = function _typeof(obj) { return typeof obj; }; } else { Shape_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Shape_typeof(obj); }
  49240. function Shape_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  49241. 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); } }
  49242. function Shape_createClass(Constructor, protoProps, staticProps) { if (protoProps) Shape_defineProperties(Constructor.prototype, protoProps); if (staticProps) Shape_defineProperties(Constructor, staticProps); return Constructor; }
  49243. function Shape_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Shape_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Shape_get(target, property, receiver || target); }
  49244. function Shape_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Shape_getPrototypeOf(object); if (object === null) break; } return object; }
  49245. 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 } }); if (superClass) Shape_setPrototypeOf(subClass, superClass); }
  49246. function Shape_setPrototypeOf(o, p) { Shape_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Shape_setPrototypeOf(o, p); }
  49247. 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); }; }
  49248. function Shape_possibleConstructorReturn(self, call) { if (call && (Shape_typeof(call) === "object" || typeof call === "function")) { return call; } return Shape_assertThisInitialized(self); }
  49249. function Shape_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  49250. function Shape_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  49251. function Shape_getPrototypeOf(o) { Shape_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Shape_getPrototypeOf(o); }
  49252. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  49253. * This program are made available under the terms of the Apache License, Version 2.0
  49254. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  49255. /**
  49256. * @private
  49257. * @class SuperMap.LevelRenderer.Shape
  49258. * @category Visualization Theme
  49259. * @classdesc 图形(shape)基类。
  49260. * @extends SuperMap.LevelRenderer.Eventful
  49261. * @extends SuperMap.LevelRenderer.Transformable
  49262. */
  49263. var Shape_Shape = /*#__PURE__*/function (_SuperMap$mixin) {
  49264. Shape_inherits(Shape, _SuperMap$mixin);
  49265. var _super = Shape_createSuper(Shape);
  49266. /**
  49267. * @function SuperMap.LevelRenderer.Shape.constructor
  49268. * @description 构造函数。
  49269. *
  49270. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  49271. *
  49272. */
  49273. function Shape(options) {
  49274. var _this;
  49275. Shape_classCallCheck(this, Shape);
  49276. _this = _super.call(this, options);
  49277. options = options || {};
  49278. /**
  49279. * @member {string} SuperMap.LevelRenderer.Shape.prototype.id
  49280. * @description 唯一标识。
  49281. */
  49282. _this.id = null;
  49283. /**
  49284. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style
  49285. * @description 基础绘制样式。
  49286. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  49287. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  49288. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  49289. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  49290. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  49291. * @param {number} style.opacity - 绘制透明度。默认值:1。
  49292. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  49293. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  49294. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  49295. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  49296. * @param {string} style.text - 图形中的附加文本。默认值:""。
  49297. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  49298. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  49299. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  49300. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  49301. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  49302. *
  49303. */
  49304. _this.style = {};
  49305. /**
  49306. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.style.__rect
  49307. * @description 包围图形的最小矩形盒子。
  49308. *
  49309. * @param {number} x - 左上角顶点x轴坐标。
  49310. * @param {number} y - 左上角顶点y轴坐标。
  49311. * @param {number} width - 包围盒矩形宽度。
  49312. * @param {number} height - 包围盒矩形高度。
  49313. */
  49314. /**
  49315. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.highlightStyle
  49316. * @description 高亮样式。
  49317. *
  49318. * @param {string} highlightStyle.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  49319. * @param {string} highlightStyle.color - 填充颜色。默认值:"#000000'"。
  49320. * @param {string} highlightStyle.strokeColor - 描边颜色。默认值:"#000000'"。
  49321. * @param {string} highlightStyle.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  49322. * @param {number} highlightStyle.lineWidth - 描边宽度。默认值:1。
  49323. * @param {number} highlightStyle.opacity - 绘制透明度。默认值:1。
  49324. * @param {number} highlightStyle.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  49325. * @param {number} highlightStyle.shadowColor - 阴影颜色。默认值:"#000000'"。
  49326. * @param {number} highlightStyle.shadowOffsetX - 阴影横向偏移。默认值:0。
  49327. * @param {number} highlightStyle.shadowOffsetY - 阴影纵向偏移。默认值:0。
  49328. * @param {string} highlightStyle.text - 图形中的附加文本。默认值:""。
  49329. * @param {string} highlightStyle.textColor - 文本颜色。默认值:"#000000'"。
  49330. * @param {string} highlightStyle.textFont - 附加文本样式。示例:'bold 18px verdana'。
  49331. * @param {string} highlightStyle.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  49332. * @param {string} highlightStyle.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  49333. * @param {string} highlightStyle.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  49334. */
  49335. _this.highlightStyle = null;
  49336. /**
  49337. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.parent
  49338. * @description 父节点,只读属性。<SuperMap.LevelRenderer.Group>
  49339. */
  49340. _this.parent = null;
  49341. /**
  49342. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.__dirty
  49343. * @description {boolean}
  49344. */
  49345. _this.__dirty = true;
  49346. /**
  49347. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.__clipShapes
  49348. * @description {Array}
  49349. *
  49350. */
  49351. _this.__clipShapes = [];
  49352. /**
  49353. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.invisible
  49354. * @description 图形是否可见,为 true 时不绘制图形,但是仍能触发鼠标事件。默认值:false。
  49355. */
  49356. _this.invisible = false;
  49357. /**
  49358. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.ignore
  49359. * @description 图形是否忽略,为 true 时忽略图形的绘制以及事件触发。默认值:false。
  49360. */
  49361. _this.ignore = false;
  49362. /**
  49363. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.zlevel
  49364. * @description z 层 level,决定绘画在哪层 canvas 中。默认值:0。
  49365. */
  49366. _this.zlevel = 0;
  49367. /**
  49368. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.draggable
  49369. * @description 是否可拖拽。默认值:false。
  49370. */
  49371. _this.draggable = false;
  49372. /**
  49373. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.clickable
  49374. * @description 是否可点击。默认值:false。
  49375. */
  49376. _this.clickable = false;
  49377. /**
  49378. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.hoverable
  49379. * @description 是否可以 hover。默认值:true。
  49380. */
  49381. _this.hoverable = true;
  49382. /**
  49383. * @member {number} SuperMap.LevelRenderer.Shape.prototype.z
  49384. * @description z值,跟zlevel一样影响shape绘制的前后顺序,z值大的shape会覆盖在z值小的上面,但是并不会创建新的canvas,所以优先级低于zlevel,而且频繁改动的开销比zlevel小很多。默认值:0。
  49385. */
  49386. _this.z = 0; //地理扩展
  49387. /**
  49388. * @member {Array} SuperMap.LevelRenderer.Shape.prototype.refOriginalPosition
  49389. * @description 图形参考原点位置,图形的参考中心位置。
  49390. * refOriginalPosition 是长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  49391. *
  49392. * refOriginalPosition 表示图形的参考中心,通常情况下,图形是使用 canvas 的原点位置作为位置参考,
  49393. * 但 refOriginalPosition 可以改变图形的参考位置,例如: refOriginalPosition = [80, 80],
  49394. * 图形圆的 style.x = 20, style.y = 20,那么圆在 canvas 中的实际位置是 [100, 100]。
  49395. *
  49396. * 图形(Shape) 的所有位置相关属性都是以 refOriginalPosition 为参考中心,
  49397. * 也就是说图形的所有位置信息在 canvas 中都是以 refOriginalPosition 为参考的相对位置,只有
  49398. * refOriginalPosition 的值为 [0, 0] 时,形的位置信息才是 canvas 绝对位置。
  49399. *
  49400. * 图形的位置信息通常有:style.pointList,style.x,style.y。
  49401. *
  49402. * refOriginalPosition。默认值是: [0, 0]。
  49403. */
  49404. _this.refOriginalPosition = [0, 0];
  49405. /**
  49406. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataID
  49407. * @description 图形所关联数据的 ID。
  49408. *
  49409. */
  49410. _this.refDataID = null;
  49411. /**
  49412. * @member {boolean} SuperMap.LevelRenderer.Shape.prototype.isHoverByRefDataID
  49413. * @description 是否根据 refDataID 进行高亮。用于同时高亮所有 refDataID 相同的图形。
  49414. *
  49415. */
  49416. _this.isHoverByRefDataID = false;
  49417. /**
  49418. * @member {string} SuperMap.LevelRenderer.Shape.prototype.refDataHoverGroup
  49419. * @description 高亮图形组的组名。此属性在 refDataID 有效且 isHoverByRefDataID 为 true 时生效。
  49420. * 一旦设置此属性,且属性值有效,只有关联同一个数据的图形且此属性相同的图形才会高亮。
  49421. *
  49422. */
  49423. _this.refDataHoverGroup = null;
  49424. /**
  49425. * @member {Object} SuperMap.LevelRenderer.Shape.prototype.dataInfo
  49426. * @description 图形的数据信息。
  49427. *
  49428. */
  49429. _this.dataInfo = null;
  49430. Util.extend(Shape_assertThisInitialized(_this), options);
  49431. _this.id = _this.id || Util.createUniqueID("smShape_");
  49432. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape";
  49433. /**
  49434. * @function SuperMap.LevelRenderer.Shape.prototype.getTansform
  49435. * @description 变换鼠标位置到 shape 的局部坐标空间
  49436. *
  49437. */
  49438. _this.getTansform = function () {
  49439. var invTransform = [];
  49440. return function (x, y) {
  49441. var originPos = [x, y]; // 对鼠标的坐标也做相同的变换
  49442. if (this.needTransform && this.transform) {
  49443. SUtil_SUtil.Util_matrix.invert(invTransform, this.transform);
  49444. SUtil_SUtil.Util_matrix.mulVector(originPos, invTransform, [x, y, 1]);
  49445. if (x == originPos[0] && y == originPos[1]) {
  49446. // 避免外部修改导致的 needTransform 不准确
  49447. this.updateNeedTransform();
  49448. }
  49449. }
  49450. return originPos;
  49451. };
  49452. }();
  49453. return _this;
  49454. }
  49455. /**
  49456. * @function SuperMap.LevelRenderer.Shape.prototype.destroy
  49457. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  49458. */
  49459. Shape_createClass(Shape, [{
  49460. key: "destroy",
  49461. value: function destroy() {
  49462. this.id = null;
  49463. this.style = null;
  49464. this.highlightStyle = null;
  49465. this.parent = null;
  49466. this.__dirty = null;
  49467. this.__clipShapes = null;
  49468. this.invisible = null;
  49469. this.ignore = null;
  49470. this.zlevel = null;
  49471. this.draggable = null;
  49472. this.clickable = null;
  49473. this.hoverable = null;
  49474. this.z = null;
  49475. this.refOriginalPosition = null;
  49476. this.refDataID = null;
  49477. this.refDataHoverGroup = null;
  49478. this.isHoverByRefDataID = null;
  49479. this.dataInfo = null;
  49480. Shape_get(Shape_getPrototypeOf(Shape.prototype), "destroy", this).call(this);
  49481. }
  49482. /**
  49483. * @function SuperMap.LevelRenderer.Shape.prototype.brush
  49484. * @description 绘制图形。
  49485. *
  49486. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49487. * @param {boolean} isHighlight - 是否使用高亮属性。
  49488. * @param {Function} updateCallback - 需要异步加载资源的 shape 可以通过这个 callback(e),让painter更新视图,base.brush 没用,需要的话重载 brush。
  49489. */
  49490. }, {
  49491. key: "brush",
  49492. value: function brush(ctx, isHighlight) {
  49493. var style = this.beforeBrush(ctx, isHighlight);
  49494. ctx.beginPath();
  49495. this.buildPath(ctx, style);
  49496. switch (style.brushType) {
  49497. /* jshint ignore:start */
  49498. case 'both':
  49499. this.setCtxGlobalAlpha(ctx, "fill", style);
  49500. ctx.fill();
  49501. if (style.lineWidth > 0) {
  49502. this.setCtxGlobalAlpha(ctx, "stroke", style);
  49503. ctx.stroke();
  49504. }
  49505. this.setCtxGlobalAlpha(ctx, "reset", style);
  49506. break;
  49507. case 'stroke':
  49508. this.setCtxGlobalAlpha(ctx, "stroke", style);
  49509. style.lineWidth > 0 && ctx.stroke();
  49510. this.setCtxGlobalAlpha(ctx, "reset", style);
  49511. break;
  49512. /* jshint ignore:end */
  49513. default:
  49514. this.setCtxGlobalAlpha(ctx, "fill", style);
  49515. ctx.fill();
  49516. this.setCtxGlobalAlpha(ctx, "reset", style);
  49517. break;
  49518. }
  49519. this.drawText(ctx, style, this.style);
  49520. this.afterBrush(ctx);
  49521. }
  49522. /**
  49523. * @function SuperMap.LevelRenderer.Shape.prototype.beforeBrush
  49524. * @description 具体绘制操作前的一些公共操作。
  49525. *
  49526. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49527. * @param {boolean} isHighlight - 是否使用高亮属性。
  49528. * @return {Object} 处理后的样式。
  49529. */
  49530. }, {
  49531. key: "beforeBrush",
  49532. value: function beforeBrush(ctx, isHighlight) {
  49533. var style = this.style;
  49534. if (this.brushTypeOnly) {
  49535. style.brushType = this.brushTypeOnly;
  49536. }
  49537. if (isHighlight) {
  49538. // 根据style扩展默认高亮样式
  49539. style = this.getHighlightStyle(style, this.highlightStyle || {}, this.brushTypeOnly);
  49540. }
  49541. if (this.brushTypeOnly == 'stroke') {
  49542. style.strokeColor = style.strokeColor || style.color;
  49543. }
  49544. ctx.save();
  49545. this.doClip(ctx);
  49546. this.setContext(ctx, style); // 设置transform
  49547. this.setTransform(ctx);
  49548. return style;
  49549. }
  49550. /**
  49551. * @function SuperMap.LevelRenderer.Shape.prototype.afterBrush
  49552. * @description 绘制后的处理。
  49553. *
  49554. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49555. *
  49556. */
  49557. }, {
  49558. key: "afterBrush",
  49559. value: function afterBrush(ctx) {
  49560. ctx.restore();
  49561. }
  49562. /**
  49563. * @function SuperMap.LevelRenderer.Shape.prototype.setContext
  49564. * @description 设置 fillStyle, strokeStyle, shadow 等通用绘制样式。
  49565. *
  49566. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49567. * @param {Object} style - 样式。
  49568. *
  49569. */
  49570. }, {
  49571. key: "setContext",
  49572. value: function setContext(ctx, style) {
  49573. 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']];
  49574. for (var i = 0, len = STYLE_CTX_MAP.length; i < len; i++) {
  49575. var styleProp = STYLE_CTX_MAP[i][0];
  49576. var styleValue = style[styleProp];
  49577. var ctxProp = STYLE_CTX_MAP[i][1];
  49578. if (typeof styleValue != 'undefined') {
  49579. ctx[ctxProp] = styleValue;
  49580. }
  49581. }
  49582. }
  49583. /**
  49584. * @function SuperMap.LevelRenderer.Shape.prototype.doClip
  49585. *
  49586. */
  49587. }, {
  49588. key: "doClip",
  49589. value: function doClip(ctx) {
  49590. var clipShapeInvTransform = SUtil_SUtil.Util_matrix.create();
  49591. if (this.__clipShapes) {
  49592. for (var i = 0; i < this.__clipShapes.length; i++) {
  49593. var clipShape = this.__clipShapes[i];
  49594. if (clipShape.needTransform) {
  49595. var m = clipShape.transform;
  49596. SUtil_SUtil.Util_matrix.invert(clipShapeInvTransform, m);
  49597. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  49598. }
  49599. ctx.beginPath();
  49600. clipShape.buildPath(ctx, clipShape.style);
  49601. ctx.clip(); // Transform back
  49602. if (clipShape.needTransform) {
  49603. var _m = clipShapeInvTransform;
  49604. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  49605. }
  49606. }
  49607. }
  49608. }
  49609. /**
  49610. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightStyle
  49611. * @description 根据默认样式扩展高亮样式
  49612. *
  49613. * @param {Object} style - 样式。
  49614. * @param {Object} highlightStyle - 高亮样式。
  49615. * @param {string} brushTypeOnly - brushTypeOnly。
  49616. *
  49617. */
  49618. }, {
  49619. key: "getHighlightStyle",
  49620. value: function getHighlightStyle(style, highlightStyle, brushTypeOnly) {
  49621. var newStyle = {};
  49622. for (var k in style) {
  49623. newStyle[k] = style[k];
  49624. }
  49625. var highlightColor = SUtil_SUtil.Util_color.getHighlightColor(); // 根据highlightStyle扩展
  49626. if (style.brushType != 'stroke') {
  49627. // 带填充则用高亮色加粗边线
  49628. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  49629. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  49630. // newStyle.lineWidth = (style.lineWidth || 1)
  49631. // + this.getHighlightZoom();
  49632. // 修改代码1
  49633. // if(!style.lineType || style.lineType === "solid"){
  49634. // newStyle.lineWidth = (style.lineWidth || 1)
  49635. // + this.getHighlightZoom();
  49636. // }
  49637. // else{
  49638. // newStyle.lineWidth = (style.lineWidth || 1);
  49639. // }
  49640. // SMIC-方法修改 - end
  49641. newStyle.brushType = 'both';
  49642. } else {
  49643. if (brushTypeOnly != 'stroke') {
  49644. // 描边型的则用原色加工高亮
  49645. newStyle.strokeColor = highlightColor; // SMIC-方法修改 - start
  49646. newStyle.lineWidth = style.lineWidth || 1; // 原始代码
  49647. // newStyle.lineWidth = (style.lineWidth || 1)
  49648. // + this.getHighlightZoom();
  49649. // 修改代码1
  49650. // if(!style.lineType || style.lineType === "solid"){
  49651. // newStyle.lineWidth = (style.lineWidth || 1)
  49652. // + this.getHighlightZoom();
  49653. // }
  49654. // else{
  49655. // newStyle.lineWidth = (style.lineWidth || 1);
  49656. // }
  49657. // SMIC-方法修改 - end
  49658. } else {
  49659. // 线型的则用原色加工高亮
  49660. newStyle.strokeColor = highlightStyle.strokeColor || SUtil_SUtil.Util_color.mix(style.strokeColor, SUtil_SUtil.Util_color.toRGB(highlightColor));
  49661. }
  49662. } // 可自定义覆盖默认值
  49663. for (var _k in highlightStyle) {
  49664. if (typeof highlightStyle[_k] != 'undefined') {
  49665. newStyle[_k] = highlightStyle[_k];
  49666. }
  49667. }
  49668. return newStyle;
  49669. }
  49670. /**
  49671. * @function SuperMap.LevelRenderer.Shape.prototype.getHighlightZoom
  49672. * @description 高亮放大效果参数,当前统一设置为6,如有需要差异设置,通过 this.type 判断实例类型
  49673. *
  49674. */
  49675. }, {
  49676. key: "getHighlightZoom",
  49677. value: function getHighlightZoom() {
  49678. return this.type != 'text' ? 6 : 2;
  49679. }
  49680. /**
  49681. * @function SuperMap.LevelRenderer.Shape.prototype.drift
  49682. * @description 移动位置
  49683. *
  49684. * @param {Object} dx - 横坐标变化。
  49685. * @param {Object} dy - 纵坐标变化。
  49686. *
  49687. */
  49688. }, {
  49689. key: "drift",
  49690. value: function drift(dx, dy) {
  49691. this.position[0] += dx;
  49692. this.position[1] += dy;
  49693. }
  49694. /**
  49695. * @function SuperMap.LevelRenderer.Shape.prototype.buildPath
  49696. * @description 构建绘制的Path。子类必须重新实现此方法。
  49697. *
  49698. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49699. * @param {Object} style - 样式。
  49700. */
  49701. }, {
  49702. key: "buildPath",
  49703. value: function buildPath(ctx, style) {
  49704. // eslint-disable-line no-unused-vars
  49705. SUtil_SUtil.Util_log('buildPath not implemented in ' + this.type);
  49706. }
  49707. /**
  49708. * @function SuperMap.LevelRenderer.Shape.prototype.getRect
  49709. * @description 计算返回包围盒矩形。子类必须重新实现此方法。
  49710. *
  49711. * @param {Object} style - 样式。
  49712. */
  49713. }, {
  49714. key: "getRect",
  49715. value: function getRect(style) {
  49716. // eslint-disable-line no-unused-vars
  49717. SUtil_SUtil.Util_log('getRect not implemented in ' + this.type);
  49718. }
  49719. /**
  49720. * @function SuperMap.LevelRenderer.Shape.prototype.isCover
  49721. * @description 判断鼠标位置是否在图形内。
  49722. *
  49723. * @param {number} x - x。
  49724. * @param {number} y - y。
  49725. */
  49726. }, {
  49727. key: "isCover",
  49728. value: function isCover(x, y) {
  49729. var originPos = this.getTansform(x, y);
  49730. x = originPos[0];
  49731. y = originPos[1]; // 快速预判并保留判断矩形
  49732. var rect = this.style.__rect;
  49733. if (!rect) {
  49734. rect = this.style.__rect = this.getRect(this.style);
  49735. }
  49736. if (x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height) {
  49737. // 矩形内
  49738. return SUtil_SUtil.Util_area.isInside(this, this.style, x, y);
  49739. }
  49740. return false;
  49741. }
  49742. /**
  49743. * @function SuperMap.LevelRenderer.Shape.prototype.drawText
  49744. * @description 绘制附加文本。
  49745. *
  49746. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  49747. * @param {string} style - 样式。
  49748. * @param {string} normalStyle - normalStyle 默认样式,用于定位文字显示。
  49749. */
  49750. }, {
  49751. key: "drawText",
  49752. value: function drawText(ctx, style, normalStyle) {
  49753. if (typeof style.text == 'undefined' || style.text === false) {
  49754. return;
  49755. } // 字体颜色策略
  49756. var textColor = style.textColor || style.color || style.strokeColor;
  49757. ctx.fillStyle = textColor; // 文本与图形间空白间隙
  49758. var dd = 10;
  49759. var al; // 文本水平对齐
  49760. var bl; // 文本垂直对齐
  49761. var tx; // 文本横坐标
  49762. var ty; // 文本纵坐标
  49763. var textPosition = style.textPosition // 用户定义
  49764. || this.textPosition // shape默认
  49765. || 'top'; // 全局默认
  49766. // Smic 方法修改 -start
  49767. var __OP = [];
  49768. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  49769. __OP = [0, 0];
  49770. } else {
  49771. __OP = this.refOriginalPosition;
  49772. } //原代码:
  49773. // Smic 方法修改 -end
  49774. switch (textPosition) {
  49775. case 'inside':
  49776. case 'top':
  49777. case 'bottom':
  49778. case 'left':
  49779. case 'right':
  49780. if (this.getRect) {
  49781. var rect = (normalStyle || style).__rect || this.getRect(normalStyle || style);
  49782. switch (textPosition) {
  49783. case 'inside':
  49784. tx = rect.x + rect.width / 2;
  49785. ty = rect.y + rect.height / 2;
  49786. al = 'center';
  49787. bl = 'middle';
  49788. if (style.brushType != 'stroke' && textColor == style.color) {
  49789. ctx.fillStyle = '#fff';
  49790. }
  49791. break;
  49792. case 'left':
  49793. tx = rect.x - dd;
  49794. ty = rect.y + rect.height / 2;
  49795. al = 'end';
  49796. bl = 'middle';
  49797. break;
  49798. case 'right':
  49799. tx = rect.x + rect.width + dd;
  49800. ty = rect.y + rect.height / 2;
  49801. al = 'start';
  49802. bl = 'middle';
  49803. break;
  49804. case 'top':
  49805. tx = rect.x + rect.width / 2;
  49806. ty = rect.y - dd;
  49807. al = 'center';
  49808. bl = 'bottom';
  49809. break;
  49810. case 'bottom':
  49811. tx = rect.x + rect.width / 2;
  49812. ty = rect.y + rect.height + dd;
  49813. al = 'center';
  49814. bl = 'top';
  49815. break;
  49816. }
  49817. }
  49818. break;
  49819. case 'start':
  49820. case 'end':
  49821. var xStart = 0;
  49822. var xEnd = 0;
  49823. var yStart = 0;
  49824. var yEnd = 0;
  49825. if (typeof style.pointList != 'undefined') {
  49826. var pointList = style.pointList;
  49827. if (pointList.length < 2) {
  49828. // 少于2个点就不画了~
  49829. return;
  49830. }
  49831. var length = pointList.length;
  49832. switch (textPosition) {
  49833. // Smic 方法修改 -start
  49834. case 'start':
  49835. xStart = pointList[0][0] + __OP[0];
  49836. xEnd = pointList[1][0] + __OP[0];
  49837. yStart = pointList[0][1] + __OP[1];
  49838. yEnd = pointList[1][1] + __OP[1];
  49839. break;
  49840. case 'end':
  49841. xStart = pointList[length - 2][0] + __OP[0];
  49842. xEnd = pointList[length - 1][0] + __OP[0];
  49843. yStart = pointList[length - 2][1] + __OP[1];
  49844. yEnd = pointList[length - 1][1] + __OP[1];
  49845. break;
  49846. //原代码:
  49847. /*
  49848. case 'start':
  49849. xStart = pointList[0][0];
  49850. xEnd = pointList[1][0];
  49851. yStart = pointList[0][1];
  49852. yEnd = pointList[1][1];
  49853. break;
  49854. case 'end':
  49855. xStart = pointList[length - 2][0];
  49856. xEnd = pointList[length - 1][0];
  49857. yStart = pointList[length - 2][1];
  49858. yEnd = pointList[length - 1][1];
  49859. break;
  49860. */
  49861. // Smic 方法修改 -end
  49862. }
  49863. } else {
  49864. // Smic 方法修改 -start
  49865. xStart = style.xStart + __OP[0] || 0;
  49866. xEnd = style.xEnd + __OP[0] || 0;
  49867. yStart = style.yStart + __OP[1] || 0;
  49868. yEnd = style.yEnd + __OP[1] || 0; //原代码:
  49869. /*
  49870. xStart = style.xStart || 0;
  49871. xEnd = style.xEnd || 0;
  49872. yStart = style.yStart || 0;
  49873. yEnd = style.yEnd || 0;
  49874. */
  49875. // Smic 方法修改 -end
  49876. }
  49877. switch (textPosition) {
  49878. case 'start':
  49879. al = xStart < xEnd ? 'end' : 'start';
  49880. bl = yStart < yEnd ? 'bottom' : 'top';
  49881. tx = xStart;
  49882. ty = yStart;
  49883. break;
  49884. case 'end':
  49885. al = xStart < xEnd ? 'start' : 'end';
  49886. bl = yStart < yEnd ? 'top' : 'bottom';
  49887. tx = xEnd;
  49888. ty = yEnd;
  49889. break;
  49890. }
  49891. dd -= 4;
  49892. if (xStart && xEnd && xStart != xEnd) {
  49893. tx -= al == 'end' ? dd : -dd;
  49894. } else {
  49895. al = 'center';
  49896. }
  49897. if (yStart != yEnd) {
  49898. ty -= bl == 'bottom' ? dd : -dd;
  49899. } else {
  49900. bl = 'middle';
  49901. }
  49902. break;
  49903. case 'specific':
  49904. tx = style.textX || 0;
  49905. ty = style.textY || 0;
  49906. al = 'start';
  49907. bl = 'middle';
  49908. break;
  49909. } // Smic 方法修改 -start
  49910. if (style.labelXOffset && !isNaN(style.labelXOffset)) {
  49911. tx += style.labelXOffset;
  49912. }
  49913. if (style.labelYOffset && !isNaN(style.labelYOffset)) {
  49914. ty += style.labelYOffset;
  49915. } //原代码:
  49916. // Smic 方法修改 -end
  49917. if (tx != null && ty != null) {
  49918. Shape._fillText(ctx, style.text, tx, ty, style.textFont, style.textAlign || al, style.textBaseline || bl);
  49919. }
  49920. }
  49921. /**
  49922. * @function SuperMap.LevelRenderer.Shape.prototype.modSelf
  49923. * @description 图形发生改变
  49924. */
  49925. }, {
  49926. key: "modSelf",
  49927. value: function modSelf() {
  49928. this.__dirty = true;
  49929. if (this.style) {
  49930. this.style.__rect = null;
  49931. }
  49932. if (this.highlightStyle) {
  49933. this.highlightStyle.__rect = null;
  49934. }
  49935. }
  49936. /**
  49937. * @function SuperMap.LevelRenderer.Shape.prototype.isSilent
  49938. * @description 图形是否会触发事件,通过 bind 绑定的事件
  49939. */
  49940. }, {
  49941. key: "isSilent",
  49942. value: function isSilent() {
  49943. 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);
  49944. }
  49945. /**
  49946. * @function SuperMap.LevelRenderer.Shape.prototype.setCtxGlobalAlpha
  49947. * @description 设置 Cavans 上下文全局透明度
  49948. *
  49949. * @param {Object} _ctx - Cavans 上下文
  49950. * @param {string} type - one of 'stroke', 'fill', or 'reset'
  49951. * @param {Object} style - Symbolizer hash
  49952. */
  49953. }, {
  49954. key: "setCtxGlobalAlpha",
  49955. value: function setCtxGlobalAlpha(_ctx, type, style) {
  49956. if (type === "fill") {
  49957. _ctx.globalAlpha = typeof style["fillOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['fillOpacity'];
  49958. } else if (type === "stroke") {
  49959. _ctx.globalAlpha = typeof style["strokeOpacity"] === "undefined" ? typeof style["opacity"] === "undefined" ? 1 : style['opacity'] : style['strokeOpacity'];
  49960. } else {
  49961. _ctx.globalAlpha = typeof style["opacity"] === "undefined" ? 1 : style['opacity'];
  49962. }
  49963. }
  49964. /**
  49965. * @function SuperMap.LevelRenderer.Shape.prototype._fillText
  49966. * @description 填充文本
  49967. */
  49968. }], [{
  49969. key: "_fillText",
  49970. value: function _fillText(ctx, text, x, y, textFont, textAlign, textBaseline) {
  49971. if (textFont) {
  49972. ctx.font = textFont;
  49973. }
  49974. ctx.textAlign = textAlign;
  49975. ctx.textBaseline = textBaseline;
  49976. var rect = Shape._getTextRect(text, x, y, textFont, textAlign, textBaseline);
  49977. text = (text + '').split('\n');
  49978. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  49979. switch (textBaseline) {
  49980. case 'top':
  49981. y = rect.y;
  49982. break;
  49983. case 'bottom':
  49984. y = rect.y + lineHeight;
  49985. break;
  49986. default:
  49987. y = rect.y + lineHeight / 2;
  49988. }
  49989. for (var i = 0, l = text.length; i < l; i++) {
  49990. ctx.fillText(text[i], x, y);
  49991. y += lineHeight;
  49992. }
  49993. }
  49994. /**
  49995. * @function SuperMap.LevelRenderer.Shape._getTextRect
  49996. * @description 返回矩形区域,用于局部刷新和文字定位
  49997. *
  49998. * @param {string} text - text。
  49999. * @param {number} x - x。
  50000. * @param {number} y - y。
  50001. * @param {string} textFont - textFont。
  50002. * @param {string} textAlign - textAlign。
  50003. * @param {string} textBaseline - textBaseline。
  50004. * @return {Object} 矩形区域。
  50005. */
  50006. }, {
  50007. key: "_getTextRect",
  50008. value: function _getTextRect(text, x, y, textFont, textAlign, textBaseline) {
  50009. var width = SUtil_SUtil.Util_area.getTextWidth(text, textFont);
  50010. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', textFont);
  50011. text = (text + '').split('\n');
  50012. switch (textAlign) {
  50013. case 'end':
  50014. case 'right':
  50015. x -= width;
  50016. break;
  50017. case 'center':
  50018. x -= width / 2;
  50019. break;
  50020. }
  50021. switch (textBaseline) {
  50022. case 'top':
  50023. break;
  50024. case 'bottom':
  50025. y -= lineHeight * text.length;
  50026. break;
  50027. default:
  50028. y -= lineHeight * text.length / 2;
  50029. }
  50030. return {
  50031. x: x,
  50032. y: y,
  50033. width: width,
  50034. height: lineHeight * text.length
  50035. };
  50036. }
  50037. }]);
  50038. return Shape;
  50039. }(SuperMap.mixin(Eventful, Transformable));
  50040. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPoint.js
  50041. function SmicPoint_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicPoint_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicPoint_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicPoint_typeof(obj); }
  50042. function SmicPoint_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50043. 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); } }
  50044. function SmicPoint_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPoint_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPoint_defineProperties(Constructor, staticProps); return Constructor; }
  50045. function SmicPoint_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPoint_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicPoint_get(target, property, receiver || target); }
  50046. function SmicPoint_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPoint_getPrototypeOf(object); if (object === null) break; } return object; }
  50047. 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 } }); if (superClass) SmicPoint_setPrototypeOf(subClass, superClass); }
  50048. function SmicPoint_setPrototypeOf(o, p) { SmicPoint_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPoint_setPrototypeOf(o, p); }
  50049. 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); }; }
  50050. function SmicPoint_possibleConstructorReturn(self, call) { if (call && (SmicPoint_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPoint_assertThisInitialized(self); }
  50051. function SmicPoint_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50052. function SmicPoint_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  50053. function SmicPoint_getPrototypeOf(o) { SmicPoint_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPoint_getPrototypeOf(o); }
  50054. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50055. * This program are made available under the terms of the Apache License, Version 2.0
  50056. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50057. /**
  50058. * @private
  50059. * @class SuperMap.LevelRenderer.Shape.SmicPoint
  50060. * @category Visualization Theme
  50061. * @classdesc 点。
  50062. * @extends SuperMap.LevelRenderer.Shape
  50063. * @example
  50064. * var shape = new SuperMap.LevelRenderer.Shape.SmicPoint({
  50065. * style: {
  50066. * x: 100,
  50067. * y: 100,
  50068. * r: 40,
  50069. * brushType: 'both',
  50070. * color: 'blue',
  50071. * strokeColor: 'red',
  50072. * lineWidth: 3,
  50073. * text: 'point'
  50074. * }
  50075. * });
  50076. * levelRenderer.addShape(shape);
  50077. *
  50078. *
  50079. */
  50080. var SmicPoint = /*#__PURE__*/function (_Shape) {
  50081. SmicPoint_inherits(SmicPoint, _Shape);
  50082. var _super = SmicPoint_createSuper(SmicPoint);
  50083. /**
  50084. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.style
  50085. * @description 绘制样式。
  50086. *
  50087. * @param {number} style.x - 圆心x坐标,必设参数。
  50088. * @param {number} style.y - 圆心y坐标,必设参数。
  50089. * @param {number} style.r - 半径,必设参数。
  50090. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50091. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  50092. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  50093. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  50094. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  50095. * @param {number} style.opacity - 绘制透明度。默认值:1。
  50096. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50097. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  50098. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  50099. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50100. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50101. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  50102. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50103. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  50104. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50105. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50106. */
  50107. //打开接口 style
  50108. /**
  50109. * @function SuperMap.LevelRenderer.Shape.SmicPoint.constructor
  50110. * @description 构造函数。
  50111. *
  50112. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50113. *
  50114. */
  50115. function SmicPoint(options) {
  50116. var _this;
  50117. SmicPoint_classCallCheck(this, SmicPoint);
  50118. _this = _super.call(this, options);
  50119. /**
  50120. * @member {string} SuperMap.LevelRenderer.Shape.SmicPoint.prototype.type
  50121. * @description 图形类型。
  50122. */
  50123. _this.type = 'smicpoint';
  50124. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  50125. _this.refOriginalPosition = [0, 0];
  50126. }
  50127. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPoint";
  50128. return _this;
  50129. }
  50130. /**
  50131. * @function cdestroy
  50132. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50133. */
  50134. SmicPoint_createClass(SmicPoint, [{
  50135. key: "destroy",
  50136. value: function destroy() {
  50137. this.type = null;
  50138. SmicPoint_get(SmicPoint_getPrototypeOf(SmicPoint.prototype), "destroy", this).call(this);
  50139. }
  50140. /**
  50141. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.buildPath
  50142. * @description 创建点触。
  50143. *
  50144. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50145. * @param {Object} style - style。
  50146. *
  50147. */
  50148. }, {
  50149. key: "buildPath",
  50150. value: function buildPath(ctx, style) {
  50151. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50152. this.refOriginalPosition = [0, 0];
  50153. }
  50154. var __OP = this.refOriginalPosition;
  50155. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, true);
  50156. return;
  50157. }
  50158. /**
  50159. * @function SuperMap.LevelRenderer.Shape.SmicPoint.prototype.getRect
  50160. * @description 计算返回点的包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  50161. *
  50162. * @param {Object} style - style
  50163. * @return {Object} 边框对象。包含属性:x,y,width,height。
  50164. */
  50165. }, {
  50166. key: "getRect",
  50167. value: function getRect(style) {
  50168. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50169. this.refOriginalPosition = [0, 0];
  50170. }
  50171. var __OP = this.refOriginalPosition;
  50172. if (style.__rect) {
  50173. return style.__rect;
  50174. }
  50175. var lineWidth;
  50176. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  50177. lineWidth = style.lineWidth || 1;
  50178. } else {
  50179. lineWidth = 0;
  50180. }
  50181. style.__rect = {
  50182. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  50183. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  50184. width: style.r * 2 + lineWidth,
  50185. height: style.r * 2 + lineWidth
  50186. };
  50187. return style.__rect;
  50188. }
  50189. }]);
  50190. return SmicPoint;
  50191. }(Shape_Shape);
  50192. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicText.js
  50193. function SmicText_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicText_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicText_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicText_typeof(obj); }
  50194. function SmicText_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50195. 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); } }
  50196. function SmicText_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicText_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicText_defineProperties(Constructor, staticProps); return Constructor; }
  50197. function SmicText_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicText_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicText_get(target, property, receiver || target); }
  50198. function SmicText_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicText_getPrototypeOf(object); if (object === null) break; } return object; }
  50199. 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 } }); if (superClass) SmicText_setPrototypeOf(subClass, superClass); }
  50200. function SmicText_setPrototypeOf(o, p) { SmicText_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicText_setPrototypeOf(o, p); }
  50201. 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); }; }
  50202. function SmicText_possibleConstructorReturn(self, call) { if (call && (SmicText_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicText_assertThisInitialized(self); }
  50203. function SmicText_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50204. function SmicText_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  50205. function SmicText_getPrototypeOf(o) { SmicText_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicText_getPrototypeOf(o); }
  50206. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50207. * This program are made available under the terms of the Apache License, Version 2.0
  50208. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50209. /**
  50210. * @private
  50211. * @class SuperMap.LevelRenderer.Shape.SmicText
  50212. * @category Visualization Theme
  50213. * @extends {SuperMap.LevelRenderer.Shape}
  50214. * @example
  50215. * var shape = new SuperMap.LevelRenderer.Shape.SmicText({
  50216. * style: {
  50217. * text: 'Label',
  50218. * x: 100,
  50219. * y: 100,
  50220. * textFont: '14px Arial'
  50221. * }
  50222. * });
  50223. * levelRenderer.addShape(shape);
  50224. *
  50225. */
  50226. var SmicText = /*#__PURE__*/function (_Shape) {
  50227. SmicText_inherits(SmicText, _Shape);
  50228. var _super = SmicText_createSuper(SmicText);
  50229. /**
  50230. * @member {Object} SuperMap.LevelRenderer.Shape.SmicText.prototype.style
  50231. * @description 绘制样式。
  50232. *
  50233. * @param {number} style.x - 横坐标,必设参数。
  50234. * @param {number} style.y - 纵坐标,必设参数。
  50235. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50236. * @param {number} style.maxWidth - 最大宽度限制。默认值:null。
  50237. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50238. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50239. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50240. * @param {string} style.brushType -画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50241. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  50242. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  50243. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  50244. * @param {number} style.opacity - 绘制透明度。默认值:1。
  50245. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50246. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  50247. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  50248. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50249. */
  50250. //打开接口 style
  50251. /**
  50252. * @function SuperMap.LevelRenderer.Shape.SmicText.constructor
  50253. * @description 构造函数。
  50254. *
  50255. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50256. *
  50257. */
  50258. function SmicText(options) {
  50259. var _this;
  50260. SmicText_classCallCheck(this, SmicText);
  50261. _this = _super.call(this, options);
  50262. /**
  50263. * @member {string} SuperMap.LevelRenderer.Shape.SmicText.prototype.type
  50264. * @description 图形类型.
  50265. */
  50266. _this.type = 'smictext';
  50267. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  50268. _this.refOriginalPosition = [0, 0];
  50269. }
  50270. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicText";
  50271. return _this;
  50272. }
  50273. /**
  50274. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.destroy
  50275. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50276. */
  50277. SmicText_createClass(SmicText, [{
  50278. key: "destroy",
  50279. value: function destroy() {
  50280. this.type = null;
  50281. SmicText_get(SmicText_getPrototypeOf(SmicText.prototype), "destroy", this).call(this);
  50282. }
  50283. /**
  50284. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.brush
  50285. * @description 笔触。
  50286. *
  50287. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50288. * @param {boolean} isHighlight - 是否使用高亮属性。
  50289. *
  50290. */
  50291. }, {
  50292. key: "brush",
  50293. value: function brush(ctx, isHighlight) {
  50294. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50295. this.refOriginalPosition = [0, 0];
  50296. }
  50297. var __OP = this.refOriginalPosition;
  50298. var style = this.style;
  50299. if (isHighlight) {
  50300. // 根据style扩展默认高亮样式
  50301. style = this.getHighlightStyle(style, this.highlightStyle || {});
  50302. }
  50303. if (typeof style.text == 'undefined' || style.text === false) {
  50304. return;
  50305. }
  50306. ctx.save();
  50307. this.doClip(ctx);
  50308. this.setContext(ctx, style); // 设置transform
  50309. this.setTransform(ctx);
  50310. if (style.textFont) {
  50311. ctx.font = style.textFont;
  50312. }
  50313. ctx.textAlign = style.textAlign || 'start';
  50314. ctx.textBaseline = style.textBaseline || 'middle';
  50315. var text = (style.text + '').split('\n');
  50316. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  50317. var rect = this.getRectNoRotation(style); // var x = style.x;
  50318. var x = style.x + __OP[0];
  50319. var y;
  50320. if (style.textBaseline == 'top') {
  50321. y = rect.y;
  50322. } else if (style.textBaseline == 'bottom') {
  50323. y = rect.y + lineHeight;
  50324. } else {
  50325. y = rect.y + lineHeight / 2;
  50326. }
  50327. var ox = style.x + __OP[0];
  50328. var oy = style.y + __OP[1]; //文本绘制
  50329. for (var i = 0, l = text.length; i < l; i++) {
  50330. //是否渲染矩形背景及颜色
  50331. if (style.labelRect) {
  50332. //+4,-2是为了让文字距边框左右边缘有点间隔
  50333. ctx.fillRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  50334. ctx.fillStyle = style.strokeColor;
  50335. ctx.strokeRect(rect.x - 2, rect.y, rect.width + 4, rect.height);
  50336. ctx.fillStyle = style.textColor;
  50337. }
  50338. switch (style.brushType) {
  50339. case 'stroke':
  50340. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50341. if (style.textRotation && style.textRotation !== 0) {
  50342. ctx.save();
  50343. ctx.translate(ox, oy);
  50344. ctx.rotate(style.textRotation * Math.PI / 180);
  50345. if (style.textBaseline == 'top') {
  50346. if (style.maxWidth) {
  50347. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  50348. } else {
  50349. ctx.strokeText(text[i], 0, lineHeight * i);
  50350. }
  50351. } else if (style.textBaseline == 'bottom') {
  50352. if (style.maxWidth) {
  50353. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  50354. } else {
  50355. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  50356. }
  50357. } else {
  50358. if (style.maxWidth) {
  50359. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  50360. } else {
  50361. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  50362. }
  50363. }
  50364. ctx.restore();
  50365. } else {
  50366. if (style.maxWidth) {
  50367. ctx.strokeText(text[i], x, y, style.maxWidth);
  50368. } else {
  50369. ctx.strokeText(text[i], x, y);
  50370. }
  50371. }
  50372. this.setCtxGlobalAlpha(ctx, "reset", style);
  50373. break;
  50374. case 'both':
  50375. if (style.textRotation && style.textRotation !== 0) {
  50376. ctx.save();
  50377. ctx.translate(ox, oy);
  50378. ctx.rotate(style.textRotation * Math.PI / 180);
  50379. if (style.textBaseline == 'top') {
  50380. if (style.maxWidth) {
  50381. this.setCtxGlobalAlpha(ctx, "fill", style);
  50382. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  50383. this.setCtxGlobalAlpha(ctx, "reset", style);
  50384. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50385. ctx.strokeText(text[i], 0, lineHeight * i, style.maxWidth);
  50386. this.setCtxGlobalAlpha(ctx, "reset", style);
  50387. } else {
  50388. this.setCtxGlobalAlpha(ctx, "fill", style);
  50389. ctx.fillText(text[i], 0, lineHeight * i);
  50390. this.setCtxGlobalAlpha(ctx, "reset", style);
  50391. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50392. ctx.strokeText(text[i], 0, lineHeight * i);
  50393. this.setCtxGlobalAlpha(ctx, "reset", style);
  50394. }
  50395. } else if (style.textBaseline == 'bottom') {
  50396. if (style.maxWidth) {
  50397. this.setCtxGlobalAlpha(ctx, "fill", style);
  50398. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  50399. this.setCtxGlobalAlpha(ctx, "reset", style);
  50400. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50401. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  50402. this.setCtxGlobalAlpha(ctx, "reset", style);
  50403. } else {
  50404. this.setCtxGlobalAlpha(ctx, "fill", style);
  50405. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  50406. this.setCtxGlobalAlpha(ctx, "reset", style);
  50407. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50408. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height);
  50409. this.setCtxGlobalAlpha(ctx, "reset", style);
  50410. }
  50411. } else {
  50412. if (style.maxWidth) {
  50413. this.setCtxGlobalAlpha(ctx, "fill", style);
  50414. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  50415. this.setCtxGlobalAlpha(ctx, "reset", style);
  50416. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50417. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  50418. this.setCtxGlobalAlpha(ctx, "reset", style);
  50419. } else {
  50420. this.setCtxGlobalAlpha(ctx, "fill", style);
  50421. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  50422. this.setCtxGlobalAlpha(ctx, "reset", style);
  50423. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50424. ctx.strokeText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  50425. this.setCtxGlobalAlpha(ctx, "reset", style);
  50426. }
  50427. }
  50428. ctx.restore();
  50429. } else {
  50430. if (style.maxWidth) {
  50431. this.setCtxGlobalAlpha(ctx, "fill", style);
  50432. ctx.fillText(text[i], x, y, style.maxWidth);
  50433. this.setCtxGlobalAlpha(ctx, "reset", style);
  50434. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50435. ctx.strokeText(text[i], x, y, style.maxWidth);
  50436. this.setCtxGlobalAlpha(ctx, "reset", style);
  50437. } else {
  50438. this.setCtxGlobalAlpha(ctx, "fill", style);
  50439. ctx.fillText(text[i], x, y);
  50440. this.setCtxGlobalAlpha(ctx, "reset", style);
  50441. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50442. ctx.strokeText(text[i], x, y);
  50443. this.setCtxGlobalAlpha(ctx, "reset", style);
  50444. }
  50445. }
  50446. break;
  50447. default:
  50448. //fill or others
  50449. this.setCtxGlobalAlpha(ctx, "fill", style);
  50450. if (style.textRotation && style.textRotation !== 0) {
  50451. ctx.save();
  50452. ctx.translate(ox, oy);
  50453. ctx.rotate(style.textRotation * Math.PI / 180);
  50454. if (style.textBaseline == 'top') {
  50455. if (style.maxWidth) {
  50456. ctx.fillText(text[i], 0, lineHeight * i, style.maxWidth);
  50457. } else {
  50458. ctx.fillText(text[i], 0, lineHeight * i);
  50459. }
  50460. } else if (style.textBaseline == 'bottom') {
  50461. if (style.maxWidth) {
  50462. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height, style.maxWidth);
  50463. } else {
  50464. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height);
  50465. }
  50466. } else {
  50467. if (style.maxWidth) {
  50468. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2, style.maxWidth);
  50469. } else {
  50470. ctx.fillText(text[i], 0, lineHeight * (i + 1) - rect.height / 2 - lineHeight / 2);
  50471. }
  50472. }
  50473. ctx.restore();
  50474. } else {
  50475. if (style.maxWidth) {
  50476. ctx.fillText(text[i], x, y, style.maxWidth);
  50477. } else {
  50478. ctx.fillText(text[i], x, y);
  50479. }
  50480. }
  50481. this.setCtxGlobalAlpha(ctx, "reset", style);
  50482. }
  50483. y += lineHeight;
  50484. }
  50485. ctx.restore();
  50486. return;
  50487. }
  50488. /**
  50489. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRect
  50490. * @description 返回文字包围盒矩形
  50491. */
  50492. }, {
  50493. key: "getRect",
  50494. value: function getRect(style) {
  50495. if (style.__rect) {
  50496. return style.__rect;
  50497. }
  50498. var left, top, right, bottom;
  50499. var tbg = this.getTextBackground(style, true);
  50500. for (var i = 0, len = tbg.length; i < len; i++) {
  50501. var poi = tbg[i]; //用第一个点初始化
  50502. if (i == 0) {
  50503. left = poi[0];
  50504. right = poi[0];
  50505. top = poi[1];
  50506. bottom = poi[1];
  50507. } else {
  50508. if (poi[0] < left) {
  50509. left = poi[0];
  50510. }
  50511. if (poi[0] > right) {
  50512. right = poi[0];
  50513. }
  50514. if (poi[1] < top) {
  50515. top = poi[1];
  50516. }
  50517. if (poi[1] > bottom) {
  50518. bottom = poi[1];
  50519. }
  50520. }
  50521. }
  50522. style.__rect = {
  50523. x: left,
  50524. y: top,
  50525. width: right - left,
  50526. height: bottom - top
  50527. };
  50528. return style.__rect;
  50529. }
  50530. /**
  50531. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRectNoRotation
  50532. * @description 返回忽略旋转和maxWidth时文字包围盒矩形
  50533. */
  50534. }, {
  50535. key: "getRectNoRotation",
  50536. value: function getRectNoRotation(style) {
  50537. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50538. this.refOriginalPosition = [0, 0];
  50539. }
  50540. var __OP = this.refOriginalPosition;
  50541. var lineHeight = SUtil_SUtil.Util_area.getTextHeight('ZH', style.textFont);
  50542. var width = SUtil_SUtil.Util_area.getTextWidth(style.text, style.textFont);
  50543. var height = SUtil_SUtil.Util_area.getTextHeight(style.text, style.textFont); //处理文字位置,注:文本的绘制是由此 rect 决定
  50544. var textX = style.x + __OP[0]; // 默认start == left
  50545. if (style.textAlign == 'end' || style.textAlign == 'right') {
  50546. textX -= width;
  50547. } else if (style.textAlign == 'center') {
  50548. textX -= width / 2;
  50549. }
  50550. var textY;
  50551. if (style.textBaseline == 'top') {
  50552. // textY = style.y;
  50553. textY = style.y + __OP[1];
  50554. } else if (style.textBaseline == 'bottom') {
  50555. textY = style.y + __OP[1] - height;
  50556. } else {
  50557. // middle
  50558. textY = style.y + __OP[1] - height / 2;
  50559. }
  50560. var isWidthChangeByMaxWidth = false;
  50561. var widthBeforeChangeByMaxWidth; //处理 maxWidth
  50562. if (style.maxWidth) {
  50563. var maxWidth = parseInt(style.maxWidth);
  50564. if (maxWidth < width) {
  50565. widthBeforeChangeByMaxWidth = width;
  50566. isWidthChangeByMaxWidth = true;
  50567. width = maxWidth;
  50568. }
  50569. textX = style.x + __OP[0];
  50570. if (style.textAlign == 'end' || style.textAlign == 'right') {
  50571. textX -= width;
  50572. } else if (style.textAlign == 'center') {
  50573. textX -= width / 2;
  50574. }
  50575. } //处理斜体字
  50576. if (style.textFont) {
  50577. var textFont = style.textFont;
  50578. var textFontStr = textFont.toLowerCase();
  50579. if (textFontStr.indexOf("italic") > -1) {
  50580. if (isWidthChangeByMaxWidth === true) {
  50581. width += lineHeight / 3 * (width / widthBeforeChangeByMaxWidth);
  50582. } else {
  50583. width += lineHeight / 3;
  50584. }
  50585. }
  50586. }
  50587. var rect = {
  50588. x: textX,
  50589. y: textY,
  50590. width: width,
  50591. height: height
  50592. };
  50593. return rect;
  50594. }
  50595. /**
  50596. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getTextBackground
  50597. * @description 获取文本背景框范围
  50598. *
  50599. * @param {Object} style - 样式。
  50600. * @param {boolean} redo - 是否强制重新计算 textBackground。
  50601. */
  50602. }, {
  50603. key: "getTextBackground",
  50604. value: function getTextBackground(style, redo) {
  50605. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50606. this.refOriginalPosition = [0, 0];
  50607. }
  50608. var __OP = this.refOriginalPosition;
  50609. if (!redo && style.__textBackground) {
  50610. return style.__textBackground;
  50611. } //不旋转时矩形框
  50612. var rect = this.getRectNoRotation(style); //旋转中心点
  50613. var ox = style.x + __OP[0];
  50614. var oy = style.y + __OP[1]; //背景框
  50615. var background = [];
  50616. if (style.textRotation && style.textRotation !== 0) {
  50617. var textRotation = style.textRotation;
  50618. var ltPoi = this.getRotatedLocation(rect.x, rect.y, ox, oy, textRotation);
  50619. var rtPoi = this.getRotatedLocation(rect.x + rect.width, rect.y, ox, oy, textRotation);
  50620. var rbPoi = this.getRotatedLocation(rect.x + rect.width, rect.y + rect.height, ox, oy, textRotation);
  50621. var lbPoi = this.getRotatedLocation(rect.x, rect.y + rect.height, ox, oy, textRotation);
  50622. background.push(ltPoi);
  50623. background.push(rtPoi);
  50624. background.push(rbPoi);
  50625. background.push(lbPoi);
  50626. } else {
  50627. var _ltPoi = [rect.x, rect.y];
  50628. var _rtPoi = [rect.x + rect.width, rect.y];
  50629. var _rbPoi = [rect.x + rect.width, rect.y + rect.height];
  50630. var _lbPoi = [rect.x, rect.y + rect.height];
  50631. background.push(_ltPoi);
  50632. background.push(_rtPoi);
  50633. background.push(_rbPoi);
  50634. background.push(_lbPoi);
  50635. }
  50636. style.__textBackground = background;
  50637. return style.__textBackground;
  50638. }
  50639. /**
  50640. * @function SuperMap.LevelRenderer.Shape.SmicText.prototype.getRotatedLocation
  50641. * @description 获取一个点绕旋转中心顺时针旋转后的位置。(此方法用于屏幕坐标)
  50642. *
  50643. * @param {number} x - 旋转点横坐标。
  50644. * @param {number} y - 旋转点纵坐标。
  50645. * @param {number} rx - 旋转中心点横坐标。
  50646. * @param {number} ry - 旋转中心点纵坐标。
  50647. * @param {number} angle - 旋转角度(度)。
  50648. * @return {Array} 旋转后的坐标位置,长度为 2 的一维数组,数组第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  50649. */
  50650. }, {
  50651. key: "getRotatedLocation",
  50652. value: function getRotatedLocation(x, y, rx, ry, angle) {
  50653. var loc = new Array(),
  50654. x0,
  50655. y0;
  50656. y = -y;
  50657. ry = -ry;
  50658. angle = -angle; //顺时针旋转
  50659. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  50660. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  50661. loc[0] = x0;
  50662. loc[1] = -y0;
  50663. return loc;
  50664. }
  50665. }]);
  50666. return SmicText;
  50667. }(Shape_Shape);
  50668. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicCircle.js
  50669. function SmicCircle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicCircle_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicCircle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicCircle_typeof(obj); }
  50670. function SmicCircle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50671. 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); } }
  50672. function SmicCircle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicCircle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicCircle_defineProperties(Constructor, staticProps); return Constructor; }
  50673. function SmicCircle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicCircle_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicCircle_get(target, property, receiver || target); }
  50674. function SmicCircle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicCircle_getPrototypeOf(object); if (object === null) break; } return object; }
  50675. 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 } }); if (superClass) SmicCircle_setPrototypeOf(subClass, superClass); }
  50676. function SmicCircle_setPrototypeOf(o, p) { SmicCircle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicCircle_setPrototypeOf(o, p); }
  50677. 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); }; }
  50678. function SmicCircle_possibleConstructorReturn(self, call) { if (call && (SmicCircle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicCircle_assertThisInitialized(self); }
  50679. function SmicCircle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50680. function SmicCircle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  50681. function SmicCircle_getPrototypeOf(o) { SmicCircle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicCircle_getPrototypeOf(o); }
  50682. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50683. * This program are made available under the terms of the Apache License, Version 2.0
  50684. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50685. /**
  50686. * @private
  50687. * @class SuperMap.LevelRenderer.Shape.SmicCircle
  50688. * @category Visualization Theme
  50689. * @classdesc 圆形
  50690. * @extends SuperMap.LevelRenderer.Shape
  50691. * @example
  50692. * var shape = new SuperMap.LevelRenderer.Shape.SmicCircle({
  50693. * style: {
  50694. * x: 100,
  50695. * y: 100,
  50696. * r: 60,
  50697. * brushType: "both",
  50698. * color: "blue",
  50699. * strokeColor: "red",
  50700. * lineWidth: 3,
  50701. * text: "Circle"
  50702. * }
  50703. * });
  50704. * levelRenderer.addShape(shape);
  50705. *
  50706. *
  50707. */
  50708. var SmicCircle = /*#__PURE__*/function (_Shape) {
  50709. SmicCircle_inherits(SmicCircle, _Shape);
  50710. var _super = SmicCircle_createSuper(SmicCircle);
  50711. /**
  50712. * @member {Object} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.style
  50713. * @description 绘制样式。
  50714. *
  50715. * @param {number} x - 圆心x坐标,必设参数
  50716. * @param {number} y - 圆心y坐标,必设参数
  50717. * @param {number} r - 半径,必设参数
  50718. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50719. * @param {string} color - 填充颜色,默认值"#000000"
  50720. * @param {string} strokeColor - 描边颜色,默认值为'#000000'
  50721. * @param {string} lineCape — 线帽样式,可以是 butt, round, square,默认是butt
  50722. * @param {number} lineWidth - 描边宽度、默认是1
  50723. * @param {number} opacity - 绘制透明度、默认是1,不透明
  50724. * @param {number} shadowBlur - 阴影模糊度,大于0有效,默认是0
  50725. * @param {string} shadowColor - 阴影颜色,默认是'#000000'
  50726. * @param {number} shadowOffsetX - 阴影横向偏移,默认是0
  50727. * @param {number} shadowOffsetY - 阴影纵向偏移,默认是0
  50728. * @param {string} text - 图形中的附加文本,默认是0
  50729. * @param {string} textColor - 文本颜色,默认是'#000000'
  50730. * @param {string} textFont - 附加文本样式,eg:'bold 18px verdana'
  50731. * @param {string} textPosition - 附加文本位置, 可以是 inside, left, right, top, bottom
  50732. * @param {string} textAlign - 默认根据textPosition自动设置,附加文本水平对齐。可以是start, end, left, right, center
  50733. * @param {string} textBaseline 默认根据textPosition自动设置,附加文本垂直对齐。可以是top, bottom, middle, alphabetic, hanging, ideographic
  50734. */
  50735. //打开接口 style
  50736. /**
  50737. * @function SuperMap.LevelRenderer.Shape.SmicCircle.constructor
  50738. * @description 构造函数。
  50739. *
  50740. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50741. *
  50742. */
  50743. function SmicCircle(options) {
  50744. var _this;
  50745. SmicCircle_classCallCheck(this, SmicCircle);
  50746. _this = _super.call(this, options);
  50747. /**
  50748. * @member {string} SuperMap.LevelRenderer.Shape.SmicCircle.prototype.type
  50749. * @description 图形类型。
  50750. */
  50751. _this.type = 'smiccircle';
  50752. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  50753. _this.refOriginalPosition = [0, 0];
  50754. }
  50755. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicCircle";
  50756. return _this;
  50757. }
  50758. /**
  50759. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.destroy
  50760. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50761. */
  50762. SmicCircle_createClass(SmicCircle, [{
  50763. key: "destroy",
  50764. value: function destroy() {
  50765. this.type = null;
  50766. SmicCircle_get(SmicCircle_getPrototypeOf(SmicCircle.prototype), "destroy", this).call(this);
  50767. }
  50768. /**
  50769. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.buildPath
  50770. * @description 创建图形路径。
  50771. *
  50772. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50773. * @param {Object} style - style。
  50774. *
  50775. */
  50776. }, {
  50777. key: "buildPath",
  50778. value: function buildPath(ctx, style) {
  50779. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50780. this.refOriginalPosition = [0, 0];
  50781. }
  50782. var __OP = this.refOriginalPosition;
  50783. var x = style.x + __OP[0]; // 圆心x
  50784. var y = style.y + __OP[1]; // 圆心y
  50785. ctx.moveTo(x + style.r, y);
  50786. ctx.arc(x, y, style.r, 0, Math.PI * 2, true);
  50787. return true;
  50788. }
  50789. /**
  50790. * @function SuperMap.LevelRenderer.Shape.SmicCircle.prototype.getRect
  50791. * @description 返回圆形包围盒矩形
  50792. *
  50793. * @param {Object} style - style
  50794. * @return {Object} 边框对象。包含属性:x,y,width,height。
  50795. *
  50796. */
  50797. }, {
  50798. key: "getRect",
  50799. value: function getRect(style) {
  50800. if (style.__rect) {
  50801. return style.__rect;
  50802. }
  50803. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50804. this.refOriginalPosition = [0, 0];
  50805. }
  50806. var __OP = this.refOriginalPosition;
  50807. var x = style.x + __OP[0]; // 圆心x
  50808. var y = style.y + __OP[1]; // 圆心y
  50809. var r = style.r; // 圆r
  50810. var lineWidth;
  50811. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  50812. lineWidth = style.lineWidth || 1;
  50813. } else {
  50814. lineWidth = 0;
  50815. }
  50816. style.__rect = {
  50817. x: Math.round(x - r - lineWidth / 2),
  50818. y: Math.round(y - r - lineWidth / 2),
  50819. width: r * 2 + lineWidth,
  50820. height: r * 2 + lineWidth
  50821. };
  50822. return style.__rect;
  50823. }
  50824. }]);
  50825. return SmicCircle;
  50826. }(Shape_Shape);
  50827. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicPolygon.js
  50828. function SmicPolygon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicPolygon_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicPolygon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicPolygon_typeof(obj); }
  50829. function SmicPolygon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  50830. 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); } }
  50831. function SmicPolygon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicPolygon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicPolygon_defineProperties(Constructor, staticProps); return Constructor; }
  50832. function SmicPolygon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicPolygon_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicPolygon_get(target, property, receiver || target); }
  50833. function SmicPolygon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicPolygon_getPrototypeOf(object); if (object === null) break; } return object; }
  50834. 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 } }); if (superClass) SmicPolygon_setPrototypeOf(subClass, superClass); }
  50835. function SmicPolygon_setPrototypeOf(o, p) { SmicPolygon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicPolygon_setPrototypeOf(o, p); }
  50836. 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); }; }
  50837. function SmicPolygon_possibleConstructorReturn(self, call) { if (call && (SmicPolygon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicPolygon_assertThisInitialized(self); }
  50838. function SmicPolygon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  50839. function SmicPolygon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  50840. function SmicPolygon_getPrototypeOf(o) { SmicPolygon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicPolygon_getPrototypeOf(o); }
  50841. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  50842. * This program are made available under the terms of the Apache License, Version 2.0
  50843. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  50844. /**
  50845. * @private
  50846. * @class SuperMap.LevelRenderer.Shape.SmicPolygon
  50847. * @category Visualization Theme
  50848. * @classdesc 多边形。
  50849. * @extends SuperMap.LevelRenderer.Shape
  50850. * @example
  50851. * var shape = new SuperMap.LevelRenderer.Shape.SmicPolygon({
  50852. * style: {
  50853. * // 100x100 的正方形
  50854. * pointList: [[0, 0], [100, 0], [100, 100], [0, 100]],
  50855. * color: 'blue'
  50856. * }
  50857. * });
  50858. * levelRenderer.addShape(shape);
  50859. *
  50860. */
  50861. var SmicPolygon = /*#__PURE__*/function (_Shape) {
  50862. SmicPolygon_inherits(SmicPolygon, _Shape);
  50863. var _super = SmicPolygon_createSuper(SmicPolygon);
  50864. /**
  50865. * @member {Object} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.style
  50866. * @description 绘制样式。
  50867. *
  50868. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  50869. * (code)
  50870. * (start code)
  50871. * [
  50872. * [10, 20], //单个节点
  50873. * [30, 40],
  50874. * [25, 30]
  50875. * ]
  50876. * (end)
  50877. * @param {string} style.smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  50878. * @param {number} style.smoothConstraint - 平滑约束。
  50879. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  50880. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  50881. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  50882. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  50883. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  50884. * @param {number} style.opacity - 绘制透明度。默认值:1。
  50885. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  50886. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  50887. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  50888. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  50889. * @param {string} style.text - 图形中的附加文本。默认值:""。
  50890. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  50891. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  50892. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  50893. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  50894. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  50895. */
  50896. //打开接口 style
  50897. /**
  50898. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.constructor
  50899. * @description 构造函数。
  50900. *
  50901. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  50902. *
  50903. */
  50904. function SmicPolygon(options) {
  50905. var _this;
  50906. SmicPolygon_classCallCheck(this, SmicPolygon);
  50907. _this = _super.call(this, options);
  50908. /**
  50909. * @member {string} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.type
  50910. * @description 图形类型.
  50911. */
  50912. _this.type = 'smicpolygon';
  50913. /**
  50914. * @member {Array} SuperMap.LevelRenderer.Shape.SmicPolygon.prototype._holePolygonPointList
  50915. * @description 岛洞面多边形顶点数组(三维数组)
  50916. *
  50917. */
  50918. _this.holePolygonPointLists = null;
  50919. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  50920. _this.refOriginalPosition = [0, 0];
  50921. }
  50922. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicPolygon";
  50923. return _this;
  50924. }
  50925. /**
  50926. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.destroy
  50927. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  50928. */
  50929. SmicPolygon_createClass(SmicPolygon, [{
  50930. key: "destroy",
  50931. value: function destroy() {
  50932. this.type = null;
  50933. this.holePolygonPointLists = null;
  50934. SmicPolygon_get(SmicPolygon_getPrototypeOf(SmicPolygon.prototype), "destroy", this).call(this);
  50935. }
  50936. /**
  50937. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.brush
  50938. * @description 笔触。
  50939. *
  50940. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  50941. * @param {boolean} isHighlight - 是否使用高亮属性。
  50942. *
  50943. */
  50944. }, {
  50945. key: "brush",
  50946. value: function brush(ctx, isHighlight) {
  50947. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  50948. this.refOriginalPosition = [0, 0];
  50949. }
  50950. var style = this.style;
  50951. if (isHighlight) {
  50952. // 根据style扩展默认高亮样式
  50953. style = this.getHighlightStyle(style, this.highlightStyle || {});
  50954. }
  50955. ctx.save();
  50956. this.setContext(ctx, style); // 设置 transform
  50957. this.setTransform(ctx); // 先 fill 再stroke
  50958. var hasPath = false;
  50959. if (style.brushType == 'fill' || style.brushType == 'both' || typeof style.brushType == 'undefined') {
  50960. // 默认为fill
  50961. ctx.beginPath();
  50962. if (style.lineType == 'dashed' || style.lineType == 'dotted' || style.lineType == 'dot' || style.lineType == 'dash' || style.lineType == 'dashdot' || style.lineType == 'longdash' || style.lineType == 'longdashdot') {
  50963. // 特殊处理,虚线围不成path,实线再build一次
  50964. this.buildPath(ctx, {
  50965. lineType: 'solid',
  50966. lineWidth: style.lineWidth,
  50967. pointList: style.pointList
  50968. });
  50969. } else {
  50970. this.buildPath(ctx, style);
  50971. hasPath = true; // 这个path能用
  50972. }
  50973. ctx.closePath();
  50974. this.setCtxGlobalAlpha(ctx, "fill", style);
  50975. ctx.fill();
  50976. this.setCtxGlobalAlpha(ctx, "reset", style);
  50977. }
  50978. if (style.lineWidth > 0 && (style.brushType == 'stroke' || style.brushType == 'both')) {
  50979. if (!hasPath) {
  50980. ctx.beginPath();
  50981. this.buildPath(ctx, style);
  50982. }
  50983. this.setCtxGlobalAlpha(ctx, "stroke", style);
  50984. ctx.stroke();
  50985. this.setCtxGlobalAlpha(ctx, "reset", style);
  50986. }
  50987. this.drawText(ctx, style, this.style); //岛洞
  50988. var hpStyle = Util.cloneObject(style);
  50989. if (hpStyle.pointList) {
  50990. if (this.holePolygonPointLists && this.holePolygonPointLists.length > 0) {
  50991. var holePLS = this.holePolygonPointLists;
  50992. var holePLSen = holePLS.length;
  50993. for (var i = 0; i < holePLSen; i++) {
  50994. var holePL = holePLS[i]; //岛洞面
  50995. hpStyle.pointList = holePL;
  50996. ctx.globalCompositeOperation = "destination-out"; // 先 fill 再stroke
  50997. hasPath = false;
  50998. if (hpStyle.brushType == 'fill' || hpStyle.brushType == 'both' || typeof hpStyle.brushType == 'undefined') {
  50999. // 默认为fill
  51000. ctx.beginPath();
  51001. if (hpStyle.lineType == 'dashed' || hpStyle.lineType == 'dotted' || hpStyle.lineType == 'dot' || hpStyle.lineType == 'dash' || hpStyle.lineType == 'dashdot' || hpStyle.lineType == 'longdash' || hpStyle.lineType == 'longdashdot') {
  51002. // 特殊处理,虚线围不成path,实线再build一次
  51003. this.buildPath(ctx, {
  51004. lineType: 'solid',
  51005. lineWidth: hpStyle.lineWidth,
  51006. pointList: hpStyle.pointList
  51007. });
  51008. } else {
  51009. this.buildPath(ctx, hpStyle);
  51010. hasPath = true; // 这个path能用
  51011. }
  51012. ctx.closePath();
  51013. this.setCtxGlobalAlpha(ctx, "fill", hpStyle);
  51014. ctx.fill();
  51015. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  51016. }
  51017. if (hpStyle.lineWidth > 0 && (hpStyle.brushType == 'stroke' || hpStyle.brushType == 'both')) {
  51018. if (!hasPath) {
  51019. ctx.beginPath();
  51020. this.buildPath(ctx, hpStyle);
  51021. } //如果描边,先回复 globalCompositeOperation 默认值再描边。
  51022. ctx.globalCompositeOperation = "source-over";
  51023. this.setCtxGlobalAlpha(ctx, "stroke", hpStyle);
  51024. ctx.stroke();
  51025. this.setCtxGlobalAlpha(ctx, "reset", hpStyle);
  51026. } else {
  51027. ctx.globalCompositeOperation = "source-over";
  51028. }
  51029. }
  51030. }
  51031. }
  51032. ctx.restore();
  51033. return;
  51034. }
  51035. /**
  51036. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.buildPath
  51037. * @description 创建多边形路径。
  51038. *
  51039. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51040. * @param {Object} style - style。
  51041. *
  51042. */
  51043. }, {
  51044. key: "buildPath",
  51045. value: function buildPath(ctx, style) {
  51046. if (style.showShadow) {
  51047. ctx.shadowBlur = style.shadowBlur;
  51048. ctx.shadowColor = style.shadowColor;
  51049. ctx.shadowOffsetX = style.shadowOffsetX;
  51050. ctx.shadowOffsetY = style.shadowOffsetY;
  51051. }
  51052. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51053. this.refOriginalPosition = [0, 0];
  51054. }
  51055. var __OP = this.refOriginalPosition; // 虽然能重用 brokenLine,但底层图形基于性能考虑,重复代码减少调用吧
  51056. var pointList = style.pointList;
  51057. if (pointList.length < 2) {
  51058. // 少于2个点就不画了~
  51059. return;
  51060. }
  51061. if (style.smooth && style.smooth !== 'spline') {
  51062. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, true, style.smoothConstraint, __OP);
  51063. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51064. var cp1;
  51065. var cp2;
  51066. var p;
  51067. var len = pointList.length;
  51068. for (var i = 0; i < len; i++) {
  51069. cp1 = controlPoints[i * 2];
  51070. cp2 = controlPoints[i * 2 + 1];
  51071. p = [pointList[(i + 1) % len][0] + __OP[0], pointList[(i + 1) % len][1] + __OP[1]];
  51072. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  51073. }
  51074. } else {
  51075. if (style.smooth === 'spline') {
  51076. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, true, null, __OP);
  51077. }
  51078. if (!style.lineType || style.lineType == 'solid') {
  51079. // 默认为实线
  51080. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51081. for (var _i = 1; _i < pointList.length; _i++) {
  51082. ctx.lineTo(pointList[_i][0] + __OP[0], pointList[_i][1] + __OP[1]);
  51083. }
  51084. ctx.lineTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51085. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  51086. // SMIC-方法修改 - start
  51087. var dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  51088. style._dashLength = dashLengthForStyle;
  51089. var dashLength = style.lineWidth || 1;
  51090. var pattern1 = dashLength;
  51091. var pattern2 = dashLength; //dashed
  51092. if (style.lineType === 'dashed') {
  51093. pattern1 *= 5;
  51094. pattern2 *= 5;
  51095. if (style.lineCap && style.lineCap !== "butt") {
  51096. pattern1 -= dashLength;
  51097. pattern2 += dashLength;
  51098. }
  51099. } //dotted
  51100. if (style.lineType === 'dotted') {
  51101. if (style.lineCap && style.lineCap !== "butt") {
  51102. pattern1 = 1;
  51103. pattern2 += dashLength;
  51104. }
  51105. } //dot
  51106. if (style.lineType === 'dot') {
  51107. pattern2 *= 4;
  51108. if (style.lineCap && style.lineCap !== "butt") {
  51109. pattern1 = 1;
  51110. pattern2 += dashLength;
  51111. }
  51112. } //dash
  51113. if (style.lineType === 'dash') {
  51114. pattern1 *= 4;
  51115. pattern2 *= 4;
  51116. if (style.lineCap && style.lineCap !== "butt") {
  51117. pattern1 -= dashLength;
  51118. pattern2 += dashLength;
  51119. }
  51120. } //longdash
  51121. if (style.lineType === 'longdash') {
  51122. pattern1 *= 8;
  51123. pattern2 *= 4;
  51124. if (style.lineCap && style.lineCap !== "butt") {
  51125. pattern1 -= dashLength;
  51126. pattern2 += dashLength;
  51127. }
  51128. }
  51129. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51130. for (var _i2 = 1; _i2 < pointList.length; _i2++) {
  51131. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i2 - 1][0] + __OP[0], pointList[_i2 - 1][1] + __OP[1], pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1], dashLength, [pattern1, pattern2]);
  51132. }
  51133. 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]);
  51134. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  51135. var _dashLengthForStyle = style._dashLength || (style.lineWidth || 1) * (style.lineType == 'dashed' ? 5 : 1);
  51136. style._dashLength = _dashLengthForStyle;
  51137. var _dashLength = style.lineWidth || 1;
  51138. var _pattern = _dashLength;
  51139. var _pattern2 = _dashLength;
  51140. var pattern3 = _dashLength;
  51141. var pattern4 = _dashLength; //dashdot
  51142. if (style.lineType === 'dashdot') {
  51143. _pattern *= 4;
  51144. _pattern2 *= 4;
  51145. pattern4 *= 4;
  51146. if (style.lineCap && style.lineCap !== "butt") {
  51147. _pattern -= _dashLength;
  51148. _pattern2 += _dashLength;
  51149. pattern3 = 1;
  51150. pattern4 += _dashLength;
  51151. }
  51152. } //longdashdot
  51153. if (style.lineType === 'longdashdot') {
  51154. _pattern *= 8;
  51155. _pattern2 *= 4;
  51156. pattern4 *= 4;
  51157. if (style.lineCap && style.lineCap !== "butt") {
  51158. _pattern -= _dashLength;
  51159. _pattern2 += _dashLength;
  51160. pattern3 = 1;
  51161. pattern4 += _dashLength;
  51162. }
  51163. }
  51164. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51165. for (var _i3 = 1; _i3 < pointList.length; _i3++) {
  51166. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i3 - 1][0] + __OP[0], pointList[_i3 - 1][1] + __OP[1], pointList[_i3][0] + __OP[0], pointList[_i3][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  51167. }
  51168. 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]);
  51169. }
  51170. }
  51171. return;
  51172. }
  51173. /**
  51174. * @function SuperMap.LevelRenderer.Shape.SmicPolygon.prototype.getRect
  51175. * @description 计算返回多边形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  51176. *
  51177. * @param {Object} style - style
  51178. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51179. *
  51180. */
  51181. }, {
  51182. key: "getRect",
  51183. value: function getRect(style, refOriginalPosition) {
  51184. var __OP;
  51185. if (!refOriginalPosition) {
  51186. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51187. this.refOriginalPosition = [0, 0];
  51188. }
  51189. __OP = this.refOriginalPosition;
  51190. } else {
  51191. __OP = refOriginalPosition;
  51192. }
  51193. if (style.__rect) {
  51194. return style.__rect;
  51195. }
  51196. var minX = Number.MAX_VALUE;
  51197. var maxX = Number.MIN_VALUE;
  51198. var minY = Number.MAX_VALUE;
  51199. var maxY = Number.MIN_VALUE;
  51200. var pointList = style.pointList;
  51201. for (var i = 0, l = pointList.length; i < l; i++) {
  51202. if (pointList[i][0] + __OP[0] < minX) {
  51203. minX = pointList[i][0] + __OP[0];
  51204. }
  51205. if (pointList[i][0] + __OP[0] > maxX) {
  51206. maxX = pointList[i][0] + __OP[0];
  51207. }
  51208. if (pointList[i][1] + __OP[1] < minY) {
  51209. minY = pointList[i][1] + __OP[1];
  51210. }
  51211. if (pointList[i][1] + __OP[1] > maxY) {
  51212. maxY = pointList[i][1] + __OP[1];
  51213. }
  51214. }
  51215. var lineWidth;
  51216. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  51217. lineWidth = style.lineWidth || 1;
  51218. } else {
  51219. lineWidth = 0;
  51220. }
  51221. style.__rect = {
  51222. x: Math.round(minX - lineWidth / 2),
  51223. y: Math.round(minY - lineWidth / 2),
  51224. width: maxX - minX + lineWidth,
  51225. height: maxY - minY + lineWidth
  51226. };
  51227. return style.__rect;
  51228. }
  51229. }]);
  51230. return SmicPolygon;
  51231. }(Shape_Shape);
  51232. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicBrokenLine.js
  51233. function SmicBrokenLine_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicBrokenLine_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicBrokenLine_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicBrokenLine_typeof(obj); }
  51234. function SmicBrokenLine_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51235. 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); } }
  51236. function SmicBrokenLine_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicBrokenLine_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicBrokenLine_defineProperties(Constructor, staticProps); return Constructor; }
  51237. function SmicBrokenLine_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicBrokenLine_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicBrokenLine_get(target, property, receiver || target); }
  51238. function SmicBrokenLine_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicBrokenLine_getPrototypeOf(object); if (object === null) break; } return object; }
  51239. 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 } }); if (superClass) SmicBrokenLine_setPrototypeOf(subClass, superClass); }
  51240. function SmicBrokenLine_setPrototypeOf(o, p) { SmicBrokenLine_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicBrokenLine_setPrototypeOf(o, p); }
  51241. 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); }; }
  51242. function SmicBrokenLine_possibleConstructorReturn(self, call) { if (call && (SmicBrokenLine_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicBrokenLine_assertThisInitialized(self); }
  51243. function SmicBrokenLine_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51244. function SmicBrokenLine_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  51245. function SmicBrokenLine_getPrototypeOf(o) { SmicBrokenLine_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicBrokenLine_getPrototypeOf(o); }
  51246. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51247. * This program are made available under the terms of the Apache License, Version 2.0
  51248. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51249. /**
  51250. * @private
  51251. * @class SuperMap.LevelRenderer.Shape.SmicBrokenLine
  51252. * @category Visualization Theme
  51253. * @classdesc 折线(ic)。
  51254. * @extends SuperMap.LevelRenderer.Shape
  51255. * @example
  51256. * var shape = new SuperMap.LevelRenderer.Shape.SmicBrokenLine({
  51257. * style: {
  51258. * pointList: [[0, 0], [100, 100], [100, 0]],
  51259. * smooth: 'bezier',
  51260. * strokeColor: 'purple'
  51261. * }
  51262. * });
  51263. * levelRenderer.addShape(shape);
  51264. *
  51265. *
  51266. */
  51267. var SmicBrokenLine = /*#__PURE__*/function (_Shape) {
  51268. SmicBrokenLine_inherits(SmicBrokenLine, _Shape);
  51269. var _super = SmicBrokenLine_createSuper(SmicBrokenLine);
  51270. /**
  51271. * @member {Object} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.style
  51272. * @description 绘制样式。
  51273. *
  51274. * @param {Array} pointList - 节点数组,二维数组。默认值:null,必设参数。其形式如下:
  51275. * (code)
  51276. * (start code)
  51277. * [
  51278. * [10, 20], //单个节点
  51279. * [30, 40],
  51280. * [25, 30]
  51281. * ]
  51282. * (end)
  51283. * @param {string} smooth - 是否做平滑插值, 平滑算法可以选择 "bezier", "spline"。默认值:"";
  51284. * @param {number} smoothConstraint - 平滑约束。
  51285. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  51286. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  51287. * @param {number} lineWidth - 描边宽度。默认值:1。
  51288. * @param {number} opacity - 绘制透明度。默认值:1。
  51289. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  51290. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  51291. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  51292. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  51293. * @param {string} text - 图形中的附加文本。默认值:""。
  51294. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  51295. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  51296. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  51297. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  51298. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  51299. */
  51300. //打开接口 style
  51301. /**
  51302. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.constructor
  51303. * @description 构造函数。
  51304. *
  51305. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51306. *
  51307. */
  51308. function SmicBrokenLine(options) {
  51309. var _this;
  51310. SmicBrokenLine_classCallCheck(this, SmicBrokenLine);
  51311. _this = _super.call(this, options);
  51312. /**
  51313. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.brushTypeOnly
  51314. * @description 线条只能描边。
  51315. */
  51316. _this.brushTypeOnly = 'stroke';
  51317. /**
  51318. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.textPosition
  51319. * @description 文本位置。
  51320. */
  51321. _this.textPosition = 'end';
  51322. /**
  51323. * @member {string} SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.type
  51324. * @description 图形类型.
  51325. */
  51326. _this.type = 'smicbroken-line';
  51327. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51328. _this.refOriginalPosition = [0, 0];
  51329. }
  51330. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicBrokenLine";
  51331. return _this;
  51332. }
  51333. /**
  51334. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.destroy
  51335. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51336. */
  51337. SmicBrokenLine_createClass(SmicBrokenLine, [{
  51338. key: "destroy",
  51339. value: function destroy() {
  51340. this.brushTypeOnly = null;
  51341. this.textPosition = null;
  51342. this.type = null;
  51343. SmicBrokenLine_get(SmicBrokenLine_getPrototypeOf(SmicBrokenLine.prototype), "destroy", this).call(this);
  51344. }
  51345. /**
  51346. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.buildPath
  51347. * @description 创建折线路径。
  51348. *
  51349. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51350. * @param {Object} style - style。
  51351. *
  51352. */
  51353. }, {
  51354. key: "buildPath",
  51355. value: function buildPath(ctx, style) {
  51356. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51357. this.refOriginalPosition = [0, 0];
  51358. }
  51359. var __OP = this.refOriginalPosition;
  51360. var pointList = style.pointList;
  51361. if (pointList.length < 2) {
  51362. // 少于2个点就不画了~
  51363. return;
  51364. }
  51365. var len = Math.min(style.pointList.length, Math.round(style.pointListLength || style.pointList.length));
  51366. if (style.smooth && style.smooth !== 'spline') {
  51367. var controlPoints = SUtil_SUtil.SUtil_smoothBezier(pointList, style.smooth, false, style.smoothConstraint, __OP);
  51368. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51369. var cp1;
  51370. var cp2;
  51371. var p;
  51372. for (var _i = 0; _i < len - 1; _i++) {
  51373. cp1 = controlPoints[_i * 2];
  51374. cp2 = controlPoints[_i * 2 + 1];
  51375. p = [pointList[_i + 1][0] + __OP[0], pointList[_i + 1][1] + __OP[1]];
  51376. ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);
  51377. }
  51378. } else {
  51379. if (style.smooth === 'spline') {
  51380. pointList = SUtil_SUtil.SUtil_smoothSpline(pointList, null, null, __OP);
  51381. len = pointList.length;
  51382. }
  51383. if (!style.lineType || style.lineType === 'solid') {
  51384. // 默认为实线
  51385. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51386. for (var _i2 = 1; _i2 < len; _i2++) {
  51387. ctx.lineTo(pointList[_i2][0] + __OP[0], pointList[_i2][1] + __OP[1]);
  51388. }
  51389. } else if (style.lineType === 'dashed' || style.lineType === 'dotted' || style.lineType === 'dot' || style.lineType === 'dash' || style.lineType === 'longdash') {
  51390. var dashLength = style.lineWidth || 1;
  51391. var pattern1 = dashLength;
  51392. var pattern2 = dashLength; //dashed
  51393. if (style.lineType === 'dashed') {
  51394. pattern1 *= 5;
  51395. pattern2 *= 5;
  51396. if (style.lineCap && style.lineCap !== "butt") {
  51397. pattern1 -= dashLength;
  51398. pattern2 += dashLength;
  51399. }
  51400. } //dotted
  51401. if (style.lineType === 'dotted') {
  51402. if (style.lineCap && style.lineCap !== "butt") {
  51403. pattern1 = 1;
  51404. pattern2 += dashLength;
  51405. }
  51406. } //dot
  51407. if (style.lineType === 'dot') {
  51408. pattern2 *= 4;
  51409. if (style.lineCap && style.lineCap !== "butt") {
  51410. pattern1 = 1;
  51411. pattern2 += dashLength;
  51412. }
  51413. } //dash
  51414. if (style.lineType === 'dash') {
  51415. pattern1 *= 4;
  51416. pattern2 *= 4;
  51417. if (style.lineCap && style.lineCap !== "butt") {
  51418. pattern1 -= dashLength;
  51419. pattern2 += dashLength;
  51420. }
  51421. } //longdash
  51422. if (style.lineType === 'longdash') {
  51423. pattern1 *= 8;
  51424. pattern2 *= 4;
  51425. if (style.lineCap && style.lineCap !== "butt") {
  51426. pattern1 -= dashLength;
  51427. pattern2 += dashLength;
  51428. }
  51429. }
  51430. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51431. for (var i = 1; i < len; i++) {
  51432. 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]);
  51433. }
  51434. } else if (style.lineType === 'dashdot' || style.lineType === 'longdashdot') {
  51435. var _dashLength = style.lineWidth || 1;
  51436. var _pattern = _dashLength;
  51437. var _pattern2 = _dashLength;
  51438. var pattern3 = _dashLength;
  51439. var pattern4 = _dashLength; //dashdot
  51440. if (style.lineType === 'dashdot') {
  51441. _pattern *= 4;
  51442. _pattern2 *= 4;
  51443. pattern4 *= 4;
  51444. if (style.lineCap && style.lineCap !== "butt") {
  51445. _pattern -= _dashLength;
  51446. _pattern2 += _dashLength;
  51447. pattern3 = 1;
  51448. pattern4 += _dashLength;
  51449. }
  51450. } //longdashdot
  51451. if (style.lineType === 'longdashdot') {
  51452. _pattern *= 8;
  51453. _pattern2 *= 4;
  51454. pattern4 *= 4;
  51455. if (style.lineCap && style.lineCap !== "butt") {
  51456. _pattern -= _dashLength;
  51457. _pattern2 += _dashLength;
  51458. pattern3 = 1;
  51459. pattern4 += _dashLength;
  51460. }
  51461. }
  51462. _dashLength = (style.lineWidth || 1) * (style.lineType === 'dashed' ? 5 : 1);
  51463. ctx.moveTo(pointList[0][0] + __OP[0], pointList[0][1] + __OP[1]);
  51464. for (var _i3 = 1; _i3 < len; _i3++) {
  51465. SUtil_SUtil.SUtil_dashedLineTo(ctx, pointList[_i3 - 1][0] + __OP[0], pointList[_i3 - 1][1] + __OP[1], pointList[_i3][0] + __OP[0], pointList[_i3][1] + __OP[1], _dashLength, [_pattern, _pattern2, pattern3, pattern4]);
  51466. }
  51467. }
  51468. }
  51469. return;
  51470. }
  51471. /**
  51472. * @function SuperMap.LevelRenderer.Shape.SmicBrokenLine.prototype.getRect
  51473. * @description 计算返回折线包围盒矩形。该包围盒是直接从四个控制点计算,并非最小包围盒。
  51474. *
  51475. * @param {Object} style - style
  51476. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51477. */
  51478. }, {
  51479. key: "getRect",
  51480. value: function getRect(style) {
  51481. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51482. this.refOriginalPosition = [0, 0];
  51483. }
  51484. var __OP = this.refOriginalPosition;
  51485. return SmicPolygon.prototype.getRect.apply(this, [style, __OP]);
  51486. }
  51487. }]);
  51488. return SmicBrokenLine;
  51489. }(Shape_Shape);
  51490. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicImage.js
  51491. function SmicImage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicImage_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicImage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicImage_typeof(obj); }
  51492. function SmicImage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51493. 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); } }
  51494. function SmicImage_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicImage_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicImage_defineProperties(Constructor, staticProps); return Constructor; }
  51495. function SmicImage_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicImage_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicImage_get(target, property, receiver || target); }
  51496. function SmicImage_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicImage_getPrototypeOf(object); if (object === null) break; } return object; }
  51497. 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 } }); if (superClass) SmicImage_setPrototypeOf(subClass, superClass); }
  51498. function SmicImage_setPrototypeOf(o, p) { SmicImage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicImage_setPrototypeOf(o, p); }
  51499. 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); }; }
  51500. function SmicImage_possibleConstructorReturn(self, call) { if (call && (SmicImage_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicImage_assertThisInitialized(self); }
  51501. function SmicImage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51502. function SmicImage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  51503. function SmicImage_getPrototypeOf(o) { SmicImage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicImage_getPrototypeOf(o); }
  51504. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51505. * This program are made available under the terms of the Apache License, Version 2.0
  51506. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51507. /**
  51508. * @private
  51509. * @class SuperMap.LevelRenderer.Shape.SmicImage
  51510. * @category Visualization Theme
  51511. * @classdesc 图片绘制。
  51512. * @extends SuperMap.LevelRenderer.Shape
  51513. * @example
  51514. * var shape = new SuperMap.LevelRenderer.Shape.SmicImage({
  51515. * style: {
  51516. * image: 'test.jpg',
  51517. * x: 100,
  51518. * y: 100
  51519. * }
  51520. * });
  51521. * levelRenderer.addShape(shape);
  51522. *
  51523. *
  51524. */
  51525. var SmicImage = /*#__PURE__*/function (_Shape) {
  51526. SmicImage_inherits(SmicImage, _Shape);
  51527. var _super = SmicImage_createSuper(SmicImage);
  51528. /**
  51529. * @member {Object} SuperMap.LevelRenderer.Shape.SmicImage.prototype.style
  51530. * @description 绘制样式。
  51531. *
  51532. * @param {number} style.x - 左上角横坐标,必设参数。
  51533. * @param {number} style.y - 左上角纵坐标,必设参数。
  51534. * @param {(string/Cavans)} style.image - 图片地址或cavans对象,必设参数。
  51535. * @param {number} style.width - 绘制到画布上的宽度,默认为图片高度。
  51536. * @param {number} style.height - 绘制到画布上的高度,默认为图片高度。
  51537. * @param {number} style.sx - 从图片中裁剪的左上角横坐标。
  51538. * @param {number} style.sy - 从图片中裁剪的左上角纵坐标。
  51539. * @param {number} style.sWidth - 从图片中裁剪的宽度,默认为图片高度。
  51540. * @param {number} style.sHeight - 绘制到画布上的高度,默认为图片高度。
  51541. * @param {number} style.opacity - 绘制透明度。默认值:1。
  51542. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  51543. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  51544. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  51545. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  51546. * @param {string} style.text - 图形中的附加文本。默认值:""。
  51547. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  51548. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  51549. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  51550. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  51551. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  51552. */
  51553. //打开接口 style
  51554. /**
  51555. * @function SuperMap.LevelRenderer.Shape.SmicImage.constructor
  51556. * @description 构造函数。
  51557. *
  51558. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51559. *
  51560. */
  51561. function SmicImage(options) {
  51562. var _this;
  51563. SmicImage_classCallCheck(this, SmicImage);
  51564. _this = _super.call(this, options);
  51565. /**
  51566. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype.type
  51567. * @description 图形类型。
  51568. */
  51569. _this.type = 'smicimage';
  51570. /**
  51571. * @member {string} SuperMap.LevelRenderer.Shape.SmicImage.prototype._imageCache
  51572. * @description 图片缓存。
  51573. */
  51574. _this._imageCache = {};
  51575. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51576. _this.refOriginalPosition = [0, 0];
  51577. }
  51578. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicImage";
  51579. return _this;
  51580. }
  51581. /**
  51582. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.destroy
  51583. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51584. */
  51585. SmicImage_createClass(SmicImage, [{
  51586. key: "destroy",
  51587. value: function destroy() {
  51588. this.type = null;
  51589. this._imageCache = null;
  51590. SmicImage_get(SmicImage_getPrototypeOf(SmicImage.prototype), "destroy", this).call(this);
  51591. }
  51592. /**
  51593. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.buildPath
  51594. * @description 创建图片。
  51595. *
  51596. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51597. * @param {Object} style - style。
  51598. *
  51599. */
  51600. }, {
  51601. key: "brush",
  51602. value: function brush(ctx, isHighlight, refresh) {
  51603. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51604. this.refOriginalPosition = [0, 0];
  51605. }
  51606. var __OP = this.refOriginalPosition;
  51607. var style = this.style || {};
  51608. if (isHighlight) {
  51609. // 根据style扩展默认高亮样式
  51610. style = this.getHighlightStyle(style, this.highlightStyle || {});
  51611. }
  51612. var image = style.image;
  51613. var me = this;
  51614. if (typeof image === 'string') {
  51615. var src = image;
  51616. if (this._imageCache[src]) {
  51617. image = this._imageCache[src];
  51618. } else {
  51619. image = new Image();
  51620. image.onload = function () {
  51621. image.onload = null;
  51622. clearTimeout(SmicImage._refreshTimeout);
  51623. SmicImage._needsRefresh.push(me); // 防止因为缓存短时间内触发多次onload事件
  51624. SmicImage._refreshTimeout = setTimeout(function () {
  51625. refresh && refresh(SmicImage._needsRefresh); // 清空 needsRefresh
  51626. SmicImage._needsRefresh = [];
  51627. }, 10);
  51628. };
  51629. image.src = src;
  51630. this._imageCache[src] = image;
  51631. }
  51632. }
  51633. if (image) {
  51634. // 图片已经加载完成
  51635. if (image.nodeName.toUpperCase() == 'IMG') {
  51636. if (window.ActiveXObject) {
  51637. if (image.readyState != 'complete') {
  51638. return;
  51639. }
  51640. } else {
  51641. if (!image.complete) {
  51642. return;
  51643. }
  51644. }
  51645. } // Else is canvas
  51646. var width = style.width || image.width;
  51647. var height = style.height || image.height;
  51648. var x = style.x + __OP[0];
  51649. var y = style.y + __OP[1]; // 图片加载失败
  51650. if (!image.width || !image.height) {
  51651. return;
  51652. }
  51653. ctx.save();
  51654. this.doClip(ctx);
  51655. this.setContext(ctx, style); // 设置transform
  51656. this.setTransform(ctx);
  51657. if (style.sWidth && style.sHeight) {
  51658. var sx = style.sx + __OP[0] || 0;
  51659. var sy = style.sy + __OP[1] || 0;
  51660. ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);
  51661. } else if (style.sx && style.sy) {
  51662. var _sx = style.sx + __OP[0];
  51663. var _sy = style.sy + __OP[1];
  51664. var sWidth = width - _sx;
  51665. var sHeight = height - _sy;
  51666. ctx.drawImage(image, _sx, _sy, sWidth, sHeight, x, y, width, height);
  51667. } else {
  51668. ctx.drawImage(image, x, y, width, height);
  51669. } // 如果没设置宽和高的话自动根据图片宽高设置
  51670. if (!style.width) {
  51671. style.width = width;
  51672. }
  51673. if (!style.height) {
  51674. style.height = height;
  51675. }
  51676. if (!this.style.width) {
  51677. this.style.width = width;
  51678. }
  51679. if (!this.style.height) {
  51680. this.style.height = height;
  51681. }
  51682. this.drawText(ctx, style, this.style);
  51683. ctx.restore();
  51684. }
  51685. }
  51686. /**
  51687. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.getRect
  51688. * @description 计算返回图片的包围盒矩形。
  51689. *
  51690. * @param {Object} style - style
  51691. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51692. */
  51693. }, {
  51694. key: "getRect",
  51695. value: function getRect(style) {
  51696. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51697. this.refOriginalPosition = [0, 0];
  51698. }
  51699. var __OP = this.refOriginalPosition;
  51700. return {
  51701. x: style.x + __OP[0],
  51702. y: style.y + __OP[1],
  51703. width: style.width,
  51704. height: style.height
  51705. };
  51706. }
  51707. /**
  51708. * @function SuperMap.LevelRenderer.Shape.SmicImage.prototype.clearCache
  51709. * @description 清除图片缓存。
  51710. *
  51711. * @param {Object} style - style
  51712. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51713. *
  51714. */
  51715. }, {
  51716. key: "clearCache",
  51717. value: function clearCache() {
  51718. this._imageCache = {};
  51719. }
  51720. }]);
  51721. return SmicImage;
  51722. }(Shape_Shape);
  51723. SmicImage._needsRefresh = [];
  51724. SmicImage._refreshTimeout = null;
  51725. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRectangle.js
  51726. function SmicRectangle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicRectangle_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicRectangle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicRectangle_typeof(obj); }
  51727. function SmicRectangle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51728. 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); } }
  51729. function SmicRectangle_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRectangle_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRectangle_defineProperties(Constructor, staticProps); return Constructor; }
  51730. function SmicRectangle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRectangle_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicRectangle_get(target, property, receiver || target); }
  51731. function SmicRectangle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRectangle_getPrototypeOf(object); if (object === null) break; } return object; }
  51732. 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 } }); if (superClass) SmicRectangle_setPrototypeOf(subClass, superClass); }
  51733. function SmicRectangle_setPrototypeOf(o, p) { SmicRectangle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRectangle_setPrototypeOf(o, p); }
  51734. 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); }; }
  51735. function SmicRectangle_possibleConstructorReturn(self, call) { if (call && (SmicRectangle_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRectangle_assertThisInitialized(self); }
  51736. function SmicRectangle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51737. function SmicRectangle_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  51738. function SmicRectangle_getPrototypeOf(o) { SmicRectangle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRectangle_getPrototypeOf(o); }
  51739. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51740. * This program are made available under the terms of the Apache License, Version 2.0
  51741. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51742. /**
  51743. * @private
  51744. * @class SuperMap.LevelRenderer.Shape.SmicRectangle
  51745. * @category Visualization Theme
  51746. * @classdesc 矩形。
  51747. * @extends SuperMap.LevelRenderer.Shape
  51748. * @example
  51749. * var shape = new SuperMap.LevelRenderer.Shape.SmicRectangle({
  51750. * style: {
  51751. * x: 0,
  51752. * y: 0,
  51753. * width: 100,
  51754. * height: 100,
  51755. * radius: 20
  51756. * }
  51757. * });
  51758. * levelRenderer.addShape(shape);
  51759. *
  51760. */
  51761. var SmicRectangle = /*#__PURE__*/function (_Shape) {
  51762. SmicRectangle_inherits(SmicRectangle, _Shape);
  51763. var _super = SmicRectangle_createSuper(SmicRectangle);
  51764. /**
  51765. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.style
  51766. * @description 绘制样式。
  51767. *
  51768. * @param {number} style.x - 左上角 x 坐标,必设参数。
  51769. * @param {number} style.y - 左上角 y 坐标,必设参数。
  51770. * @param {number} style.width - 宽度,必设参数。
  51771. * @param {number} style.height - 高度,必设参数。
  51772. * @param {Array} style.radius - 矩形圆角,可以用数组分别指定四个角的圆角,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 则 radius为 [r1、r2、r3、r4 ]。
  51773. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  51774. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  51775. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  51776. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  51777. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  51778. * @param {number} style.opacity - 绘制透明度。默认值:1。
  51779. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  51780. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  51781. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  51782. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  51783. * @param {string} style.text - 图形中的附加文本。默认值:""。
  51784. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  51785. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  51786. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  51787. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  51788. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  51789. */
  51790. //打开接口 style
  51791. /**
  51792. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.constructor
  51793. * @description 构造函数。
  51794. *
  51795. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  51796. *
  51797. */
  51798. function SmicRectangle(options) {
  51799. var _this;
  51800. SmicRectangle_classCallCheck(this, SmicRectangle);
  51801. _this = _super.call(this, options);
  51802. /**
  51803. * @member {string} SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.type
  51804. * @description 图形类型.
  51805. */
  51806. _this.type = 'smicrectangle';
  51807. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  51808. _this.refOriginalPosition = [0, 0];
  51809. }
  51810. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRectangle";
  51811. return _this;
  51812. }
  51813. /**
  51814. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.destroy
  51815. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  51816. */
  51817. SmicRectangle_createClass(SmicRectangle, [{
  51818. key: "destroy",
  51819. value: function destroy() {
  51820. this.type = null;
  51821. SmicRectangle_get(SmicRectangle_getPrototypeOf(SmicRectangle.prototype), "destroy", this).call(this);
  51822. }
  51823. /**
  51824. * APIMethod: _buildRadiusPath
  51825. * 创建矩形的圆角路径。
  51826. *
  51827. * Parameters:
  51828. * ctx - {CanvasRenderingContext2D} Context2D 上下文。
  51829. * style - {Object} style。
  51830. *
  51831. */
  51832. }, {
  51833. key: "_buildRadiusPath",
  51834. value: function _buildRadiusPath(ctx, style) {
  51835. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51836. this.refOriginalPosition = [0, 0];
  51837. }
  51838. var __OP = this.refOriginalPosition; // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
  51839. // r缩写为1 相当于 [1, 1, 1, 1]
  51840. // r缩写为[1] 相当于 [1, 1, 1, 1]
  51841. // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
  51842. // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
  51843. var x = style.x + __OP[0];
  51844. var y = style.y + __OP[1];
  51845. var width = style.width;
  51846. var height = style.height;
  51847. var r = style.radius;
  51848. var r1;
  51849. var r2;
  51850. var r3;
  51851. var r4;
  51852. if (typeof r === 'number') {
  51853. r1 = r2 = r3 = r4 = r;
  51854. } else if (r instanceof Array) {
  51855. if (r.length === 1) {
  51856. r1 = r2 = r3 = r4 = r[0];
  51857. } else if (r.length === 2) {
  51858. r1 = r3 = r[0];
  51859. r2 = r4 = r[1];
  51860. } else if (r.length === 3) {
  51861. r1 = r[0];
  51862. r2 = r4 = r[1];
  51863. r3 = r[2];
  51864. } else {
  51865. r1 = r[0];
  51866. r2 = r[1];
  51867. r3 = r[2];
  51868. r4 = r[3];
  51869. }
  51870. } else {
  51871. r1 = r2 = r3 = r4 = 0;
  51872. }
  51873. var total;
  51874. if (r1 + r2 > width) {
  51875. total = r1 + r2;
  51876. r1 *= width / total;
  51877. r2 *= width / total;
  51878. }
  51879. if (r3 + r4 > width) {
  51880. total = r3 + r4;
  51881. r3 *= width / total;
  51882. r4 *= width / total;
  51883. }
  51884. if (r2 + r3 > height) {
  51885. total = r2 + r3;
  51886. r2 *= height / total;
  51887. r3 *= height / total;
  51888. }
  51889. if (r1 + r4 > height) {
  51890. total = r1 + r4;
  51891. r1 *= height / total;
  51892. r4 *= height / total;
  51893. }
  51894. ctx.moveTo(x + r1, y);
  51895. ctx.lineTo(x + width - r2, y);
  51896. r2 !== 0 && ctx.quadraticCurveTo(x + width, y, x + width, y + r2);
  51897. ctx.lineTo(x + width, y + height - r3);
  51898. r3 !== 0 && ctx.quadraticCurveTo(x + width, y + height, x + width - r3, y + height);
  51899. ctx.lineTo(x + r4, y + height);
  51900. r4 !== 0 && ctx.quadraticCurveTo(x, y + height, x, y + height - r4);
  51901. ctx.lineTo(x, y + r1);
  51902. r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
  51903. }
  51904. /**
  51905. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.buildPath
  51906. * @description 创建矩形路径。
  51907. *
  51908. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  51909. * @param {Object} style - style。
  51910. *
  51911. */
  51912. }, {
  51913. key: "buildPath",
  51914. value: function buildPath(ctx, style) {
  51915. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51916. this.refOriginalPosition = [0, 0];
  51917. }
  51918. var __OP = this.refOriginalPosition;
  51919. if (!style.radius) {
  51920. ctx.moveTo(style.x + __OP[0], style.y + __OP[1]);
  51921. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1]);
  51922. ctx.lineTo(style.x + __OP[0] + style.width, style.y + __OP[1] + style.height);
  51923. ctx.lineTo(style.x + __OP[0], style.y + __OP[1] + style.height);
  51924. ctx.lineTo(style.x + __OP[0], style.y + __OP[1]); // ctx.rect(style.x, style.y, style.width, style.height);
  51925. } else {
  51926. this._buildRadiusPath(ctx, style);
  51927. }
  51928. ctx.closePath();
  51929. return;
  51930. }
  51931. /**
  51932. * @function SuperMap.LevelRenderer.Shape.SmicRectangle.prototype.getRect
  51933. * @description 计算返回矩形包围盒矩阵。该包围盒是直接从四个控制点计算,并非最小包围盒。
  51934. *
  51935. * @param {Object} style - style
  51936. * @return {Object} 边框对象。包含属性:x,y,width,height。
  51937. */
  51938. }, {
  51939. key: "getRect",
  51940. value: function getRect(style) {
  51941. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  51942. this.refOriginalPosition = [0, 0];
  51943. }
  51944. var __OP = this.refOriginalPosition;
  51945. if (style.__rect) {
  51946. return style.__rect;
  51947. }
  51948. var lineWidth;
  51949. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  51950. lineWidth = style.lineWidth || 1;
  51951. } else {
  51952. lineWidth = 0;
  51953. }
  51954. style.__rect = {
  51955. x: Math.round(style.x + __OP[0] - lineWidth / 2),
  51956. y: Math.round(style.y + __OP[1] - lineWidth / 2),
  51957. width: style.width + lineWidth,
  51958. height: style.height + lineWidth
  51959. };
  51960. return style.__rect;
  51961. }
  51962. }]);
  51963. return SmicRectangle;
  51964. }(Shape_Shape);
  51965. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicSector.js
  51966. function SmicSector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicSector_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicSector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicSector_typeof(obj); }
  51967. function SmicSector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  51968. 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); } }
  51969. function SmicSector_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicSector_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicSector_defineProperties(Constructor, staticProps); return Constructor; }
  51970. function SmicSector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicSector_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicSector_get(target, property, receiver || target); }
  51971. function SmicSector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicSector_getPrototypeOf(object); if (object === null) break; } return object; }
  51972. 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 } }); if (superClass) SmicSector_setPrototypeOf(subClass, superClass); }
  51973. function SmicSector_setPrototypeOf(o, p) { SmicSector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicSector_setPrototypeOf(o, p); }
  51974. 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); }; }
  51975. function SmicSector_possibleConstructorReturn(self, call) { if (call && (SmicSector_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicSector_assertThisInitialized(self); }
  51976. function SmicSector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  51977. function SmicSector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  51978. function SmicSector_getPrototypeOf(o) { SmicSector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicSector_getPrototypeOf(o); }
  51979. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  51980. * This program are made available under the terms of the Apache License, Version 2.0
  51981. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  51982. /**
  51983. * @private
  51984. * @class SuperMap.LevelRenderer.Shape.SmicSector
  51985. * @category Visualization Theme
  51986. * @classdesc 扇形。
  51987. * @extends SuperMap.LevelRenderer.Shape
  51988. * @example
  51989. * var shape = new SuperMap.LevelRenderer.Shape.SmicSector({
  51990. * style: {
  51991. * x: 100,
  51992. * y: 100,
  51993. * r: 60,
  51994. * r0: 30,
  51995. * startAngle: 0,
  51996. * endEngle: 180
  51997. * }
  51998. * });
  51999. * levelRenderer.addShape(shape);
  52000. *
  52001. *
  52002. */
  52003. var SmicSector = /*#__PURE__*/function (_Shape) {
  52004. SmicSector_inherits(SmicSector, _Shape);
  52005. var _super = SmicSector_createSuper(SmicSector);
  52006. /**
  52007. * @member {Object} SuperMap.LevelRenderer.Shape.SmicSector.prototype.style
  52008. * @description 绘制样式。
  52009. *
  52010. * @param {number} style.x - 圆心 x 坐标,必设参数。
  52011. * @param {number} style.y - 圆心 y 坐标,必设参数。
  52012. * @param {number} style.r - 外圆半径,必设参数。
  52013. * @param {number} style.r0 - 内圆半径,指定后将出现内弧,同时扇边长度为`r - r0`。取值范围[0, r),默认值:0。
  52014. * @param {number} style.startAngle - 起始角度,必设参数。取值范围[0, 360)。
  52015. * @param {number} style.endAngle - 结束角度,必设参数。取值范围(0, 360。
  52016. * @param {boolean} style.clockWise - 是否是顺时针。默认值:false。
  52017. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  52018. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  52019. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  52020. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  52021. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  52022. * @param {number} style.opacity - 绘制透明度。默认值:1。
  52023. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  52024. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  52025. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  52026. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  52027. * @param {string} style.text - 图形中的附加文本。默认值:""。
  52028. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  52029. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  52030. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  52031. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  52032. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  52033. */
  52034. //打开接口 style
  52035. /**
  52036. * @function SuperMap.LevelRenderer.Shape.SmicSector.constructor
  52037. * @description 构造函数。
  52038. *
  52039. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  52040. *
  52041. */
  52042. function SmicSector(options) {
  52043. var _this;
  52044. SmicSector_classCallCheck(this, SmicSector);
  52045. _this = _super.call(this, options);
  52046. /**
  52047. * @member {string} SuperMap.LevelRenderer.Shape.SmicSector.protptype.type
  52048. * @description 图形类型。
  52049. */
  52050. _this.type = 'smicsector';
  52051. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  52052. _this.refOriginalPosition = [0, 0];
  52053. }
  52054. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicSector";
  52055. return _this;
  52056. }
  52057. /**
  52058. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.destroy
  52059. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  52060. */
  52061. SmicSector_createClass(SmicSector, [{
  52062. key: "destroy",
  52063. value: function destroy() {
  52064. this.type = null;
  52065. SmicSector_get(SmicSector_getPrototypeOf(SmicSector.prototype), "destroy", this).call(this);
  52066. }
  52067. /**
  52068. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.buildPath
  52069. * @description 创建扇形路径。
  52070. *
  52071. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  52072. * @param {Object} style - style。
  52073. *
  52074. */
  52075. }, {
  52076. key: "buildPath",
  52077. value: function buildPath(ctx, style) {
  52078. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52079. this.refOriginalPosition = [0, 0];
  52080. }
  52081. var __OP = this.refOriginalPosition;
  52082. var x = style.x + __OP[0]; // 圆心x
  52083. var y = style.y + __OP[1]; // 圆心y
  52084. var r0 = style.r0 || 0; // 形内半径[0,r)
  52085. var r = style.r; // 扇形外半径(0,r]
  52086. var startAngle = style.startAngle; // 起始角度[0,360)
  52087. var endAngle = style.endAngle; // 结束角度(0,360]
  52088. var clockWise = style.clockWise || false;
  52089. startAngle = SUtil_SUtil.Util_math.degreeToRadian(startAngle);
  52090. endAngle = SUtil_SUtil.Util_math.degreeToRadian(endAngle);
  52091. if (!clockWise) {
  52092. // 扇形默认是逆时针方向,Y轴向上
  52093. // 这个跟arc的标准不一样,为了兼容echarts
  52094. startAngle = -startAngle;
  52095. endAngle = -endAngle;
  52096. }
  52097. var unitX = SUtil_SUtil.Util_math.cos(startAngle);
  52098. var unitY = SUtil_SUtil.Util_math.sin(startAngle);
  52099. ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
  52100. ctx.lineTo(unitX * r + x, unitY * r + y);
  52101. ctx.arc(x, y, r, startAngle, endAngle, !clockWise);
  52102. ctx.lineTo(SUtil_SUtil.Util_math.cos(endAngle) * r0 + x, SUtil_SUtil.Util_math.sin(endAngle) * r0 + y);
  52103. if (r0 !== 0) {
  52104. ctx.arc(x, y, r0, endAngle, startAngle, clockWise);
  52105. }
  52106. ctx.closePath();
  52107. return;
  52108. }
  52109. /**
  52110. * @function SuperMap.LevelRenderer.Shape.SmicSector.prototype.getRect
  52111. * @description 返回扇形包围盒矩形
  52112. *
  52113. * @param {Object} style - style
  52114. * @return {Object} 边框对象。包含属性:x,y,width,height。
  52115. *
  52116. */
  52117. }, {
  52118. key: "getRect",
  52119. value: function getRect(style) {
  52120. if (style.__rect) {
  52121. return style.__rect;
  52122. }
  52123. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  52124. this.refOriginalPosition = [0, 0];
  52125. }
  52126. var __OP = this.refOriginalPosition;
  52127. var min0 = SUtil_SUtil.Util_vector.create();
  52128. var min1 = SUtil_SUtil.Util_vector.create();
  52129. var max0 = SUtil_SUtil.Util_vector.create();
  52130. var max1 = SUtil_SUtil.Util_vector.create();
  52131. var x = style.x + __OP[0]; // 圆心x
  52132. var y = style.y + __OP[1]; // 圆心y
  52133. var r0 = style.r0 || 0; // 形内半径[0,r)
  52134. var r = style.r; // 扇形外半径(0,r]
  52135. var startAngle = SUtil_SUtil.Util_math.degreeToRadian(style.startAngle);
  52136. var endAngle = SUtil_SUtil.Util_math.degreeToRadian(style.endAngle);
  52137. var clockWise = style.clockWise;
  52138. if (!clockWise) {
  52139. startAngle = -startAngle;
  52140. endAngle = -endAngle;
  52141. }
  52142. if (r0 > 1) {
  52143. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r0, startAngle, endAngle, !clockWise, min0, max0);
  52144. } else {
  52145. min0[0] = max0[0] = x;
  52146. min0[1] = max0[1] = y;
  52147. }
  52148. SUtil_SUtil.Util_computeBoundingBox.arc(x, y, r, startAngle, endAngle, !clockWise, min1, max1);
  52149. SUtil_SUtil.Util_vector.min(min0, min0, min1);
  52150. SUtil_SUtil.Util_vector.max(max0, max0, max1);
  52151. style.__rect = {
  52152. x: min0[0],
  52153. y: min0[1],
  52154. width: max0[0] - min0[0],
  52155. height: max0[1] - min0[1]
  52156. };
  52157. return style.__rect;
  52158. }
  52159. }]);
  52160. return SmicSector;
  52161. }(Shape_Shape);
  52162. ;// CONCATENATED MODULE: ./src/common/overlay/feature/ShapeFactory.js
  52163. function ShapeFactory_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52164. 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); } }
  52165. function ShapeFactory_createClass(Constructor, protoProps, staticProps) { if (protoProps) ShapeFactory_defineProperties(Constructor.prototype, protoProps); if (staticProps) ShapeFactory_defineProperties(Constructor, staticProps); return Constructor; }
  52166. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  52167. * This program are made available under the terms of the Apache License, Version 2.0
  52168. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52169. /**
  52170. * @class SuperMap.Feature.ShapeFactory
  52171. * @category Visualization Theme
  52172. * @classdesc 图形工厂类。
  52173. * 目前支持创建的图形有:<br>
  52174. * 用于统计专题图:<br>
  52175. * 点 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Point}> <br>
  52176. * 线 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Line}> <br>
  52177. * 面 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Polygon}> <br>
  52178. * 矩形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Rectangle}> <br>
  52179. * 扇形 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Sector}> <br>
  52180. * 标签 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Label}> <br>
  52181. * 图片 - 参数对象 <{@link SuperMap.Feature.ShapeParameters.Image}> <br>
  52182. * 用于符号专题图:<br>
  52183. * 圆形 - 参数对象:<{@link SuperMap.Feature.ShapeParameters.Cilcle}>
  52184. */
  52185. var ShapeFactory = /*#__PURE__*/function () {
  52186. /**
  52187. * @function SuperMap.Feature.ShapeFactory.prototype.constructor
  52188. * @description 构建图形工厂对象。
  52189. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象,可选参数。
  52190. * @returns {SuperMap.Feature.ShapeFactory} 返回图形工厂类对象。
  52191. */
  52192. function ShapeFactory(shapeParameters) {
  52193. ShapeFactory_classCallCheck(this, ShapeFactory);
  52194. /**
  52195. * @member {Object} SuperMap.Feature.ShapeParameters.prototype.shapeParameters
  52196. * @description 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。必设参数,默认值 null。
  52197. */
  52198. this.shapeParameters = shapeParameters;
  52199. this.CLASS_NAME = "SuperMap.Feature.ShapeFactory";
  52200. }
  52201. /**
  52202. * @function SuperMap.Feature.ShapeParameters.prototype.destroy
  52203. * @description 销毁图形工厂类对象。
  52204. */
  52205. ShapeFactory_createClass(ShapeFactory, [{
  52206. key: "destroy",
  52207. value: function destroy() {
  52208. this.shapeParameters = null;
  52209. }
  52210. /**
  52211. * @function SuperMap.Feature.ShapeParameters.prototype.createShape
  52212. * @description 创建一个图形。具体图形由 shapeParameters 决定。
  52213. * @param {Object} shapeParameters - 图形参数对象,<{@link SuperMap.Feature.ShapeParameters}> 子类对象。
  52214. * 此参数可选,如果使用此参数(不为 null),shapeParameters 属性值将被修改为参数的值,然后再使用 shapeParameters 属性值创建图形;
  52215. * 如果不使用此参数,createShape 方法将直接使用 shapeParameters 属性创建图形。
  52216. * @returns {Object} 图形对象(或 null - 图形创建失败)。
  52217. */
  52218. }, {
  52219. key: "createShape",
  52220. value: function createShape(shapeParameters) {
  52221. if (shapeParameters) {
  52222. this.shapeParameters = shapeParameters;
  52223. }
  52224. if (!this.shapeParameters) {
  52225. return null;
  52226. }
  52227. var sps = this.shapeParameters;
  52228. if (sps instanceof Point_Point) {
  52229. // 点
  52230. //设置style
  52231. var style = new Object();
  52232. style["x"] = sps.x;
  52233. style["y"] = sps.y;
  52234. style["r"] = sps.r;
  52235. style = Util.copyAttributesWithClip(style, sps.style, ['x', 'y']); //创建图形
  52236. var shape = new SmicPoint();
  52237. shape.style = ShapeFactory.transformStyle(style);
  52238. shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52239. Util.copyAttributesWithClip(shape, sps, ['x', 'y', 'style', 'highlightStyle']);
  52240. return shape;
  52241. } else if (sps instanceof Line_Line) {
  52242. // 线
  52243. //检查参数 pointList 是否存在
  52244. if (!sps.pointList) {
  52245. return null;
  52246. } // 设置style
  52247. var _style = new Object();
  52248. _style["pointList"] = sps.pointList;
  52249. _style = Util.copyAttributesWithClip(_style, sps.style, ['pointList']); // 创建图形
  52250. var _shape = new SmicBrokenLine();
  52251. _shape.style = ShapeFactory.transformStyle(_style);
  52252. _shape.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52253. Util.copyAttributesWithClip(_shape, sps, ['pointList', 'style', 'highlightStyle']);
  52254. return _shape;
  52255. } else if (sps instanceof Polygon_Polygon) {
  52256. // 面
  52257. //检查参数 pointList 是否存在
  52258. if (!sps.pointList) {
  52259. return null;
  52260. } //设置style
  52261. var _style2 = new Object();
  52262. _style2["pointList"] = sps.pointList;
  52263. _style2 = Util.copyAttributesWithClip(_style2, sps.style, ['pointList']); //创建图形
  52264. var _shape2 = new SmicPolygon();
  52265. _shape2.style = ShapeFactory.transformStyle(_style2);
  52266. _shape2.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52267. Util.copyAttributesWithClip(_shape2, sps, ['pointList', 'style', "highlightStyle"]);
  52268. return _shape2;
  52269. } else if (sps instanceof Rectangle_Rectangle) {
  52270. // 矩形
  52271. //检查参数 pointList 是否存在
  52272. if (!sps.x && !sps.y & !sps.width & !sps.height) {
  52273. return null;
  52274. } //设置style
  52275. var _style3 = new Object();
  52276. _style3["x"] = sps.x;
  52277. _style3["y"] = sps.y;
  52278. _style3["width"] = sps.width;
  52279. _style3["height"] = sps.height;
  52280. _style3 = Util.copyAttributesWithClip(_style3, sps.style, ['x', 'y', 'width', 'height']); //创建图形
  52281. var _shape3 = new SmicRectangle();
  52282. _shape3.style = ShapeFactory.transformStyle(_style3);
  52283. _shape3.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52284. Util.copyAttributesWithClip(_shape3, sps, ['x', 'y', 'width', 'height', 'style', 'highlightStyle']);
  52285. return _shape3;
  52286. } else if (sps instanceof Sector) {
  52287. // 扇形
  52288. //设置style
  52289. var _style4 = new Object();
  52290. _style4["x"] = sps.x;
  52291. _style4["y"] = sps.y;
  52292. _style4["r"] = sps.r;
  52293. _style4["startAngle"] = sps.startAngle;
  52294. _style4["endAngle"] = sps.endAngle;
  52295. if (sps["r0"]) {
  52296. _style4["r0"] = sps.r0;
  52297. }
  52298. if (sps["clockWise"]) {
  52299. _style4["clockWise"] = sps.clockWise;
  52300. }
  52301. _style4 = Util.copyAttributesWithClip(_style4, sps.style, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle']); //创建图形
  52302. var _shape4 = new SmicSector();
  52303. _shape4.style = ShapeFactory.transformStyle(_style4);
  52304. _shape4.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52305. Util.copyAttributesWithClip(_shape4, sps, ['x', 'y', 'r', 'startAngle', 'endAngle', 'r0', 'endAngle', 'style', 'highlightStyle']);
  52306. return _shape4;
  52307. } else if (sps instanceof Label) {
  52308. // 标签
  52309. //设置style
  52310. var _style5 = new Object();
  52311. _style5["x"] = sps.x;
  52312. _style5["y"] = sps.y;
  52313. _style5["text"] = sps.text;
  52314. _style5 = Util.copyAttributesWithClip(_style5, sps.style, ['x', 'y', 'text']); //创建图形
  52315. var _shape5 = new SmicText();
  52316. _shape5.style = ShapeFactory.transformStyle(_style5);
  52317. _shape5.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52318. Util.copyAttributesWithClip(_shape5, sps, ['x', 'y', 'text', 'style', 'highlightStyle']);
  52319. return _shape5;
  52320. } else if (sps instanceof Image_Image) {
  52321. // 图片
  52322. //设置style
  52323. var _style6 = new Object();
  52324. _style6["x"] = sps.x;
  52325. _style6["y"] = sps.y;
  52326. if (sps["image"]) {
  52327. _style6["image"] = sps.image;
  52328. }
  52329. if (sps["width"]) {
  52330. _style6["width"] = sps.width;
  52331. }
  52332. if (sps["height"]) {
  52333. _style6["height"] = sps.height;
  52334. }
  52335. if (sps["sx"]) {
  52336. _style6["sx"] = sps.sx;
  52337. }
  52338. if (sps["sy"]) {
  52339. _style6["sy"] = sps.sy;
  52340. }
  52341. if (sps["sWidth"]) {
  52342. _style6["sWidth"] = sps.sWidth;
  52343. }
  52344. if (sps["sHeight"]) {
  52345. _style6["sHeight"] = sps.sHeight;
  52346. }
  52347. _style6 = Util.copyAttributesWithClip(_style6, sps.style, ['x', 'y', 'image', 'width', 'height', 'sx', 'sy', 'sWidth', 'sHeight']); //创建图形
  52348. var _shape6 = new SmicImage();
  52349. _shape6.style = ShapeFactory.transformStyle(_style6);
  52350. _shape6.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52351. Util.copyAttributesWithClip(_shape6, sps, ['x', 'y', 'image', 'width', 'height', 'style', 'highlightStyle']);
  52352. return _shape6;
  52353. } else if (sps instanceof Circle_Circle) {
  52354. //圆形 用于符号专题图
  52355. //设置stytle
  52356. var _style7 = new Object();
  52357. _style7["x"] = sps.x;
  52358. _style7["r"] = sps.r;
  52359. _style7["y"] = sps.y;
  52360. _style7 = Util.copyAttributesWithClip(_style7, sps.style, ['x', 'y', 'r']); //创建图形
  52361. var _shape7 = new SmicCircle();
  52362. _shape7.style = ShapeFactory.transformStyle(_style7);
  52363. _shape7.highlightStyle = ShapeFactory.transformStyle(sps.highlightStyle);
  52364. Util.copyAttributesWithClip(_shape7, sps, ['x', 'y', 'r', 'style', 'highlightStyle', 'lineWidth', 'text', 'textPosition']);
  52365. return _shape7;
  52366. }
  52367. return null;
  52368. }
  52369. /**
  52370. * @function SuperMap.Feature.ShapeParameters.prototype.transformStyle
  52371. * @description 将用户 feature.style (类 Svg style 标准) 的样式,转换为 levelRenderer 的样式标准(类 CSS-Canvas 样式)
  52372. * @param {Object} style - 用户 style。
  52373. * @returns {Object} 符合 levelRenderer 的 style。
  52374. */
  52375. }], [{
  52376. key: "transformStyle",
  52377. value: function transformStyle(style) {
  52378. var newStyle = {}; //字体 ["font-style", "font-variant", "font-weight", "font-size / line-height", "font-family"];
  52379. var fontStr = ["normal", "normal", "normal", "12", "arial,sans-serif"]; //画笔类型 ["fill", "stroke"];
  52380. var brushType = [true, false];
  52381. for (var ss in style) {
  52382. switch (ss) {
  52383. case "fill":
  52384. brushType[0] = style[ss];
  52385. break;
  52386. case "fillColor":
  52387. newStyle["color"] = style[ss];
  52388. break;
  52389. case "stroke":
  52390. brushType[1] = style[ss];
  52391. break;
  52392. case "strokeWidth":
  52393. newStyle["lineWidth"] = style[ss];
  52394. break;
  52395. case "strokeLinecap":
  52396. newStyle["lineCap"] = style[ss];
  52397. break;
  52398. case "strokeLineJoin":
  52399. newStyle["lineJoin"] = style[ss];
  52400. break;
  52401. case "strokeDashstyle":
  52402. newStyle["lineType"] = style[ss];
  52403. break;
  52404. case "pointRadius":
  52405. newStyle["r"] = style[ss];
  52406. break;
  52407. case "label":
  52408. newStyle["text"] = style[ss];
  52409. break;
  52410. case "labelRect":
  52411. newStyle["labelRect"] = style[ss];
  52412. break;
  52413. case "fontColor":
  52414. newStyle["textColor"] = style[ss];
  52415. break;
  52416. case "fontStyle":
  52417. fontStr[0] = style[ss];
  52418. break;
  52419. case "fontVariant":
  52420. fontStr[1] = style[ss];
  52421. break;
  52422. case "fontWeight":
  52423. fontStr[2] = style[ss];
  52424. break;
  52425. case "fontSize":
  52426. var unit = "";
  52427. if (style[ss] && style[ss].toString().indexOf("px") < 0) {
  52428. unit = "px";
  52429. }
  52430. fontStr[3] = style[ss] + unit;
  52431. break;
  52432. case "fontFamily":
  52433. fontStr[4] = style[ss];
  52434. break;
  52435. case "fontOpacity":
  52436. newStyle["opacity"] = style[ss];
  52437. break;
  52438. case "labelPosition":
  52439. newStyle["textPosition"] = style[ss];
  52440. break;
  52441. case "labelAlign":
  52442. newStyle["textAlign"] = style[ss];
  52443. break;
  52444. case "labelBaseline":
  52445. newStyle["textBaseline"] = style[ss];
  52446. break;
  52447. case "labelRotation":
  52448. newStyle["textRotation"] = style[ss];
  52449. break;
  52450. default:
  52451. newStyle[ss] = style[ss];
  52452. break;
  52453. }
  52454. } //拼接字体字符串
  52455. newStyle["textFont"] = fontStr.join(" "); //画笔类型
  52456. if (brushType[0] === true && brushType[1] === false) {
  52457. newStyle["brushType"] = "fill";
  52458. } else if (brushType[0] === false && brushType[1] === true) {
  52459. newStyle["brushType"] = "stroke";
  52460. } else if (brushType[0] === true && brushType[1] === true) {
  52461. newStyle["brushType"] = "both";
  52462. } else {
  52463. newStyle["brushType"] = "fill";
  52464. } //默认线宽 1
  52465. if (newStyle["lineWidth"] == null) {
  52466. newStyle["lineWidth"] = 1;
  52467. }
  52468. return newStyle;
  52469. }
  52470. /**
  52471. * @function SuperMap.Feature.ShapeParameters.prototype.Background
  52472. * @description 创建一个矩形背景框图形对象。
  52473. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  52474. * @param {Array.<number>} box - 框区域,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  52475. * @param {Object} setting - 图表配置参数,必设参数。本函数中图形配置对象 setting 可设属性:
  52476. * @param {Object} setting.backgroundStyle - 背景样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Rectangle#style>。
  52477. * @param {Array} [setting.backgroundRadius=[0,0,0,0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  52478. * @returns {Object} 背景框图形,一个可视化图形(矩形)对象。
  52479. */
  52480. }, {
  52481. key: "Background",
  52482. value: function Background(shapeFactory, box, setting) {
  52483. var sets = setting ? setting : {}; // 背景框图形参数对象
  52484. var bgSP = new Rectangle_Rectangle(box[0], box[3], Math.abs(box[2] - box[0]), Math.abs(box[3] - box[1])); // 默认样式
  52485. bgSP.style = {
  52486. fillColor: "#f3f3f3"
  52487. }; // 设置用户 style
  52488. if (sets.backgroundStyle) {
  52489. Util.copyAttributesWithClip(bgSP.style, sets.backgroundStyle);
  52490. } // 设置背景框圆角参数
  52491. if (sets.backgroundRadius) {
  52492. bgSP.style["radius"] = sets.backgroundRadius;
  52493. } // 禁止背景框响应事件
  52494. bgSP.clickable = false;
  52495. bgSP.hoverable = false;
  52496. return shapeFactory.createShape(bgSP);
  52497. }
  52498. /**
  52499. * @function SuperMap.Feature.ShapeParameters.prototype.GraphAxis
  52500. * @description 创建一个统计图表坐标轴图形对象组。
  52501. * @param {SuperMap.Feature.ShapeFactory} shapeFactory - 图形工厂对象,必设参数。
  52502. * @param {Array.<number>} dataViewBox - 统计图表模型的数据视图框,长度为 4 的一维数组,像素坐标,[left, bottom, right, top],必设参数。
  52503. * @param {Object} setting - 图表配置参数,必设参数。
  52504. * @param {Object} setting.axisStyle - 坐标轴样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  52505. * @param {boolean} [setting.axisUseArrow=false] - 坐标轴是否使用箭头。
  52506. * @param {number} [setting.axisYTick=0] - y 轴刻度数量,0表示不使用箭头。
  52507. * @param {Array.<string>} setting.axisYLabels - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  52508. * @param {Object} setting.axisYLabelsStyle - y 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  52509. * @param {Array.<number>} [setting.axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正,默认值:0。
  52510. * @param {Array.<string>} setting.axisXLabels - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  52511. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xPositions 数量相同(即标签个数与数据个数相等时), 按照 xPositions 提供的位置在水平方向上排布标签,否则沿数据视图框下面条边等距排布标签。
  52512. * @param {Object} setting.axisXLabelsStyle - x 轴上的标签组样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Label#style>。
  52513. * @param {Array.<number>} [setting.axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:0。
  52514. * @param {boolean} setting.useXReferenceLine - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  52515. * @param {Object} setting.xReferenceLineStyle - 水平参考线样式,此样式对象对象可设属性:<SuperMap.Feature.ShapeParameters.Line#style>。
  52516. * @param {number} [setting.axis3DParameter=0] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  52517. * @param {Object} xShapeInfo - X 方向上的图形信息对象,包含两个属性。
  52518. * @param {Array.<number>} xShapeInfo.xPositions - 图形在 x 轴方向上的像素坐标值,是一个一维数组,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  52519. * @param {number} xShapeInfo.width - 图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  52520. * @returns {Array.<Object>} 统计图表坐标轴图形对象数组。
  52521. */
  52522. }, {
  52523. key: "GraphAxis",
  52524. value: function GraphAxis(shapeFactory, dataViewBox, setting, xShapeInfo) {
  52525. var dvb = dataViewBox;
  52526. var sets = setting ? setting : {}; // 参考线图形对象组
  52527. var refLines = []; //坐标轴箭头对象组
  52528. var arrows = []; // 是否使用参水平考线,默认不使用
  52529. var isAddRefLine = sets.useXReferenceLine ? sets.useXReferenceLine : false; // y 轴上的刻度
  52530. var axisytick = sets.axisYTick && !isNaN(sets.axisYTick) ? sets.axisYTick : 0; // 坐标轴节点数组
  52531. var pois = []; //z 轴箭头数组
  52532. var zArrowPois = []; // x,y 轴主干节点数组
  52533. var xMainPois = [];
  52534. if (axisytick == 0) {
  52535. xMainPois.push([dvb[0], dvb[3] - 5]);
  52536. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  52537. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  52538. var axis3DParameter = parseInt(sets.axis3DParameter);
  52539. var axis3DPoi = [dvb[0] - axis3DParameter, dvb[1] + axis3DParameter]; // 添加 3D 轴节点
  52540. if (sets.axisUseArrow) {
  52541. // 添加 3D 轴箭头节点坐标
  52542. //箭头坐标
  52543. zArrowPois.push([axis3DPoi[0] + 1.5, axis3DPoi[1] - 7.5]);
  52544. zArrowPois.push([axis3DPoi[0] - 1, axis3DPoi[1] + 1]);
  52545. zArrowPois.push([axis3DPoi[0] + 7.5, axis3DPoi[1] - 1.5]); //3D轴
  52546. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52547. } else {
  52548. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52549. }
  52550. xMainPois.push([dvb[0], dvb[1]]);
  52551. }
  52552. xMainPois.push([dvb[2] + 5, dvb[1]]);
  52553. } else {
  52554. // 单位刻度长度
  52555. var unitTick = Math.abs(dvb[1] - dvb[3]) / axisytick; // 刻度 y 坐标
  52556. var thckY = dvb[3];
  52557. xMainPois.push([dvb[0], thckY - 5]);
  52558. for (var i = 0; i < axisytick; i++) {
  52559. xMainPois.push([dvb[0], thckY]);
  52560. xMainPois.push([dvb[0] - 5, thckY]);
  52561. xMainPois.push([dvb[0], thckY]); // 参考线
  52562. if (isAddRefLine) {
  52563. // 参考线参数对象
  52564. var refLineSP = new Line_Line([[dvb[0], thckY], [dvb[2], thckY]]); // 参考线默认样式对象
  52565. refLineSP.style = {
  52566. strokeColor: "#cfcfcf",
  52567. strokeLinecap: "butt",
  52568. strokeLineJoin: "round",
  52569. strokeWidth: 1
  52570. }; // 禁止事件
  52571. refLineSP.clickable = false;
  52572. refLineSP.hoverable = false; // 用户style
  52573. if (sets.xReferenceLineStyle) {
  52574. Util.copyAttributesWithClip(refLineSP.style, sets.xReferenceLineStyle);
  52575. } // 生成参考线图形对象
  52576. refLines.push(shapeFactory.createShape(refLineSP));
  52577. } // y 刻度增量
  52578. thckY += unitTick;
  52579. }
  52580. xMainPois.push([dvb[0], dvb[1]]); // 3D 坐标轴 第三象限平分线
  52581. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  52582. var _axis3DParameter = parseInt(sets.axis3DParameter);
  52583. var _axis3DPoi = [dvb[0] - _axis3DParameter, dvb[1] + _axis3DParameter];
  52584. /*
  52585. // 箭头计算过程
  52586. var axis3DPoiRef = [axis3DPoi[0] + 7, axis3DPoi[1] - 7]; // 7 是 10 为斜边 cos(45度)时邻边的值
  52587. var axis3DPoiLT = [axis3DPoiRef[0] - 4, axis3DPoiRef[1] - 4];
  52588. var axis3DPoiRB = [axis3DPoiRef[0] + 4, axis3DPoiRef[1] + 4];
  52589. if(sets.axisUseArrow){
  52590. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52591. xMainPois.push([axis3DPoiLT[0], axis3DPoiLT[1]]);
  52592. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52593. xMainPois.push([axis3DPoiRB[0], axis3DPoiRB[1]]);
  52594. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52595. }
  52596. else{
  52597. xMainPois.push([axis3DPoi[0], axis3DPoi[1]]);
  52598. }
  52599. */
  52600. // 添加 3D 轴节点
  52601. if (sets.axisUseArrow) {
  52602. // 添加 3D 轴和箭头坐标
  52603. //箭头坐标
  52604. zArrowPois.push([_axis3DPoi[0] + 1.5, _axis3DPoi[1] - 7.5]);
  52605. zArrowPois.push([_axis3DPoi[0] - 1, _axis3DPoi[1] + 1]);
  52606. zArrowPois.push([_axis3DPoi[0] + 7.5, _axis3DPoi[1] - 1.5]); //3D轴
  52607. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  52608. } else {
  52609. xMainPois.push([_axis3DPoi[0], _axis3DPoi[1]]);
  52610. }
  52611. xMainPois.push([dvb[0], dvb[1]]);
  52612. }
  52613. xMainPois.push([dvb[2] + 5, dvb[1]]);
  52614. } // 坐标轴箭头
  52615. if (sets.axisUseArrow) {
  52616. // x 轴箭头节点数组
  52617. var xArrowPois = [[dvb[2] + 5, dvb[1] + 4], [dvb[2] + 13, dvb[1]], [dvb[2] + 5, dvb[1] - 4]]; // y 轴箭头节点数组
  52618. var yArrowPois = [[dvb[0] - 4, dvb[3] - 5], [dvb[0], dvb[3] - 13], [dvb[0] + 4, dvb[3] - 5]]; //x轴箭头
  52619. var xSP = new Polygon_Polygon(xArrowPois);
  52620. xSP.style = {
  52621. fillColor: "#008acd"
  52622. };
  52623. Util.copyAttributesWithClip(xSP.style, sets.axisStyle);
  52624. arrows.push(shapeFactory.createShape(xSP)); //y轴箭头
  52625. var ySP = new Polygon_Polygon(yArrowPois);
  52626. ySP.style = {
  52627. fillColor: "#008acd"
  52628. };
  52629. Util.copyAttributesWithClip(ySP.style, sets.axisStyle);
  52630. arrows.push(shapeFactory.createShape(ySP)); // z轴箭头 坐标轴箭头是否要使用
  52631. if (sets.axis3DParameter && !isNaN(sets.axis3DParameter) && sets.axis3DParameter >= 15) {
  52632. var zSP = new Polygon_Polygon(zArrowPois);
  52633. zSP.style = {
  52634. fillColor: "#008acd"
  52635. };
  52636. Util.copyAttributesWithClip(zSP.style, sets.axisStyle);
  52637. arrows.push(shapeFactory.createShape(zSP));
  52638. }
  52639. } //不带箭头的坐标轴
  52640. pois = xMainPois; // 坐标轴参数对象
  52641. var axisSP = new Line_Line(pois); // 坐标轴默认style
  52642. axisSP.style = {
  52643. strokeLinecap: "butt",
  52644. strokeLineJoin: "round",
  52645. strokeColor: "#008acd",
  52646. strokeWidth: 1
  52647. }; // 用户 style
  52648. if (sets.axisStyle) {
  52649. Util.copyAttributesWithClip(axisSP.style, sets.axisStyle);
  52650. } // 禁止事件
  52651. axisSP.clickable = false;
  52652. axisSP.hoverable = false; // 创建坐标轴图形对象
  52653. var axisMain = [shapeFactory.createShape(axisSP)]; // Y 轴标签
  52654. var yLabels = [];
  52655. if (sets.axisYLabels && sets.axisYLabels.length && sets.axisYLabels.length > 0) {
  52656. var axisYLabels = sets.axisYLabels;
  52657. var len = axisYLabels.length; // 标签偏移量
  52658. var ylOffset = [0, 0];
  52659. if (sets.axisYLabelsOffset && sets.axisYLabelsOffset.length) {
  52660. ylOffset = sets.axisYLabelsOffset;
  52661. }
  52662. if (len == 1) {
  52663. // 标签参数对象
  52664. var labelYSP = new Label(dvb[0] - 5 + ylOffset[0], dvb[3] + ylOffset[1], axisYLabels[0]);
  52665. labelYSP.style = {
  52666. labelAlign: "right"
  52667. }; // 用户 style
  52668. if (sets.axisYLabelsStyle) {
  52669. Util.copyAttributesWithClip(labelYSP.style, sets.axisYLabelsStyle);
  52670. } // 禁止事件
  52671. labelYSP.clickable = false;
  52672. labelYSP.hoverable = false; // 制作标签
  52673. yLabels.push(shapeFactory.createShape(labelYSP));
  52674. } else {
  52675. var labelY = dvb[3]; // y 轴标签单位距离
  52676. var yUnit = Math.abs(dvb[1] - dvb[3]) / (len - 1);
  52677. for (var j = 0; j < len; j++) {
  52678. // 标签参数对象
  52679. var _labelYSP = new Label(dvb[0] - 5 + ylOffset[0], labelY + ylOffset[1], axisYLabels[j]);
  52680. _labelYSP.style = {
  52681. labelAlign: "right"
  52682. }; // 用户 style
  52683. if (sets.axisYLabelsStyle) {
  52684. Util.copyAttributesWithClip(_labelYSP.style, sets.axisYLabelsStyle);
  52685. } // 禁止事件
  52686. _labelYSP.clickable = false;
  52687. _labelYSP.hoverable = false; // 制作标签
  52688. yLabels.push(shapeFactory.createShape(_labelYSP)); // y 轴标签 y 方向增量
  52689. labelY += yUnit;
  52690. }
  52691. }
  52692. } // X 轴标签
  52693. var xLabels = [];
  52694. if (sets.axisXLabels && sets.axisXLabels.length && sets.axisXLabels.length > 0) {
  52695. var axisXLabels = sets.axisXLabels;
  52696. var _len = axisXLabels.length; // 标签偏移量
  52697. var xlOffset = [0, 0];
  52698. if (sets.axisXLabelsOffset && sets.axisXLabelsOffset.length) {
  52699. xlOffset = sets.axisXLabelsOffset;
  52700. } // 标签个数与数据字段个数相等等时,标签在 x 轴均匀排列
  52701. if (xShapeInfo && xShapeInfo.xPositions && xShapeInfo.xPositions.length && xShapeInfo.xPositions.length == _len) {
  52702. var xsCenter = xShapeInfo.xPositions;
  52703. for (var K = 0; K < _len; K++) {
  52704. // 标签参数对象
  52705. var labelXSP = new Label(xsCenter[K] + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[K]); // 默认 style
  52706. labelXSP.style = {
  52707. labelAlign: "center",
  52708. labelBaseline: "top"
  52709. }; // 用户 style
  52710. if (sets.axisXLabelsStyle) {
  52711. Util.copyAttributesWithClip(labelXSP.style, sets.axisXLabelsStyle);
  52712. } // 禁止事件
  52713. labelXSP.clickable = false;
  52714. labelXSP.hoverable = false; // 创建标签对象
  52715. xLabels.push(shapeFactory.createShape(labelXSP));
  52716. }
  52717. } else {
  52718. if (_len == 1) {
  52719. // 标签参数对象
  52720. var _labelXSP = new Label(dvb[0] - 5 + xlOffset[0], dvb[1] + xlOffset[0], axisXLabels[0]); // 默认 style
  52721. _labelXSP.style = {
  52722. labelAlign: "center",
  52723. labelBaseline: "top"
  52724. }; // 用户 style
  52725. if (sets.axisXLabelsStyle) {
  52726. Util.copyAttributesWithClip(_labelXSP.style, sets.axisXLabelsStyle);
  52727. } // 禁止事件
  52728. _labelXSP.clickable = false;
  52729. _labelXSP.hoverable = false; // 创建标签对象
  52730. xLabels.push(shapeFactory.createShape(_labelXSP));
  52731. } else {
  52732. var labelX = dvb[0]; // x 轴标签单位距离
  52733. var xUnit = Math.abs(dvb[2] - dvb[0]) / (_len - 1);
  52734. for (var m = 0; m < _len; m++) {
  52735. // 标签参数对象
  52736. var _labelXSP2 = new Label(labelX + xlOffset[0], dvb[1] + xlOffset[1], axisXLabels[m]); // 默认 style
  52737. _labelXSP2.style = {
  52738. labelAlign: "center",
  52739. labelBaseline: "top"
  52740. }; // 用户 style
  52741. if (sets.axisXLabelsStyle) {
  52742. Util.copyAttributesWithClip(_labelXSP2.style, sets.axisXLabelsStyle);
  52743. } // 禁止事件
  52744. _labelXSP2.clickable = false;
  52745. _labelXSP2.hoverable = false; // 创建标签对象
  52746. xLabels.push(shapeFactory.createShape(_labelXSP2)); // x 轴标签 x 方向增量
  52747. labelX += xUnit;
  52748. }
  52749. }
  52750. }
  52751. } // 组装并返回构成坐标轴的图形
  52752. return refLines.concat(axisMain).concat(yLabels).concat(xLabels).concat(arrows);
  52753. }
  52754. /**
  52755. * @function SuperMap.Feature.ShapeParameters.prototype.ShapeStyleTool
  52756. * @description 一个图形 style 处理工具。此工具将指定的默认 style,通用 style,按 styleGroup 取得的 style 和按数据值 value 范围取得的 style 进行合并,得到图形最终的 style。
  52757. * @param {Object} defaultStyle - 默认style,此样式对象可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。
  52758. * @param {Object} style - 图形对象基础 style,此参数控制图形的基础样式,可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。优先级低于 styleGroup,styleByCodomain。
  52759. * @param {Array.<Object>} styleGroup - 一个 style 数组,优先级低于 styleByCodomain,高于 style。此数组每个元素是样式对象,
  52760. * 其可设属性根据图形类型参考 <{@link SuperMap.Feature.ShapeParameters}> 子类对象的 style 属性。通过 index 参数从 styleGroup 中取 style。
  52761. * @param {Array.<Object>} styleByCodomain - 按数据(参数 value)所在值域范围控制数据的可视化对象样式。
  52762. * (start code)
  52763. * // styleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  52764. * // start: 值域值下限(包含);
  52765. * // end: 值域值上限(不包含);
  52766. * // style: 数据可视化图形的 style,其可设属性根据图形类型参考 <SuperMap.Feature.ShapeParameters> 子类对象的 style 属性。。
  52767. * // dataStyleByCodomain 数组形如:
  52768. * [
  52769. * {
  52770. * start:0,
  52771. * end:250,
  52772. * style:{
  52773. * fillColor:"#00CD00"
  52774. * }
  52775. * },
  52776. * {
  52777. * start:250,
  52778. * end:500,
  52779. * style:{
  52780. * fillColor:"#00EE00"
  52781. * }
  52782. * },
  52783. * {
  52784. * start:500,
  52785. * end:750,
  52786. * style:{
  52787. * fillColor:"#00FF7F"
  52788. * }
  52789. * },
  52790. * {
  52791. * start:750,
  52792. * end:1500,
  52793. * style:{
  52794. * fillColor:"#00FF00"
  52795. * }
  52796. * }
  52797. * ]
  52798. * (end)
  52799. * @param {number} index - styleGroup 的索引值,用于取出 styleGroup 指定的 style。
  52800. * @param {number} value - 数据值,用于取出 styleByCodomain 指定的 style。
  52801. * @returns {Object} 合并后的样式 (style) 对象。
  52802. */
  52803. }, {
  52804. key: "ShapeStyleTool",
  52805. value: function ShapeStyleTool(defaultStyle, style, styleGroup, styleByCodomain, index, value) {
  52806. // 用 defaultStyle 初始化 style 对象
  52807. var finalStyle = defaultStyle ? defaultStyle : {}; // 基础 style
  52808. if (style) {
  52809. Util.copyAttributesWithClip(finalStyle, style);
  52810. } // 按索引赋 style
  52811. if (styleGroup && styleGroup.length && typeof index !== "undefined" && !isNaN(index) && index >= 0) {
  52812. if (styleGroup[index]) {
  52813. Util.copyAttributesWithClip(finalStyle, styleGroup[index]);
  52814. }
  52815. } // 按值域赋 style
  52816. if (styleByCodomain && styleByCodomain.length && typeof value !== "undefined") {
  52817. var dsc = styleByCodomain;
  52818. var dscLen = dsc.length;
  52819. var v = parseFloat(value);
  52820. for (var i = 0; i < dscLen; i++) {
  52821. if (dsc[i].start <= v && v < dsc[i].end) {
  52822. Util.copyAttributesWithClip(finalStyle, dsc[i].style);
  52823. break;
  52824. }
  52825. }
  52826. }
  52827. return finalStyle;
  52828. }
  52829. }]);
  52830. return ShapeFactory;
  52831. }();
  52832. SuperMap.Feature = SuperMap.Feature || {};
  52833. SuperMap.Feature.ShapeFactory = ShapeFactory;
  52834. ;// CONCATENATED MODULE: ./src/common/overlay/feature/Theme.js
  52835. function feature_Theme_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52836. 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); } }
  52837. function feature_Theme_createClass(Constructor, protoProps, staticProps) { if (protoProps) feature_Theme_defineProperties(Constructor.prototype, protoProps); if (staticProps) feature_Theme_defineProperties(Constructor, staticProps); return Constructor; }
  52838. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  52839. * This program are made available under the terms of the Apache License, Version 2.0
  52840. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52841. /**
  52842. * @class SuperMap.Feature.Theme
  52843. * @category Visualization Theme
  52844. * @classdesc 专题要素基类,此类不可实例化。
  52845. */
  52846. var Theme_Theme = /*#__PURE__*/function () {
  52847. /**
  52848. * @function SuperMap.Feature.Theme.prototype.constructor
  52849. * @description 构造函数。
  52850. * @param {Object} data - 用户数据,用于生成可视化 shape,必设参数。
  52851. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层,必设参数。
  52852. * @returns {SuperMap.Feature.Theme} 返回一个专题要素。
  52853. */
  52854. function Theme(data, layer) {
  52855. feature_Theme_classCallCheck(this, Theme);
  52856. if (!data) {
  52857. return;
  52858. } // layer 必须已经添加到地图, 且已初始化渲染器
  52859. if (!layer || !layer.map || !layer.renderer) {
  52860. return;
  52861. }
  52862. /**
  52863. * @member {string} SuperMap.Feature.Theme.prototype.id
  52864. * @description 专题要素唯一标识。
  52865. */
  52866. this.id = Util.createUniqueID(this.CLASS_NAME + "_");
  52867. /**
  52868. * @member {SuperMap.LonLat} SuperMap.Feature.Theme.prototype.lonlat
  52869. * @description 专题要素地理参考位置。子类中必须根据用户数据(或地理位置参数)对其赋值。
  52870. */
  52871. this.lonlat = null;
  52872. /**
  52873. * @member {Array} SuperMap.Feature.Theme.prototype.location
  52874. * @description 专题要素像素参考位置。通常由地理参考位置决定。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  52875. */
  52876. this.location = [];
  52877. /**
  52878. * @readonly
  52879. * @member {Object} SuperMap.Feature.Theme.prototype.data
  52880. * @description 用户数据,用于生成可视化 shape,可在子类中规定数据格式或类型,如:<SuperMap.Feature.Vector>。
  52881. */
  52882. this.data = data;
  52883. /**
  52884. * @readonly
  52885. * @member {Array} SuperMap.Feature.Theme.prototype.shapes
  52886. * @description 构成此专题要素的可视化图形对象数组,数组顺序控制渲染。
  52887. */
  52888. this.shapes = [];
  52889. /**
  52890. * @readonly
  52891. * @member {SuperMap.Layer.Theme} SuperMap.Feature.Theme.prototype.layer
  52892. * @description 此专题要素所在专题图层。
  52893. */
  52894. this.layer = layer;
  52895. this.CLASS_NAME = "SuperMap.Feature.Theme";
  52896. }
  52897. /**
  52898. * @function SuperMap.Feature.Theme.prototype.destroy
  52899. * @description 销毁专题要素。
  52900. */
  52901. feature_Theme_createClass(Theme, [{
  52902. key: "destroy",
  52903. value: function destroy() {
  52904. this.data = null;
  52905. this.id = null;
  52906. this.lonlat = null;
  52907. this.location = null;
  52908. this.shapes = null;
  52909. this.layer = null;
  52910. }
  52911. /**
  52912. * @function SuperMap.Feature.Theme.prototype.getLocalXY
  52913. * @description 地理坐标转为像素坐标。
  52914. * @param {(SuperMap.Geometry.Point|SuperMap.Geometry.GeoText|SuperMap.LonLat)} coordinate - 地理坐标点。
  52915. * @returns {Array} 长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  52916. */
  52917. }, {
  52918. key: "getLocalXY",
  52919. value: function getLocalXY(coordinate) {
  52920. var resolution = this.layer.map.getResolution();
  52921. var extent = this.layer.map.getExtent();
  52922. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  52923. var x = coordinate.x / resolution + -extent.left / resolution;
  52924. var y = extent.top / resolution - coordinate.y / resolution;
  52925. return [x, y];
  52926. } else if (coordinate instanceof LonLat) {
  52927. var _x = coordinate.lon / resolution + -extent.left / resolution;
  52928. var _y = extent.top / resolution - coordinate.lat / resolution;
  52929. return [_x, _y];
  52930. } else {
  52931. return null;
  52932. }
  52933. }
  52934. }]);
  52935. return Theme;
  52936. }();
  52937. SuperMap.Feature = SuperMap.Feature || {};
  52938. SuperMap.Feature.Theme = Theme_Theme;
  52939. ;// CONCATENATED MODULE: ./src/common/overlay/Graph.js
  52940. function Graph_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Graph_typeof = function _typeof(obj) { return typeof obj; }; } else { Graph_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Graph_typeof(obj); }
  52941. function Graph_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  52942. 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); } }
  52943. function Graph_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graph_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graph_defineProperties(Constructor, staticProps); return Constructor; }
  52944. function Graph_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Graph_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Graph_get(target, property, receiver || target); }
  52945. function Graph_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Graph_getPrototypeOf(object); if (object === null) break; } return object; }
  52946. 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 } }); if (superClass) Graph_setPrototypeOf(subClass, superClass); }
  52947. function Graph_setPrototypeOf(o, p) { Graph_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Graph_setPrototypeOf(o, p); }
  52948. 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); }; }
  52949. function Graph_possibleConstructorReturn(self, call) { if (call && (Graph_typeof(call) === "object" || typeof call === "function")) { return call; } return Graph_assertThisInitialized(self); }
  52950. function Graph_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  52951. function Graph_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  52952. function Graph_getPrototypeOf(o) { Graph_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Graph_getPrototypeOf(o); }
  52953. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  52954. * This program are made available under the terms of the Apache License, Version 2.0
  52955. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  52956. /**
  52957. * @class SuperMap.Feature.Theme.Graph
  52958. * @classdesc 统计专题要素基类。
  52959. * @category Visualization Theme
  52960. * @description 此类定义了统计专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  52961. * 统计专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.Graph.setting> 的基础属性只有 7 个,
  52962. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  52963. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  52964. * @extends SuperMap.Feature.Theme
  52965. * @param {SuperMap.Feature.Vector} data - 用户数据。
  52966. * @param {SuperMap.Layer.Theme} layer - 此专题要素所在图层。
  52967. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  52968. * @param {Object} setting - 图表配置对象。
  52969. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  52970. */
  52971. var Graph = /*#__PURE__*/function (_Theme) {
  52972. Graph_inherits(Graph, _Theme);
  52973. var _super = Graph_createSuper(Graph);
  52974. function Graph(data, layer, fields, setting, lonlat, options) {
  52975. var _this;
  52976. Graph_classCallCheck(this, Graph);
  52977. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  52978. /**
  52979. * @member {SuperMap.Feature.ShapeFactory} SuperMap.Feature.Theme.Graph.prototype.shapeFactory
  52980. * @description 内置的图形工厂对象,调用其 createShape 方法创建图形。
  52981. */
  52982. _this.shapeFactory = new ShapeFactory();
  52983. /**
  52984. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.shapeParameters
  52985. * @description 当前图形参数对象,<SuperMap.Feature.ShapeParameters> 的子类对象。
  52986. */
  52987. _this.shapeParameters = null;
  52988. /**
  52989. * @member {boolean} [SuperMap.Feature.Theme.Graph.prototype.RelativeCoordinate]
  52990. * @description 图形是否已经计算了相对坐标。
  52991. */
  52992. _this.RelativeCoordinate = false;
  52993. /**
  52994. * @member {Object} SuperMap.Feature.Theme.Graph.prototype.setting
  52995. * @description 图表配置对象,该对象控制着图表的可视化显示。
  52996. * @param {number} width - 专题要素(图表)宽度。
  52997. * @param {number} height - 专题要素(图表)高度。
  52998. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  52999. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53000. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53001. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox
  53002. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  53003. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。
  53004. * 如果不设置此参数,在取数据值时不对数据做小数位处理。
  53005. *
  53006. */
  53007. _this.setting = null;
  53008. /**
  53009. * @readonly
  53010. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPoint
  53011. * @description 专题要素(图表)原点,图表左上角点像素坐标,是长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53012. */
  53013. _this.origonPoint = null;
  53014. /**
  53015. * @readonly
  53016. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.chartBox
  53017. * @description 专题要素(图表)区域,即图表框,长度为 4 的一维数组,数组的 4 个元素依次表示图表框左端 x 坐标值、
  53018. * 下端 y坐标值、 右端 x坐标值、 上端 y 坐标值;[left, bottom, right, top]。
  53019. */
  53020. _this.chartBox = null;
  53021. /**
  53022. * @readonly
  53023. * @member {SuperMap.Bounds} SuperMap.Feature.Theme.Graph.prototype.chartBounds
  53024. * @description 图表 Bounds 随着 lonlat、XOffset、YOffset 更新,注意 chartBounds 是图表像素范围,不是地理范围。
  53025. */
  53026. _this.chartBounds = null;
  53027. /**
  53028. * @readonly
  53029. * @member {number} SuperMap.Feature.Theme.Graph.prototype.width
  53030. * @description 专题要素(图表)宽度 。
  53031. */
  53032. _this.width = null;
  53033. /**
  53034. * @readonly
  53035. * @member {number} SuperMap.Feature.Theme.Graph.prototype.height
  53036. * @description 专题要素(图表)高度 。
  53037. */
  53038. _this.height = null;
  53039. /**
  53040. * @readonly
  53041. * @member {number} SuperMap.Feature.Theme.Graph.prototype.XOffset
  53042. * @description 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53043. */
  53044. _this.XOffset = 0;
  53045. /**
  53046. * @readonly
  53047. * @member {number} SuperMap.Feature.Theme.Graph.prototype.YOffset
  53048. * @description 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53049. */
  53050. _this.YOffset = 0;
  53051. /**
  53052. * @readonly
  53053. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBParameter
  53054. * @description 数据视图框参数,长度为 4 的一维数组(数组元素值 >= 0),[leftOffset, bottomOffset, rightOffset, topOffset],chartBox 内偏距值。
  53055. * 此属性用于指定数据视图框 dataViewBox 的范围。
  53056. */
  53057. _this.DVBParameter = null;
  53058. /**
  53059. * @readonly
  53060. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataViewBox
  53061. * @description 数据视图框,长度为 4 的一维数组,[left, bottom, right, top]。
  53062. * dataViewBox 是统计专题要素最核心的内容,它负责解释数据在一个像素区域里的数据可视化含义,
  53063. * 这种含义用可视化图形表达出来,这些表示数据的图形和一些辅助图形组合在一起构成统计专题图表。
  53064. */
  53065. _this.dataViewBox = null;
  53066. /**
  53067. * @readonly
  53068. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCodomain
  53069. * @description 数据视图框的内允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53070. * dataViewBox 中允许的数据范围,对数据溢出值域范围情况的处理需要在 assembleShapes 中进行。
  53071. */
  53072. _this.DVBCodomain = null;
  53073. /**
  53074. * @readonly
  53075. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBCenterPoint
  53076. * @description 数据视图框中心点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53077. */
  53078. _this.DVBCenterPoint = null;
  53079. /**
  53080. * @readonly
  53081. * @member {string} SuperMap.Feature.Theme.Graph.prototype.DVBUnitValue
  53082. * @description 单位值。在 assembleShapes() 中初始化其具体意义,例如:饼图的 DVBUnitValue 可以定义为"360/数据总和",
  53083. * 折线图的 DVBUnitValue 可以定义为 "DVBCodomain/DVBHeight"。
  53084. */
  53085. _this.DVBUnitValue = null;
  53086. /**
  53087. * @readonly
  53088. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.DVBOrigonPoint
  53089. * @description 数据视图框原点,数据视图框左上角点,长度为 2 的一维数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53090. */
  53091. _this.DVBOrigonPoint = null;
  53092. /**
  53093. * @readonly
  53094. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBWidth
  53095. * @description 数据视图框宽度。
  53096. */
  53097. _this.DVBWidth = null;
  53098. /**
  53099. * @readonly
  53100. * @member {number} SuperMap.Feature.Theme.Graph.prototype.DVBHeight
  53101. * @description 数据视图框高度。
  53102. */
  53103. _this.DVBHeight = null;
  53104. /**
  53105. * @readonly
  53106. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.origonPointOffset
  53107. * @description 数据视图框原点相对于图表框的原点偏移量,长度为 2 的一维数组,第一个元素表示 x 偏移量,第二个元素表示 y 偏移量。
  53108. */
  53109. _this.origonPointOffset = null;
  53110. /**
  53111. * @readonly
  53112. * @member {Array.<string>} SuperMap.Feature.Theme.Graph.prototype.fields
  53113. * @description 数据{SuperMap.Feature.Vector}属性字段。
  53114. */
  53115. _this.fields = fields || [];
  53116. /**
  53117. * @readonly
  53118. * @member {Array.<number>} SuperMap.Feature.Theme.Graph.prototype.dataValues
  53119. * @description 图表展示的数据值,通过 fields 从数据 feature 属性中获得。
  53120. */
  53121. _this.dataValues = null; // 图表位置
  53122. if (lonlat) {
  53123. _this.lonlat = lonlat;
  53124. } else {
  53125. // 默认使用 bounds 中心
  53126. _this.lonlat = _this.data.geometry.getBounds().getCenterLonLat();
  53127. } // 配置项检测与赋值
  53128. if (setting && setting.width && setting.height && setting.codomain) {
  53129. _this.setting = setting;
  53130. }
  53131. _this.CLASS_NAME = "SuperMap.Feature.Theme.Graph";
  53132. return _this;
  53133. }
  53134. /**
  53135. * @function SuperMap.Feature.Theme.Graph.prototype.destroy
  53136. * @description 销毁专题要素。
  53137. */
  53138. Graph_createClass(Graph, [{
  53139. key: "destroy",
  53140. value: function destroy() {
  53141. this.shapeFactory = null;
  53142. this.shapeParameters = null;
  53143. this.width = null;
  53144. this.height = null;
  53145. this.origonPoint = null;
  53146. this.chartBox = null;
  53147. this.dataViewBox = null;
  53148. this.chartBounds = null;
  53149. this.DVBParameter = null;
  53150. this.DVBOrigonPoint = null;
  53151. this.DVBCenterPoint = null;
  53152. this.DVBWidth = null;
  53153. this.DVBHeight = null;
  53154. this.DVBCodomain = null;
  53155. this.DVBUnitValue = null;
  53156. this.origonPointOffset = null;
  53157. this.XOffset = null;
  53158. this.YOffset = null;
  53159. this.fields = null;
  53160. this.dataValues = null;
  53161. this.setting = null;
  53162. Graph_get(Graph_getPrototypeOf(Graph.prototype), "destroy", this).call(this);
  53163. }
  53164. /**
  53165. * @function SuperMap.Feature.Theme.Graph.prototype.initBaseParameter
  53166. * @description 初始化专题要素(图表)基础参数。在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  53167. * 调用此函数关系到 setting 对象的以下属性。
  53168. * @param {number} width - 专题要素(图表)宽度。
  53169. * @param {number} height - 专题要素(图表)高度。
  53170. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53171. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53172. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53173. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox。
  53174. * (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  53175. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  53176. * @returns {boolean} 初始化参数是否成功。
  53177. */
  53178. }, {
  53179. key: "initBaseParameter",
  53180. value: function initBaseParameter() {
  53181. // 参数初始化是否成功
  53182. var isSuccess = true; // setting 属性是否已成功赋值
  53183. if (!this.setting) {
  53184. return false;
  53185. }
  53186. var sets = this.setting; // 检测 setting 的必设参数
  53187. if (!(sets.width && sets.height && sets.codomain)) {
  53188. return false;
  53189. } // 数据
  53190. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  53191. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  53192. this.dataValues = dataEffective ? dataEffective : []; // 基础参数 width, height, codomain
  53193. this.width = parseFloat(sets.width);
  53194. this.height = parseFloat(sets.height);
  53195. this.DVBCodomain = sets.codomain; // 图表偏移
  53196. // if(sets.XOffset) {this.XOffset = sets.XOffset};
  53197. // if(sets.YOffset) {this.YOffset = sets.YOffset};
  53198. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  53199. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  53200. this.origonPoint = [];
  53201. this.chartBox = [];
  53202. this.dataViewBox = [];
  53203. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  53204. this.DVBOrigonPoint = [];
  53205. this.DVBCenterPoint = [];
  53206. this.origonPointOffset = []; // 图表位置
  53207. this.resetLocation(); // 专题要素宽度 w
  53208. var w = this.width; // 专题要素高度 h
  53209. var h = this.height; // 专题要素像素位置 loc
  53210. var loc = this.location; // 专题要素像素位置 loc
  53211. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  53212. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  53213. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  53214. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  53215. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  53216. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  53217. var dvb = this.dataViewBox; //检查数据视图框是否合法
  53218. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  53219. return false;
  53220. } // 数据视图框原点
  53221. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  53222. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  53223. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  53224. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  53225. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  53226. return isSuccess;
  53227. }
  53228. /**
  53229. * @function SuperMap.Feature.Theme.Graph.prototype.resetLocation
  53230. * @description 根据地理位置 lonlat 重置专题要素(图表)位置。
  53231. * @param {SuperMap.LonLat} lonlat - 专题要素新的像素中心位置。
  53232. * @returns {Array.<number>} - 新专题要素像素参考位置。长度为 2 的数组,第一个元素表示 x 坐标,第二个元素表示 y 坐标。
  53233. */
  53234. }, {
  53235. key: "resetLocation",
  53236. value: function resetLocation(lonlat) {
  53237. if (lonlat) {
  53238. this.lonlat = lonlat;
  53239. } // 获取地理位置对应的像素坐标 newLocalLX
  53240. var newLocalLX = this.getLocalXY(this.lonlat); // 处理偏移量 XOffset, YOffset
  53241. newLocalLX[0] += this.XOffset;
  53242. newLocalLX[1] += this.YOffset; // 将图形位置赋予 location 属性(注意 location 属性表示的是专题要素中心位置)
  53243. this.location = newLocalLX; // 更新图表像素 Bounds
  53244. var w = this.width;
  53245. var h = this.height;
  53246. var loc = this.location;
  53247. this.chartBounds = new Bounds(loc[0] - w / 2, loc[1] + h / 2, loc[0] + w / 2, loc[1] - h / 2); //重新计算当前渐变色
  53248. this.resetLinearGradient();
  53249. return loc;
  53250. }
  53251. /**
  53252. * @function SuperMap.Feature.Theme.Graph.prototype.resetLinearGradient
  53253. * @description resetLocation 中调用 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图渐变色 所以子类实现此方法)。
  53254. */
  53255. }, {
  53256. key: "resetLinearGradient",
  53257. value: function resetLinearGradient() {//子类实现此方法
  53258. }
  53259. /**
  53260. * @function SuperMap.Feature.Theme.Graph.prototype.shapesConvertToRelativeCoordinate
  53261. * @description 将(构成图表)图形的节点转为相对坐标表示,此函数必须且只能在 assembleShapes() 结束时调用。
  53262. */
  53263. }, {
  53264. key: "shapesConvertToRelativeCoordinate",
  53265. value: function shapesConvertToRelativeCoordinate() {
  53266. var shapes = this.shapes;
  53267. var shapeROP = this.location;
  53268. for (var i = 0, len = shapes.length; i < len; i++) {
  53269. shapes[i].refOriginalPosition = shapeROP;
  53270. var style = shapes[i].style;
  53271. for (var sty in style) {
  53272. switch (sty) {
  53273. case "pointList":
  53274. var pl = style[sty];
  53275. for (var j = 0, len2 = pl.length; j < len2; j++) {
  53276. pl[j][0] -= shapeROP[0];
  53277. pl[j][1] -= shapeROP[1];
  53278. }
  53279. break;
  53280. case "x":
  53281. style[sty] -= shapeROP[0];
  53282. break;
  53283. case "y":
  53284. style[sty] -= shapeROP[1];
  53285. break;
  53286. default:
  53287. break;
  53288. }
  53289. }
  53290. }
  53291. this.RelativeCoordinate = true;
  53292. }
  53293. /**
  53294. * @function SuperMap.Feature.Theme.Graph.prototype.assembleShapes
  53295. * @description 图形装配函数。抽象方法,可视化子类必须实现此方法。<br>
  53296. * 重写此方法的步骤:<br>
  53297. * 1. 图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。<br>
  53298. * 2. 调用 initBaseParameter() 方法初始化模型属性值,此步骤必须执行,只有当 initBaseParameter 返回 true 时才可以允许进行后续步骤。<br>
  53299. * 3. 计算图形参数,制作图形,图形组合。在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。<br>
  53300. * 4. 调用 shapesConvertToRelativeCoordinate() 方法,将图形的坐标值转为相对坐标,此步骤必须执行。
  53301. * @example
  53302. * //子类实现 assembleShapes() 接口的步骤示例:
  53303. * assembleShapes: function(){
  53304. * // 第一步:图表的某些特殊配置项(setting)处理,例如多数图表模型需要重新指定 dataViewBoxParameter 的默认值。此步骤是非必须过程。
  53305. *
  53306. * // 图表配置对象
  53307. * var sets = this.setting;
  53308. * // 默认数据视图框,这里展示在使用坐标轴和不使用坐标轴情况下对数据视图框参数赋予不同的默认值
  53309. * if(!sets.dataViewBoxParameter){
  53310. * if(typeof(sets.useAxis) === "undefined" || sets.useAxis){
  53311. * sets.dataViewBoxParameter = [45, 15, 15, 15];
  53312. * }
  53313. * else{
  53314. * sets.dataViewBoxParameter = [5, 5, 5, 5];
  53315. * }
  53316. * }
  53317. *
  53318. * // 第二步:初始化图表模型基本参数,只有在图表模型基本参数初始化成功时才可模型相关属性,如 this.dataViewBox、 this.DVBCodomain等。此步骤是必须过程。
  53319. * if(!this.initBaseParameter()) return;
  53320. *
  53321. * // 第三步:用图形组装图表,在组装图表过程中,应该特别注意数据视图框单位值的定义、数据值溢出值域范围的处理和图形大小自适应。
  53322. * // 定义图表数据视图框中单位值的含义,下面行代码表示将数据视图框单位值定义为数据视图框高度上每像素代表的数据值
  53323. * this.DVBUnitValue = (this.codomain[1] - this.codomain[0])/this.DVBHeight;
  53324. * var uv = this.DVBUnitValue;
  53325. *
  53326. * // 图形参数计算代码......
  53327. *
  53328. * // 关于图形装配,实际上就是利用图形工程对象 this.shapeFactory 的 createShape() 方法通过图形参数对象创建可视化的图形对象,并把这些图形对象按序添加到模型的图形库(his.shapes)中。下面的代码演示创建一个面图形参数对象,并允许通过图形配置对象设置图形的 style 和 highlightStyle,
  53329. * var barParams = new SuperMap.Feature.ShapeParameters.Polygon(poiLists);
  53330. * barParams.style = sets.barStyle? sets.barStyle:{fillColor: "lightblue"};
  53331. * barParams.highlightStyle = sets.barHoverStyle? sets.barHoverStyle:{fillColor: "blue"};
  53332. * // 图形携带数据ID信息
  53333. * barParams.refDataID = this.data.id;
  53334. * // 创建图形并添加到图表图形数组中
  53335. * this.shapes.push(this.shapeFactory.createShape(barParams));
  53336. *
  53337. * // 第四步:调用 shapesConvertToRelativeCoordinate() 方法,将图形库(his.shapes)中的图形转为由相对坐标表示的图形,客户端统计专题图模块从结构上要求可视化图形使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数。此步骤是必须过程。
  53338. * this.shapesConvertToRelativeCoordinate();
  53339. * },
  53340. */
  53341. }, {
  53342. key: "assembleShapes",
  53343. value: function assembleShapes() {//子类必须实现此方法
  53344. }
  53345. /**
  53346. * @function SuperMap.Feature.Theme.Graph.prototype.getLocalXY
  53347. * @description 地理坐标转为像素坐标。
  53348. * @param {SuperMap.Lonlat} lonlat - 带转换的地理坐标。
  53349. * @returns 屏幕像素坐标。
  53350. */
  53351. }, {
  53352. key: "getLocalXY",
  53353. value: function getLocalXY(lonlat) {
  53354. return this.layer.getLocalXY(lonlat);
  53355. }
  53356. }]);
  53357. return Graph;
  53358. }(Theme_Theme);
  53359. /**
  53360. * @function SuperMap.Feature.Theme.getDataValues
  53361. * @description 根据字段名数组获取指定数据(feature)的属性值数组。属性值类型必须为 Number。
  53362. * @param {SuperMap.Feature.Vector} data - 数据。
  53363. * @param {Array.<string>} [fields] - 字段名数组。
  53364. * @param {number} [decimalNumber] - 小数位处理参数,对获取到的属性数据值进行小数位处理。
  53365. * @returns {Array.<string>} 字段名数组对应的属性数据值数组。
  53366. */
  53367. Theme_Theme.getDataValues = function (data, fields, decimalNumber) {
  53368. if (!data.attributes) {
  53369. return false;
  53370. }
  53371. var fieldsValue = [];
  53372. var attrs = data.attributes;
  53373. for (var i = 0; i < fields.length; i++) {
  53374. for (var field in attrs) {
  53375. if (field !== fields[i]) {
  53376. continue;
  53377. } // 数字转换判断
  53378. try {
  53379. if (!isNaN(decimalNumber) && decimalNumber >= 0) {
  53380. fieldsValue.push(parseFloat(attrs[field].toString()).toFixed(decimalNumber));
  53381. } else {
  53382. fieldsValue.push(parseFloat(attrs[field].toString()));
  53383. }
  53384. } catch (e) {
  53385. throw new Error("not a number");
  53386. }
  53387. }
  53388. }
  53389. if (fieldsValue.length === fields.length) {
  53390. return fieldsValue;
  53391. } else {
  53392. return false;
  53393. }
  53394. };
  53395. SuperMap.Feature.Theme.Graph = Graph;
  53396. ;// CONCATENATED MODULE: ./src/common/overlay/Bar.js
  53397. function Bar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Bar_typeof = function _typeof(obj) { return typeof obj; }; } else { Bar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Bar_typeof(obj); }
  53398. function Bar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53399. 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); } }
  53400. function Bar_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar_defineProperties(Constructor, staticProps); return Constructor; }
  53401. function Bar_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Bar_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Bar_get(target, property, receiver || target); }
  53402. function Bar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar_getPrototypeOf(object); if (object === null) break; } return object; }
  53403. 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 } }); if (superClass) Bar_setPrototypeOf(subClass, superClass); }
  53404. function Bar_setPrototypeOf(o, p) { Bar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar_setPrototypeOf(o, p); }
  53405. 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); }; }
  53406. function Bar_possibleConstructorReturn(self, call) { if (call && (Bar_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar_assertThisInitialized(self); }
  53407. function Bar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53408. function Bar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  53409. function Bar_getPrototypeOf(o) { Bar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar_getPrototypeOf(o); }
  53410. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  53411. * This program are made available under the terms of the Apache License, Version 2.0
  53412. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53413. /**
  53414. * @class SuperMap.Feature.Theme.Bar
  53415. * @classdesc 柱状图 。
  53416. * @category Visualization Theme
  53417. * @example
  53418. * // barStyleByCodomain参数用法如下:
  53419. * // barStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  53420. * // start: 值域值下限(包含);
  53421. * // end: 值域值上限(不包含);
  53422. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  53423. * // barStyleByCodomain 数组形如:
  53424. * [
  53425. * {
  53426. * start:0,
  53427. * end:250,
  53428. * style:{
  53429. * fillColor:"#00CD00"
  53430. * }
  53431. * },
  53432. * {
  53433. * start:250,
  53434. * end:500,
  53435. * style:{
  53436. * fillColor:"#00EE00"
  53437. * }
  53438. * },
  53439. * {
  53440. * start:500,
  53441. * end:750,
  53442. * style:{
  53443. * fillColor:"#00FF7F"
  53444. * }
  53445. * },
  53446. * {
  53447. * start:750,
  53448. * end:1500,
  53449. * style:{
  53450. * fillColor:"#00FF00"
  53451. * }
  53452. * }
  53453. * ]
  53454. * @extends SuperMap.Feature.Theme.Graph
  53455. * @param {SuperMap.Feature.Vector} data - 用户数据。
  53456. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  53457. * @param {Array.<string>} fields - data 属性中的参与此图表生成的属性字段名称。
  53458. * @param {SuperMap.Feature.Theme.Bar.setting} setting - 图表配置对象。
  53459. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  53460. */
  53461. var Bar = /*#__PURE__*/function (_Graph) {
  53462. Bar_inherits(Bar, _Graph);
  53463. var _super = Bar_createSuper(Bar);
  53464. function Bar(data, layer, fields, setting, lonlat) {
  53465. var _this;
  53466. Bar_classCallCheck(this, Bar);
  53467. _this = _super.call(this, data, layer, fields, setting, lonlat);
  53468. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar";
  53469. return _this;
  53470. }
  53471. /**
  53472. * @function SuperMap.Feature.Theme.Bar.prototype.destroy
  53473. * @override
  53474. */
  53475. Bar_createClass(Bar, [{
  53476. key: "destroy",
  53477. value: function destroy() {
  53478. Bar_get(Bar_getPrototypeOf(Bar.prototype), "destroy", this).call(this);
  53479. }
  53480. /**
  53481. * @function SuperMap.Feature.Theme.Bar.prototype.assembleShapes
  53482. * @description 图表图形装配函数。
  53483. */
  53484. }, {
  53485. key: "assembleShapes",
  53486. value: function assembleShapes() {
  53487. //默认渐变颜色数组
  53488. var deafaultColors = [["#00FF00", "#00CD00"], ["#00CCFF", "#5E87A2"], ["#00FF66", "#669985"], ["#CCFF00", "#94A25E"], ["#FF9900", "#A2945E"]]; //默认阴影
  53489. var deafaultShawdow = {
  53490. showShadow: true,
  53491. shadowBlur: 8,
  53492. shadowColor: "rgba(100,100,100,0.8)",
  53493. shadowOffsetX: 2,
  53494. shadowOffsetY: 2
  53495. }; // 图表配置对象
  53496. var sets = this.setting;
  53497. if (!sets.barLinearGradient) {
  53498. sets.barLinearGradient = deafaultColors;
  53499. } // 默认数据视图框
  53500. if (!sets.dataViewBoxParameter) {
  53501. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  53502. sets.dataViewBoxParameter = [45, 15, 15, 15];
  53503. } else {
  53504. sets.dataViewBoxParameter = [5, 5, 5, 5];
  53505. }
  53506. } // 重要步骤:初始化参数
  53507. if (!this.initBaseParameter()) {
  53508. return;
  53509. } // 值域
  53510. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  53511. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  53512. var dvb = this.dataViewBox; // 用户数据值
  53513. var fv = this.dataValues;
  53514. if (fv.length < 1) {
  53515. return;
  53516. } // 没有数据
  53517. // 数据溢出值域范围处理
  53518. for (var _i = 0, fvLen = fv.length; _i < fvLen; _i++) {
  53519. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  53520. return;
  53521. }
  53522. } // 获取 x 轴上的图形信息
  53523. var xShapeInfo = this.calculateXShapeInfo();
  53524. if (!xShapeInfo) {
  53525. return;
  53526. } // 每个柱条 x 位置
  53527. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  53528. var xsWdith = xShapeInfo.width; // 背景框,默认启用
  53529. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  53530. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  53531. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  53532. } // 坐标轴, 默认启用
  53533. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  53534. // 添加坐标轴图形数组
  53535. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  53536. }
  53537. for (var i = 0; i < fv.length; i++) {
  53538. // 计算柱条 top 边的 y 轴坐标值
  53539. var yPx = dvb[1] - (fv[i] - codomain[0]) / this.DVBUnitValue; // 柱条节点数组
  53540. 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]]; // 柱条参数对象(一个面参数对象)
  53541. var barParams = new Polygon_Polygon(poiLists); // 柱条 阴影 style
  53542. if (typeof sets.showShadow === "undefined" || sets.showShadow) {
  53543. if (sets.barShadowStyle) {
  53544. var sss = sets.barShadowStyle;
  53545. if (sss.shadowBlur) {
  53546. deafaultShawdow.shadowBlur = sss.shadowBlur;
  53547. }
  53548. if (sss.shadowColor) {
  53549. deafaultShawdow.shadowColor = sss.shadowColor;
  53550. }
  53551. if (sss.shadowOffsetX) {
  53552. deafaultShawdow.shadowOffsetX = sss.shadowOffsetX;
  53553. }
  53554. if (sss.shadowOffsetY) {
  53555. deafaultShawdow.shadowOffsetY = sss.shadowOffsetY;
  53556. }
  53557. }
  53558. barParams.style = {};
  53559. Util.copyAttributesWithClip(barParams.style, deafaultShawdow);
  53560. } // 图形携带的数据信息
  53561. barParams.refDataID = this.data.id;
  53562. barParams.dataInfo = {
  53563. field: this.fields[i],
  53564. value: fv[i]
  53565. }; // 柱条 hover click
  53566. if (typeof sets.barHoverAble !== "undefined") {
  53567. barParams.hoverable = sets.barHoverAble;
  53568. }
  53569. if (typeof sets.barClickAble !== "undefined") {
  53570. barParams.clickable = sets.barClickAble;
  53571. } // 创建柱条并添加到图表图形数组中
  53572. this.shapes.push(this.shapeFactory.createShape(barParams));
  53573. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  53574. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  53575. this.shapesConvertToRelativeCoordinate();
  53576. }
  53577. /**
  53578. * @function SuperMap.Feature.Theme.Bar.prototype.calculateXShapeInfo
  53579. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  53580. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  53581. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  53582. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  53583. * 本函数中图形配置对象 setting 可设属性:
  53584. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  53585. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  53586. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  53587. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  53588. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  53589. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  53590. *
  53591. */
  53592. }, {
  53593. key: "calculateXShapeInfo",
  53594. value: function calculateXShapeInfo() {
  53595. var dvb = this.dataViewBox; // 数据视图框
  53596. var sets = this.setting; // 图表配置对象
  53597. var fvc = this.dataValues.length; // 数组值个数
  53598. if (fvc < 1) {
  53599. return null;
  53600. }
  53601. var xBlank; // x 轴空白间隔参数
  53602. var xShapePositions = []; // x 轴上图形的位置
  53603. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  53604. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  53605. // x 轴空白间隔参数处理
  53606. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  53607. xBlank = sets.xShapeBlank;
  53608. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  53609. if (xsLen <= fvc) {
  53610. return null;
  53611. }
  53612. xShapeWidth = xsLen / fvc;
  53613. } else {
  53614. // 默认使用等距离空白间隔,空白间隔为图形宽度
  53615. xShapeWidth = dvbWidth / (2 * fvc + 1);
  53616. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  53617. } // 图形 x 轴上的位置计算
  53618. var xOffset = 0;
  53619. for (var i = 0; i < fvc; i++) {
  53620. if (i == 0) {
  53621. xOffset = xBlank[0] + xShapeWidth / 2;
  53622. } else {
  53623. xOffset += xShapeWidth + xBlank[1];
  53624. }
  53625. xShapePositions.push(dvb[0] + xOffset);
  53626. }
  53627. return {
  53628. "xPositions": xShapePositions,
  53629. "width": xShapeWidth
  53630. };
  53631. }
  53632. /**
  53633. * @function SuperMap.Feature.Theme.Bar.prototype.resetLinearGradient
  53634. * @description 图表的相对坐标存在的时候,重新计算渐变的颜色(目前用于二维柱状图 所以子类实现此方法)。
  53635. */
  53636. }, {
  53637. key: "resetLinearGradient",
  53638. value: function resetLinearGradient() {
  53639. if (this.RelativeCoordinate) {
  53640. var shpelength = this.shapes.length;
  53641. var barLinearGradient = this.setting.barLinearGradient;
  53642. var index = -1;
  53643. for (var i = 0; i < shpelength; i++) {
  53644. var shape = this.shapes[i];
  53645. if (shape.CLASS_NAME === "SuperMap.LevelRenderer.Shape.SmicPolygon") {
  53646. var style = shape.style; //计算出当前的绝对 x y
  53647. var x1 = this.location[0] + style.pointList[0][0];
  53648. var x2 = this.location[0] + style.pointList[1][0]; //渐变颜色
  53649. index++; //以防定义的颜色数组不够用
  53650. if (index >= barLinearGradient.length) {
  53651. index = index % barLinearGradient.length;
  53652. }
  53653. var color1 = barLinearGradient[index][0];
  53654. var color2 = barLinearGradient[index][1]; //颜色
  53655. var zcolor = new Color();
  53656. var linearGradient = zcolor.getLinearGradient(x1, 0, x2, 0, [[0, color1], [1, color2]]); //赋值
  53657. shape.style.color = linearGradient;
  53658. }
  53659. }
  53660. }
  53661. }
  53662. }]);
  53663. return Bar;
  53664. }(Graph);
  53665. /**
  53666. * @typedef {Object} SuperMap.Feature.Theme.Bar.setting
  53667. * @property {number} width - 专题要素(图表)宽度。
  53668. * @property {number} height - 专题要素(图表)高度。
  53669. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  53670. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  53671. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  53672. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)
  53673. * 在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];
  53674. * 不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  53675. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  53676. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  53677. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  53678. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  53679. * 则 backgroundRadius 为 [r1、r2、r3、r4]。
  53680. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  53681. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  53682. * @property {boolean} [showShadow=true] - 阴影开关。
  53683. * @property {Object} [barShadowStyle] - 阴影样式,如:{shadowBlur : 8, shadowOffsetX: 2 , shadowOffsetY : 2,shadowColor : "rgba(100,100,100,0.8)"}
  53684. * @property {Array.<string>} [barLinearGradient] - 按字段设置柱条样式[渐变开始颜色,渐变终止颜色] 与 themeLayer.themeFields 中的字段一一对应),
  53685. * 如:[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]
  53686. * @property {boolean} [useAxis=true] - 是否使用坐标轴。</br>
  53687. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  53688. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  53689. * @property {number} [axisYTick=0] - y 轴刻度数量。
  53690. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  53691. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  53692. * @property {Array.<number>} [axisYLabelsOffset=[0,0]] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  53693. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  53694. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  53695. * @property {Array.<number>} [axisXLabelsOffset=[0,0]] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  53696. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  53697. * @property {SuperMap.Feature.ShapeParameters.Line.style} xReferenceLineStyle - 水平参考线样式。
  53698. * @property {Object} barStyle - 柱状图柱条基础 style,此参数控制柱条基础样式,优先级低于 barStyleByFields 和 barStyleByCodomain。
  53699. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByFields - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields|L.supermap.graphThemeLayer.themeFields|ol.source.Graph.themeFields|mapboxgl.supermap.GraphThemeLayer.themeFields>)为柱条赋 style,此参数按字段控制柱条样式,优先级低于 barStyleByCodomain,高于 barStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条使用 style1,字段 POP_1995 对应的柱条使用 style2 ,字段 POP_1999 对应的柱条使用 style3。
  53700. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} barStyleByCodomain - 按柱条代表的数据值所在值域范围控制柱条样式,优先级高于 barStyle 和 barStyleByFields。
  53701. * @property {Object} [barHoverStyle] - 柱条 hover 状态时的样式,barHoverAble 为 true 时有效。
  53702. * @property {Object} [barHoverAble] - 是否允许柱条使用 hover 状态,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  53703. * @property {Object} [barClickAble] - 是否允许柱条被点击,默认允许。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  53704. */
  53705. SuperMap.Feature.Theme.Bar = Bar;
  53706. ;// CONCATENATED MODULE: ./src/common/overlay/Bar3D.js
  53707. function Bar3D_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Bar3D_typeof = function _typeof(obj) { return typeof obj; }; } else { Bar3D_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Bar3D_typeof(obj); }
  53708. function Bar3D_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  53709. 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); } }
  53710. function Bar3D_createClass(Constructor, protoProps, staticProps) { if (protoProps) Bar3D_defineProperties(Constructor.prototype, protoProps); if (staticProps) Bar3D_defineProperties(Constructor, staticProps); return Constructor; }
  53711. function Bar3D_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Bar3D_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Bar3D_get(target, property, receiver || target); }
  53712. function Bar3D_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Bar3D_getPrototypeOf(object); if (object === null) break; } return object; }
  53713. 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 } }); if (superClass) Bar3D_setPrototypeOf(subClass, superClass); }
  53714. function Bar3D_setPrototypeOf(o, p) { Bar3D_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Bar3D_setPrototypeOf(o, p); }
  53715. 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); }; }
  53716. function Bar3D_possibleConstructorReturn(self, call) { if (call && (Bar3D_typeof(call) === "object" || typeof call === "function")) { return call; } return Bar3D_assertThisInitialized(self); }
  53717. function Bar3D_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  53718. function Bar3D_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  53719. function Bar3D_getPrototypeOf(o) { Bar3D_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Bar3D_getPrototypeOf(o); }
  53720. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  53721. * This program are made available under the terms of the Apache License, Version 2.0
  53722. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  53723. /**
  53724. * @class SuperMap.Feature.Theme.Bar3D
  53725. * @classdesc 三维柱状图 。
  53726. * @category Visualization Theme
  53727. * @extends SuperMap.Feature.Theme.Graph
  53728. * @param {SuperMap.Feature.Vector} data - 用户数据。
  53729. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  53730. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  53731. * @param {SuperMap.Feature.Theme.Bar3D.setting} setting - 图表配置对象。
  53732. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  53733. *
  53734. *
  53735. * @example
  53736. * // barFaceStyleByCodomain 用法示例如下:
  53737. * // barFaceStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  53738. * // start: 值域值下限(包含);
  53739. * // end: 值域值上限(不包含);
  53740. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  53741. * // barFaceStyleByCodomain 数组形如:
  53742. * [
  53743. * {
  53744. * start:0,
  53745. * end:250,
  53746. * style:{
  53747. * fillColor:"#00CD00"
  53748. * }
  53749. * },
  53750. * {
  53751. * start:250,
  53752. * end:500,
  53753. * style:{
  53754. * fillColor:"#00EE00"
  53755. * }
  53756. * },
  53757. * {
  53758. * start:500,
  53759. * end:750,
  53760. * style:{
  53761. * fillColor:"#00FF7F"
  53762. * }
  53763. * },
  53764. * {
  53765. * start:750,
  53766. * end:1500,
  53767. * style:{
  53768. * fillColor:"#00FF00"
  53769. * }
  53770. * }
  53771. * ]
  53772. *
  53773. * @example
  53774. * // barSideStyleByCodomain 用法示例如下:
  53775. * // barSideStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  53776. * // start: 值域值下限(包含);
  53777. * // end: 值域值上限(不包含);
  53778. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Polygon.style> 。
  53779. * // barSideStyleByCodomain 数组形如:
  53780. * [
  53781. * {
  53782. * start:0,
  53783. * end:250,
  53784. * style:{
  53785. * fillColor:"#00CD00"
  53786. * }
  53787. * },
  53788. * {
  53789. * start:250,
  53790. * end:500,
  53791. * style:{
  53792. * fillColor:"#00EE00"
  53793. * }
  53794. * },
  53795. * {
  53796. * start:500,
  53797. * end:750,
  53798. * style:{
  53799. * fillColor:"#00FF7F"
  53800. * }
  53801. * },
  53802. * {
  53803. * start:750,
  53804. * end:1500,
  53805. * style:{
  53806. * fillColor:"#00FF00"
  53807. * }
  53808. * }
  53809. * ]
  53810. *
  53811. * @example
  53812. * // barTopStyleByCodomain 用法示例如下:
  53813. * // barTopStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  53814. * // start: 值域值下限(包含);
  53815. * // end: 值域值上限(不包含);
  53816. * // style: 数据可视化图形的 style,这个样式对象的可设属性:<SuperMap.Feature.ShapeParameters.Polygon.style> 。
  53817. * // barTopStyleByCodomain 数组形如:
  53818. * [
  53819. * {
  53820. * start:0,
  53821. * end:250,
  53822. * style:{
  53823. * fillColor:"#00CD00"
  53824. * }
  53825. * },
  53826. * {
  53827. * start:250,
  53828. * end:500,
  53829. * style:{
  53830. * fillColor:"#00EE00"
  53831. * }
  53832. * },
  53833. * {
  53834. * start:500,
  53835. * end:750,
  53836. * style:{
  53837. * fillColor:"#00FF7F"
  53838. * }
  53839. * },
  53840. * {
  53841. * start:750,
  53842. * end:1500,
  53843. * style:{
  53844. * fillColor:"#00FF00"
  53845. * }
  53846. * }
  53847. * ]
  53848. */
  53849. var Bar3D = /*#__PURE__*/function (_Graph) {
  53850. Bar3D_inherits(Bar3D, _Graph);
  53851. var _super = Bar3D_createSuper(Bar3D);
  53852. function Bar3D(data, layer, fields, setting, lonlat) {
  53853. var _this;
  53854. Bar3D_classCallCheck(this, Bar3D);
  53855. _this = _super.call(this, data, layer, fields, setting, lonlat);
  53856. _this.CLASS_NAME = "SuperMap.Feature.Theme.Bar3D";
  53857. return _this;
  53858. }
  53859. /**
  53860. * @function SuperMap.Feature.Theme.Bar3D.prototype.destroy
  53861. * @override
  53862. */
  53863. Bar3D_createClass(Bar3D, [{
  53864. key: "destroy",
  53865. value: function destroy() {
  53866. Bar3D_get(Bar3D_getPrototypeOf(Bar3D.prototype), "destroy", this).call(this);
  53867. }
  53868. /**
  53869. * @function SuperMap.Feature.Theme.Bar3D.prototype.assembleShapes
  53870. * @description 图形装配实现(扩展接口)。
  53871. */
  53872. }, {
  53873. key: "assembleShapes",
  53874. value: function assembleShapes() {
  53875. // 图表配置对象
  53876. var sets = this.setting; // 默认数据视图框
  53877. if (!sets.dataViewBoxParameter) {
  53878. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  53879. sets.dataViewBoxParameter = [45, 25, 20, 20];
  53880. } else {
  53881. sets.dataViewBoxParameter = [5, 5, 5, 5];
  53882. }
  53883. } // 3d 柱图的坐标轴默认使用坐标轴箭头
  53884. sets.axisUseArrow = typeof sets.axisUseArrow !== "undefined" ? sets.axisUseArrow : true;
  53885. sets.axisXLabelsOffset = typeof sets.axisXLabelsOffset !== "undefined" ? sets.axisXLabelsOffset : [-10, 10]; // 重要步骤:初始化参数
  53886. if (!this.initBaseParameter()) {
  53887. return;
  53888. } // 值域
  53889. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  53890. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight; // 数据视图域
  53891. var dvb = this.dataViewBox; // 用户数据值
  53892. var fv = this.dataValues;
  53893. if (fv.length < 1) {
  53894. return;
  53895. } // 没有数据
  53896. // 数据溢出值域范围处理
  53897. for (var i = 0, fvLen = fv.length; i < fvLen; i++) {
  53898. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  53899. return;
  53900. }
  53901. } // 获取 x 轴上的图形信息
  53902. var xShapeInfo = this.calculateXShapeInfo();
  53903. if (!xShapeInfo) {
  53904. return;
  53905. } // 每个柱条 x 位置
  53906. var xsLoc = xShapeInfo.xPositions; // 柱条宽度
  53907. var xsWdith = xShapeInfo.width; // 坐标轴, 默认启用
  53908. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  53909. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  53910. } // 坐标轴
  53911. if (!sets.axis3DParameter || isNaN(sets.axis3DParameter) || sets.axis3DParameter < 15) {
  53912. sets.axis3DParameter = 20;
  53913. }
  53914. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  53915. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  53916. } // 3d 偏移量, 默认值 10;
  53917. var offset3d = sets.bar3DParameter && !isNaN(sets.bar3DParameter) ? sets.bar3DParameter : 10;
  53918. for (var _i = 0; _i < fv.length; _i++) {
  53919. // 无 3d 偏移量时的柱面顶部 y 坐标
  53920. var yPx = dvb[1] - (fv[_i] - codomain[0]) / this.DVBUnitValue; // 无 3d 偏移量时的柱面的左、右端 x 坐标
  53921. var iPoiL = xsLoc[_i] - xsWdith / 2;
  53922. var iPoiR = xsLoc[_i] + xsWdith / 2; // 3d 柱顶面节点
  53923. var bar3DTopPois = [[iPoiL, yPx], [iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]]; // 3d 柱侧面节点
  53924. var bar3DSidePois = [[iPoiR, yPx], [iPoiR - offset3d, yPx + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR, dvb[1]]]; // 3d 柱正面节点
  53925. var bar3DFacePois = [[iPoiL - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, dvb[1] + offset3d], [iPoiR - offset3d, yPx + offset3d], [iPoiL - offset3d, yPx + offset3d]];
  53926. if (offset3d <= 0) {
  53927. // offset3d <= 0 时正面不偏移
  53928. bar3DFacePois = [[iPoiL, dvb[1]], [iPoiR, dvb[1]], [iPoiR, yPx], [iPoiL, yPx]];
  53929. } // 新建 3d 柱面顶面、侧面、正面图形参数对象
  53930. var polyTopSP = new Polygon_Polygon(bar3DTopPois);
  53931. var polySideSP = new Polygon_Polygon(bar3DSidePois);
  53932. var polyFaceSP = new Polygon_Polygon(bar3DFacePois); // 侧面、正面图形 style 默认值
  53933. sets.barSideStyle = sets.barSideStyle ? sets.barSideStyle : sets.barFaceStyle;
  53934. sets.barSideStyleByFields = sets.barSideStyleByFields ? sets.barSideStyleByFields : sets.barFaceStyleByFields;
  53935. sets.barSideStyleByCodomain = sets.barSideStyleByCodomain ? sets.barSideStyleByCodomain : sets.barFaceStyleByCodomain;
  53936. sets.barTopStyle = sets.barTopStyle ? sets.barTopStyle : sets.barFaceStyle;
  53937. sets.barTopStyleByFields = sets.barTopStyleByFields ? sets.barTopStyleByFields : sets.barFaceStyleByFields;
  53938. sets.barTopStyleByCodomain = sets.barTopStyleByCodomain ? sets.barTopStyleByCodomain : sets.barFaceStyleByCodomain; // 顶面、侧面、正面图形 style
  53939. polyFaceSP.style = ShapeFactory.ShapeStyleTool({
  53940. stroke: true,
  53941. strokeColor: "#ffffff",
  53942. fillColor: "#ee9900"
  53943. }, sets.barFaceStyle, sets.barFaceStyleByFields, sets.barFaceStyleByCodomain, _i, fv[_i]);
  53944. polySideSP.style = ShapeFactory.ShapeStyleTool({
  53945. stroke: true,
  53946. strokeColor: "#ffffff",
  53947. fillColor: "#ee9900"
  53948. }, sets.barSideStyle, sets.barSideStyleByFields, sets.barSideStyleByCodomain, _i, fv[_i]);
  53949. polyTopSP.style = ShapeFactory.ShapeStyleTool({
  53950. stroke: true,
  53951. strokeColor: "#ffffff",
  53952. fillColor: "#ee9900"
  53953. }, sets.barTopStyle, sets.barTopStyleByFields, sets.barTopStyleByCodomain, _i, fv[_i]); // 3d 柱条高亮样式
  53954. sets.barSideHoverStyle = sets.barSideHoverStyle ? sets.barSideHoverStyle : sets.barFaceHoverStyle;
  53955. sets.barTopHoverStyle = sets.barTopHoverStyle ? sets.barTopHoverStyle : sets.barFaceHoverStyle;
  53956. polyFaceSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  53957. stroke: true
  53958. }, sets.barFaceHoverStyle);
  53959. polySideSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  53960. stroke: true
  53961. }, sets.barSideHoverStyle);
  53962. polyTopSP.highlightStyle = ShapeFactory.ShapeStyleTool({
  53963. stroke: true
  53964. }, sets.barTopHoverStyle); // 图形携带的数据 id 信息 & 高亮模式
  53965. polyTopSP.refDataID = polySideSP.refDataID = polyFaceSP.refDataID = this.data.id; // hover 模式(组合)
  53966. polyTopSP.isHoverByRefDataID = polySideSP.isHoverByRefDataID = polyFaceSP.isHoverByRefDataID = true; // 高亮组(当鼠标 hover 到组内任何一个图形,整个组的图形都会高亮。refDataHoverGroup 在 isHoverByRefDataID 为 true 时有效)
  53967. polyTopSP.refDataHoverGroup = polySideSP.refDataHoverGroup = polyFaceSP.refDataHoverGroup = Util.createUniqueID("lr_shg"); // 图形携带的数据信息
  53968. polyTopSP.dataInfo = polySideSP.dataInfo = polyFaceSP.dataInfo = {
  53969. field: this.fields[_i],
  53970. value: fv[_i]
  53971. }; // 3d 柱条顶面、侧面、正面图形 hover click 设置
  53972. if (typeof sets.barHoverAble !== "undefined") {
  53973. polyTopSP.hoverable = polySideSP.hoverable = polyFaceSP.hoverable = sets.barHoverAble;
  53974. }
  53975. if (typeof sets.barClickAble !== "undefined") {
  53976. polyTopSP.clickable = polySideSP.clickable = polyFaceSP.clickable = sets.barClickAble;
  53977. } // 创建3d 柱条的顶面、侧面、正面图形并添加到图表的图形列表数组
  53978. this.shapes.push(this.shapeFactory.createShape(polySideSP));
  53979. this.shapes.push(this.shapeFactory.createShape(polyTopSP));
  53980. this.shapes.push(this.shapeFactory.createShape(polyFaceSP));
  53981. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  53982. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  53983. this.shapesConvertToRelativeCoordinate();
  53984. }
  53985. /**
  53986. * @function SuperMap.Feature.Theme.Bar3D.prototype.calculateXShapeInfo
  53987. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  53988. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  53989. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  53990. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  53991. * 本函数中图形配置对象 setting 可设属性:
  53992. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  53993. * 长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,
  53994. * 第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  53995. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:
  53996. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  53997. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  53998. */
  53999. }, {
  54000. key: "calculateXShapeInfo",
  54001. value: function calculateXShapeInfo() {
  54002. var dvb = this.dataViewBox; // 数据视图框
  54003. var sets = this.setting; // 图表配置对象
  54004. var fvc = this.dataValues.length; // 数组值个数
  54005. if (fvc < 1) {
  54006. return null;
  54007. }
  54008. var xBlank; // x 轴空白间隔参数
  54009. var xShapePositions = []; // x 轴上图形的位置
  54010. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  54011. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  54012. // x 轴空白间隔参数处理
  54013. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 3) {
  54014. xBlank = sets.xShapeBlank;
  54015. var xsLen = dvbWidth - (xBlank[0] + xBlank[2] + (fvc - 1) * xBlank[1]);
  54016. if (xsLen <= fvc) {
  54017. return null;
  54018. }
  54019. xShapeWidth = xsLen / fvc;
  54020. } else {
  54021. // 默认使用等距离空白间隔,空白间隔为图形宽度
  54022. xShapeWidth = dvbWidth / (2 * fvc + 1);
  54023. xBlank = [xShapeWidth, xShapeWidth, xShapeWidth];
  54024. } // 图形 x 轴上的位置计算
  54025. var xOffset = 0;
  54026. for (var i = 0; i < fvc; i++) {
  54027. if (i == 0) {
  54028. xOffset = xBlank[0] + xShapeWidth / 2;
  54029. } else {
  54030. xOffset += xShapeWidth + xBlank[1];
  54031. }
  54032. xShapePositions.push(dvb[0] + xOffset);
  54033. }
  54034. return {
  54035. "xPositions": xShapePositions,
  54036. "width": xShapeWidth
  54037. };
  54038. }
  54039. }]);
  54040. return Bar3D;
  54041. }(Graph);
  54042. /**
  54043. * @typedef {Object} SuperMap.Feature.Theme.Bar3D.setting
  54044. * @property {number} width - 专题要素(图表)宽度。
  54045. * @property {number} height - 专题要素(图表)高度。
  54046. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54047. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54048. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54049. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 25, 20, 20];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  54050. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54051. * @property {boolean} [useBackground=true] - 是否使用图表背景框。
  54052. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式。
  54053. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  54054. * @property {Array.<number>} [xShapeBlank] - 水平方向上的图形空白间隔参数。长度为 3 的数组,第一元素表示第一个图形左端与数据视图框左端的空白间距,第二个元素表示图形间空白间距,第三个元素表示最后一个图形右端与数据视图框右端端的空白间距 。
  54055. * @property {number} [bar3DParameter=10] - 3D 柱状参数,3d柱形正面相对于背面向 x 轴和 y 轴负方向偏移的绝对值。
  54056. * @property {boolean} [useAxis=true] - 是否使用坐标轴。
  54057. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  54058. * @property {boolean} [axisUseArrow=true] -坐标轴是否使用箭头。
  54059. * @property {number} [axisYTick=0] - y 轴刻度数量。
  54060. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  54061. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  54062. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正,默认值:0;数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  54063. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,否则沿数据视图框下面条边等距排布标签。
  54064. * @property {SuperMap.Feature.ShapeParameters.Label.style} axisXLabelsStyle - x 轴上的标签组样式。
  54065. * @property {Array.<number>} axisXLabelsOffset - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,默认值:-10;数组第二项表示 x 轴标签组纵向上的偏移量,向下为正,默认值:10。
  54066. * @property {boolean} [useXReferenceLine] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  54067. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  54068. * @property {number} [axis3DParameter=20] - 3D 坐标轴参数,此属性值在大于等于 15 时有效。
  54069. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} barFaceStyle - 3d 柱状图柱条正面基础 style,此参数控制柱条正面基础样式,优先级低于 barFaceStyleByFields 和 barFaceStyleByCodomain。
  54070. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barFaceStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条正面赋 style,此参数按字段控制柱条正面样式,优先级低于 barFaceStyleByCodomain,高于 barFaceStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barFaceStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条正面使用 style1,字段 POP_1995 对应的柱条正面使用 style2 ,字段 POP_1999 对应的柱条正面使用 style3。
  54071. * @property {Array.<Object>} [barFaceStyleByCodomain] - 按柱条正面代表的数据值所在值域范围控制柱条正面样式,优先级高于 barFaceStyle 和 barFaceStyleByFields。
  54072. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barSideStyle=barFaceStyle] - 3d 柱状图柱条侧面基础 style,此参数控制柱条侧面基础样式,优先级低于 barSideStyleByFields 和 barSideStyleByCodomain。
  54073. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barSideStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条侧面赋style,此数按字段控制柱条侧面样式,优先级低于 barSideStyleByCodomain,高于 barSideStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barSideStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条侧面使用 style1,字段 POP_1995对应的柱条侧面使用style2,字段POP_1999对应的柱条侧面使用style3。默认值:barFaceStyleByFields。
  54074. * @property {Array.<Object>} [barSideStyleByCodomain=barFaceStyleByCodomain] - 按柱条侧面代表的数据值所在值域范围控制柱条侧面样式,优先级高于 barSideStyle 和 barSideStyleByFields。
  54075. * @property {Object} [barFaceHoverStyle] - 3d 柱条正面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54076. * @property {Object} [barSideHoverStyle=barFaceHoverStyle] - 3d 柱条侧面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54077. * @property {Object} [barTopHoverStyle=barFaceHoverStyle] - 3d 柱条顶面 hover 状态时的样式,barHoverAble 为 true 时有效。
  54078. * @property {boolean} [barHoverAble=true] - 是否允许柱条使用 hover 状态。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54079. * @property {boolean} [barClickAble=true] - 是否允许柱条被点击。同时设置 barHoverAble 和 barClickAble 为 false,可以直接屏蔽柱条对专题图层事件的响应。
  54080. * @property {SuperMap.Feature.ShapeParameters.Polygon.style} [barTopStyle=barFaceStyle] - 3d 柱状图柱条顶面基础 style,此参数控制柱条顶面基础样式,优先级低于 barTopStyleByFields 和 barTopStyleByCodomain。
  54081. * @property {Array.<SuperMap.Feature.ShapeParameters.Polygon.style>} [barTopStyleByFields=barFaceStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为柱条顶面赋 style,此参数按字段控制柱条顶面样式,优先级低于 barTopStyleByCodomain,高于 barTopStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],barTopStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的柱条顶面使用 style1,字段 POP_1995 对应的柱条顶面使用 style2 ,字段 POP_1999 对应的柱条顶面使用 style3。
  54082. * @property {Array.<Object>} [barTopStyleByCodomain=barFaceStyleByCodomain] - 按柱条顶面代表的数据值所在值域范围控制柱条顶面样式,优先级高于 barTopStyle 和 barTopStyleByFields。
  54083. */
  54084. SuperMap.Feature.Theme.Bar3D = Bar3D;
  54085. ;// CONCATENATED MODULE: ./src/common/overlay/RankSymbol.js
  54086. function RankSymbol_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RankSymbol_typeof = function _typeof(obj) { return typeof obj; }; } else { RankSymbol_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RankSymbol_typeof(obj); }
  54087. function RankSymbol_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54088. 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); } }
  54089. function RankSymbol_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbol_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbol_defineProperties(Constructor, staticProps); return Constructor; }
  54090. function RankSymbol_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { RankSymbol_get = Reflect.get; } 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(receiver); } return desc.value; }; } return RankSymbol_get(target, property, receiver || target); }
  54091. function RankSymbol_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = RankSymbol_getPrototypeOf(object); if (object === null) break; } return object; }
  54092. 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 } }); if (superClass) RankSymbol_setPrototypeOf(subClass, superClass); }
  54093. function RankSymbol_setPrototypeOf(o, p) { RankSymbol_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbol_setPrototypeOf(o, p); }
  54094. 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); }; }
  54095. function RankSymbol_possibleConstructorReturn(self, call) { if (call && (RankSymbol_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbol_assertThisInitialized(self); }
  54096. function RankSymbol_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54097. function RankSymbol_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54098. function RankSymbol_getPrototypeOf(o) { RankSymbol_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbol_getPrototypeOf(o); }
  54099. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54100. * This program are made available under the terms of the Apache License, Version 2.0
  54101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54102. /**
  54103. * @class SuperMap.Feature.Theme.RankSymbol
  54104. * @classdesc 符号专题要素基类。
  54105. * @category Visualization Theme
  54106. * @description 此类定义了符号专题要素基础模型,具体的图表模型通过继承此类,在子类中实现 assembleShapes 方法。
  54107. * 符号专题要素模型采用了可视化图形大小自适应策略,用较少的参数控制着图表诸多图形,图表配置对象 <SuperMap.Feature.Theme.RankSymbol.setting> 的基础属性只有 5 个,
  54108. * 它们控制着图表结构、值域范围、数据小数位等基础图表形态。构成图表的图形必须在图表结构里自适应大小。
  54109. * 此类不可实例化,此类的可实例化子类必须实现 assembleShapes() 方法。
  54110. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54111. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  54112. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54113. * @param {Object} setting - 图表配置对象。
  54114. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54115. *
  54116. * @extends SuperMap.Feature.Theme.Graph
  54117. *
  54118. */
  54119. var RankSymbol = /*#__PURE__*/function (_Graph) {
  54120. RankSymbol_inherits(RankSymbol, _Graph);
  54121. var _super = RankSymbol_createSuper(RankSymbol);
  54122. function RankSymbol(data, layer, fields, setting, lonlat, options) {
  54123. var _this;
  54124. RankSymbol_classCallCheck(this, RankSymbol);
  54125. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  54126. /**
  54127. * @member SuperMap.Feature.Theme.RankSymbol.prototype.setting -{Object}
  54128. * @description 符号配置对象,该对象控制着图表的可视化显示。
  54129. * 下面是此配置对象的 5 个基础可设属性:<br>
  54130. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54131. * @param {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54132. * @param {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54133. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54134. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54135. * 除了以上 5 个基础属性,此对象的可设属性在不同子类中有较大差异,不同子类中对同一属性的解释也可能不同。
  54136. * 请在此类的子类中查看 setting 对象的可设属性和属性含义。
  54137. */
  54138. _this.setting = null; // 配置项检测与赋值
  54139. if (setting && setting.codomain) {
  54140. _this.setting = setting;
  54141. _this.DVBCodomain = _this.setting.codomain;
  54142. }
  54143. _this.CLASS_NAME = "SuperMap.Feature.Theme.RankSymbol";
  54144. return _this;
  54145. }
  54146. /**
  54147. * @function SuperMap.Feature.Theme.RankSymbol.prototype.destroy
  54148. * @description 销毁专题要素。
  54149. */
  54150. RankSymbol_createClass(RankSymbol, [{
  54151. key: "destroy",
  54152. value: function destroy() {
  54153. this.setting = null;
  54154. RankSymbol_get(RankSymbol_getPrototypeOf(RankSymbol.prototype), "destroy", this).call(this);
  54155. }
  54156. /**
  54157. * @function SuperMap.Feature.Theme.RankSymbol.prototype.initBaseParameter
  54158. * @description 初始化专题要素(图形)基础参数。
  54159. * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。
  54160. * 调用此函数关系到 setting 对象的以下属性。
  54161. * @param {Array.<number>} codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54162. * @param {number} [XOffset] - 专题要素(图形)在 X 方向上的偏移值,单位像素。
  54163. * @param {number} [YOffset] - 专题要素(图形)在 Y 方向上的偏移值,单位像素。
  54164. * @param {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,它是指图形框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54165. * @param {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54166. * @returns {boolean} 初始化参数是否成功。
  54167. */
  54168. }, {
  54169. key: "initBaseParameter",
  54170. value: function initBaseParameter() {
  54171. // 参数初始化是否成功
  54172. var isSuccess = true; // setting 属性是否已成功赋值
  54173. if (!this.setting) {
  54174. return false;
  54175. }
  54176. var sets = this.setting; // 图表偏移
  54177. if (sets.XOffset) {
  54178. this.XOffset = sets.XOffset;
  54179. }
  54180. if (sets.YOffset) {
  54181. this.YOffset = sets.YOffset;
  54182. }
  54183. this.XOffset = sets.XOffset ? sets.XOffset : 0;
  54184. this.YOffset = sets.YOffset ? sets.YOffset : 0; // 其他默认值
  54185. this.origonPoint = [];
  54186. this.chartBox = [];
  54187. this.dataViewBox = [];
  54188. this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
  54189. this.DVBOrigonPoint = [];
  54190. this.DVBCenterPoint = [];
  54191. this.origonPointOffset = []; // 图表位置
  54192. this.resetLocation(); // 专题要素宽度 w
  54193. var w = this.width; // 专题要素高度 h
  54194. var h = this.height; // 专题要素像素位置 loc
  54195. var loc = this.location; // 专题要素像素位置 loc
  54196. this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2]; // 专题要素原点(左上角)
  54197. var op = this.origonPoint; // 图表框([left, bottom, right, top])
  54198. this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]]; // 图表框
  54199. var cb = this.chartBox; // 数据视图框参数,它是图表框各方向对应的内偏距
  54200. var dbbP = this.DVBParameter; // 数据视图框 ([left, bottom, right, top])
  54201. this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]]; // 数据视图框
  54202. var dvb = this.dataViewBox; //检查数据视图框是否合法
  54203. if (dvb[0] >= dvb[2] || dvb[1] <= dvb[3]) {
  54204. return false;
  54205. } // 数据视图框原点
  54206. this.DVBOrigonPoint = [dvb[0], dvb[3]]; // 数据视图框宽度
  54207. this.DVBWidth = Math.abs(dvb[2] - dvb[0]); // 数据视图框高度
  54208. this.DVBHeight = Math.abs(dvb[1] - dvb[3]); // 数据视图框中心点
  54209. this.DVBCenterPoint = [this.DVBOrigonPoint[0] + this.DVBWidth / 2, this.DVBOrigonPoint[1] + this.DVBHeight / 2]; // 数据视图框原点与图表框的原点偏移量
  54210. this.origonPointOffset = [this.DVBOrigonPoint[0] - op[0], this.DVBOrigonPoint[1] - op[1]];
  54211. return isSuccess;
  54212. }
  54213. }]);
  54214. return RankSymbol;
  54215. }(Graph);
  54216. SuperMap.Feature.Theme.RankSymbol = RankSymbol;
  54217. ;// CONCATENATED MODULE: ./src/common/overlay/Circle.js
  54218. function overlay_Circle_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Circle_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Circle_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Circle_typeof(obj); }
  54219. function overlay_Circle_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54220. 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); } }
  54221. function overlay_Circle_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Circle_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Circle_defineProperties(Constructor, staticProps); return Constructor; }
  54222. function overlay_Circle_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Circle_get = Reflect.get; } 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(receiver); } return desc.value; }; } return overlay_Circle_get(target, property, receiver || target); }
  54223. function overlay_Circle_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Circle_getPrototypeOf(object); if (object === null) break; } return object; }
  54224. 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 } }); if (superClass) overlay_Circle_setPrototypeOf(subClass, superClass); }
  54225. function overlay_Circle_setPrototypeOf(o, p) { overlay_Circle_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Circle_setPrototypeOf(o, p); }
  54226. 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); }; }
  54227. function overlay_Circle_possibleConstructorReturn(self, call) { if (call && (overlay_Circle_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Circle_assertThisInitialized(self); }
  54228. function overlay_Circle_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54229. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54230. function overlay_Circle_getPrototypeOf(o) { overlay_Circle_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Circle_getPrototypeOf(o); }
  54231. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54232. * This program are made available under the terms of the Apache License, Version 2.0
  54233. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54234. /**
  54235. * @class SuperMap.Feature.Theme.Circle
  54236. * @classdesc 圆类。
  54237. * @category Visualization Theme
  54238. * @extends SuperMap.Feature.Theme.RankSymbol
  54239. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54240. * @param {SuperMap.Layer.RankSymbol} layer - 此专题要素所在图层。
  54241. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54242. * @param {SuperMap.Feature.Theme.Circle.setting} setting - 图表配置对象。
  54243. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置,默认为 data 指代的地理要素 Bounds 中心。
  54244. */
  54245. var Circle = /*#__PURE__*/function (_RankSymbol) {
  54246. overlay_Circle_inherits(Circle, _RankSymbol);
  54247. var _super = overlay_Circle_createSuper(Circle);
  54248. function Circle(data, layer, fields, setting, lonlat) {
  54249. var _this;
  54250. overlay_Circle_classCallCheck(this, Circle);
  54251. _this = _super.call(this, data, layer, fields, setting, lonlat);
  54252. _this.CLASS_NAME = "SuperMap.Feature.Theme.Circle";
  54253. return _this;
  54254. }
  54255. /**
  54256. * @function SuperMap.Feature.Theme.Circle.prototype.destroy
  54257. * @override
  54258. */
  54259. overlay_Circle_createClass(Circle, [{
  54260. key: "destroy",
  54261. value: function destroy() {
  54262. overlay_Circle_get(overlay_Circle_getPrototypeOf(Circle.prototype), "destroy", this).call(this);
  54263. }
  54264. /**
  54265. * @function SuperMap.Feature.Theme.Circle.prototype.assembleShapes
  54266. * @description 装配图形(扩展接口)。
  54267. */
  54268. }, {
  54269. key: "assembleShapes",
  54270. value: function assembleShapes() {
  54271. //默认填充颜色
  54272. var defaultFillColor = "#ff9277"; // setting 属性是否已成功赋值
  54273. if (!this.setting) {
  54274. return false;
  54275. }
  54276. var sets = this.setting; // 检测 setting 的必设参数
  54277. if (!sets.codomain) {
  54278. return false;
  54279. } // 数据
  54280. var decimalNumber = typeof sets.decimalNumber !== "undefined" && !isNaN(sets.decimalNumber) ? sets.decimalNumber : -1;
  54281. var dataEffective = Theme_Theme.getDataValues(this.data, this.fields, decimalNumber);
  54282. this.dataValues = dataEffective ? dataEffective : []; // 数据值数组
  54283. var fv = this.dataValues; //if(fv.length != 1) return; // 没有数据 或者数据不唯一
  54284. //if(fv[0] < 0) return; //数据为负值
  54285. //用户应该定义最大 最小半径 默认最大半径MaxR:100 最小半径MinR:0;
  54286. if (!sets.maxR) {
  54287. sets.maxR = 100;
  54288. }
  54289. if (!sets.minR) {
  54290. sets.minR = 0;
  54291. } // 值域范围
  54292. var codomain = this.DVBCodomain; // 重要步骤:定义Circle数据视图框中单位值的含义,单位值:1所代表的长度
  54293. // 用户定义了值域范围
  54294. if (codomain && codomain[1] - codomain[0] > 0) {
  54295. this.DVBUnitValue = sets.maxR / (codomain[1] - codomain[0]);
  54296. } else {
  54297. //this.DVBUnitValue = sets.maxR / maxValue;
  54298. this.DVBUnitValue = sets.maxR;
  54299. }
  54300. var uv = this.DVBUnitValue; //圆半径
  54301. var r = fv[0] * uv + sets.minR;
  54302. this.width = 2 * r;
  54303. this.height = 2 * r; // 重要步骤:初始化参数
  54304. if (!this.initBaseParameter()) {
  54305. return;
  54306. } //假如用户设置了值域范围 没有在值域范围直接返回
  54307. if (codomain) {
  54308. if (fv[0] < codomain[0] || fv[0] > codomain[1]) {
  54309. return;
  54310. }
  54311. }
  54312. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为圆心
  54313. //圆形对象参数
  54314. var circleSP = new Circle_Circle(dvbCenter[0], dvbCenter[1], r); //circleSP.sytle 初始化
  54315. circleSP.style = ShapeFactory.ShapeStyleTool(null, sets.circleStyle, null, null, 0); //图形的填充颜色
  54316. if (typeof sets.fillColor !== "undefined") {
  54317. //用户自定义
  54318. circleSP.style.fillColor = sets.fillColor;
  54319. } else {
  54320. //当前默认
  54321. circleSP.style.fillColor = defaultFillColor;
  54322. } //圆形 Hover样式
  54323. circleSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.circleHoverStyle); //圆形 Hover 与 click 设置
  54324. if (typeof sets.circleHoverAble !== "undefined") {
  54325. circleSP.hoverable = sets.circleHoverAble;
  54326. }
  54327. if (typeof sets.circleClickAble !== "undefined") {
  54328. circleSP.clickable = sets.circleClickAble;
  54329. } //图形携带的数据信息
  54330. circleSP.refDataID = this.data.id;
  54331. circleSP.dataInfo = {
  54332. field: this.fields[0],
  54333. r: r,
  54334. value: fv[0]
  54335. }; // 创建扇形并把此扇形添加到图表图形数组
  54336. this.shapes.push(this.shapeFactory.createShape(circleSP)); // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  54337. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  54338. this.shapesConvertToRelativeCoordinate();
  54339. }
  54340. }]);
  54341. return Circle;
  54342. }(RankSymbol);
  54343. /**
  54344. * @typedef {Object} SuperMap.Feature.Theme.Circle.setting
  54345. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54346. * @property {number} [maxR] - 圆形的最大半径。
  54347. * @property {number} [minR] - 圆形的最小半径。
  54348. * @property {string} [fillColor] - 圆形的填充色,如:fillColor: "#FFB980"。
  54349. * @property {Object} [circleStyle] - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  54350. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54351. * @property {Object} [circleHoverStyle] - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  54352. * @property {boolean} [circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  54353. * @property {boolean} [circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  54354. *
  54355. */
  54356. SuperMap.Feature.Theme.Circle = Circle;
  54357. ;// CONCATENATED MODULE: ./src/common/overlay/Line.js
  54358. function overlay_Line_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Line_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Line_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Line_typeof(obj); }
  54359. function overlay_Line_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54360. 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); } }
  54361. function overlay_Line_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Line_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Line_defineProperties(Constructor, staticProps); return Constructor; }
  54362. function overlay_Line_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Line_get = Reflect.get; } 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(receiver); } return desc.value; }; } return overlay_Line_get(target, property, receiver || target); }
  54363. function overlay_Line_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Line_getPrototypeOf(object); if (object === null) break; } return object; }
  54364. 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 } }); if (superClass) overlay_Line_setPrototypeOf(subClass, superClass); }
  54365. function overlay_Line_setPrototypeOf(o, p) { overlay_Line_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Line_setPrototypeOf(o, p); }
  54366. 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); }; }
  54367. function overlay_Line_possibleConstructorReturn(self, call) { if (call && (overlay_Line_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Line_assertThisInitialized(self); }
  54368. function overlay_Line_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54369. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54370. function overlay_Line_getPrototypeOf(o) { overlay_Line_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Line_getPrototypeOf(o); }
  54371. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54372. * This program are made available under the terms of the Apache License, Version 2.0
  54373. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54374. /**
  54375. * @class SuperMap.Feature.Theme.Line
  54376. * @classdesc 折线图。
  54377. * @category Visualization Theme
  54378. * @example
  54379. * // pointStyleByCodomain 参数用法示例
  54380. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54381. * // start: 值域值下限(包含);
  54382. * // end: 值域值上限(不包含);
  54383. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  54384. * // pointStyleByCodomain 数组形如:
  54385. * [
  54386. * {
  54387. * start:0,
  54388. * end:250,
  54389. * style:{
  54390. * fillColor:"#00CD00"
  54391. * }
  54392. * },
  54393. * {
  54394. * start:250,
  54395. * end:500,
  54396. * style:{
  54397. * fillColor:"#00EE00"
  54398. * }
  54399. * },
  54400. * {
  54401. * start:500,
  54402. * end:750,
  54403. * style:{
  54404. * fillColor:"#00FF7F"
  54405. * }
  54406. * },
  54407. * {
  54408. * start:750,
  54409. * end:1500,
  54410. * style:{
  54411. * fillColor:"#00FF00"
  54412. * }
  54413. * }
  54414. * ]
  54415. *
  54416. * @extends SuperMap.Feature.Theme.Graph
  54417. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54418. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  54419. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54420. * @param {SuperMap.Feature.Theme.Line.setting} setting - 图表配置对象。
  54421. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54422. */
  54423. var Line = /*#__PURE__*/function (_Graph) {
  54424. overlay_Line_inherits(Line, _Graph);
  54425. var _super = overlay_Line_createSuper(Line);
  54426. function Line(data, layer, fields, setting, lonlat, options) {
  54427. var _this;
  54428. overlay_Line_classCallCheck(this, Line);
  54429. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  54430. _this.CLASS_NAME = "SuperMap.Feature.Theme.Line";
  54431. return _this;
  54432. }
  54433. /**
  54434. * @function SuperMap.Feature.Theme.Line.prototype.destroy
  54435. * @override
  54436. */
  54437. overlay_Line_createClass(Line, [{
  54438. key: "destroy",
  54439. value: function destroy() {
  54440. overlay_Line_get(overlay_Line_getPrototypeOf(Line.prototype), "destroy", this).call(this);
  54441. }
  54442. /**
  54443. * @function SuperMap.Feature.Theme.Line.prototype.assembleShapes
  54444. * @description 装配图形(扩展接口)。
  54445. */
  54446. }, {
  54447. key: "assembleShapes",
  54448. value: function assembleShapes() {
  54449. // 图表配置对象
  54450. var sets = this.setting; // 默认数据视图框
  54451. if (!sets.dataViewBoxParameter) {
  54452. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54453. sets.dataViewBoxParameter = [45, 15, 15, 15];
  54454. } else {
  54455. sets.dataViewBoxParameter = [5, 5, 5, 5];
  54456. }
  54457. } // 重要步骤:初始化参数
  54458. if (!this.initBaseParameter()) {
  54459. return;
  54460. }
  54461. var dvb = this.dataViewBox; // 值域
  54462. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  54463. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  54464. var uv = this.DVBUnitValue; // 数据值数组
  54465. var fv = this.dataValues;
  54466. if (fv.length < 1) {
  54467. return;
  54468. } // 没有数据
  54469. // 获取 x 轴上的图形信息
  54470. var xShapeInfo = this.calculateXShapeInfo();
  54471. if (!xShapeInfo) {
  54472. return;
  54473. } // 折线每个节点的 x 位置
  54474. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  54475. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  54476. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  54477. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  54478. } // 折线图必须使用坐标轴
  54479. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo)); // var isDataEffective = true;
  54480. var xPx; // 折线节点 x 坐标
  54481. var yPx; // 折线节点 y 坐标
  54482. var poiLists = []; // 折线节点数组
  54483. var shapePois = []; // 折线节点图形数组
  54484. for (var i = 0, len = fv.length; i < len; i++) {
  54485. // 数据溢出值域检查
  54486. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  54487. // isDataEffective = false;
  54488. return null;
  54489. }
  54490. xPx = xsLoc[i];
  54491. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 折线节点参数对象
  54492. var poiSP = new Point_Point(xPx, yPx); // 折线节点 style
  54493. poiSP.style = ShapeFactory.ShapeStyleTool({
  54494. fillColor: "#ee9900"
  54495. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 折线节点 hover 样式
  54496. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 折线节点 hover click
  54497. if (typeof sets.pointHoverAble !== "undefined") {
  54498. poiSP.hoverable = sets.pointHoverAble;
  54499. }
  54500. if (typeof sets.pointClickAble !== "undefined") {
  54501. poiSP.clickable = sets.pointClickAble;
  54502. } // 图形携带的数据信息
  54503. poiSP.refDataID = this.data.id;
  54504. poiSP.dataInfo = {
  54505. field: this.fields[i],
  54506. value: fv[i]
  54507. }; // 创建图形并把此图形添加到折线节点图形数组
  54508. shapePois.push(this.shapeFactory.createShape(poiSP)); // 添加折线节点到折线节点数组
  54509. var poi = [xPx, yPx];
  54510. poiLists.push(poi);
  54511. } // 折线参数对象
  54512. var lineSP = new Line_Line(poiLists);
  54513. lineSP.style = ShapeFactory.ShapeStyleTool({
  54514. strokeColor: "#ee9900"
  54515. }, sets.lineStyle); // 禁止事件响应
  54516. lineSP.clickable = false;
  54517. lineSP.hoverable = false;
  54518. var shapeLine = this.shapeFactory.createShape(lineSP);
  54519. this.shapes.push(shapeLine); // 添加节点到图表图形数组
  54520. this.shapes = this.shapes.concat(shapePois); // // 数据范围检测未通过,清空图形
  54521. // if (isDataEffective === false) {
  54522. // this.shapes = [];
  54523. // }
  54524. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  54525. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  54526. this.shapesConvertToRelativeCoordinate();
  54527. }
  54528. /**
  54529. * @function SuperMap.Feature.Theme.Line.prototype.calculateXShapeInfo
  54530. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  54531. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  54532. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  54533. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54534. * 本函数中图形配置对象 setting 可设属性:<br>
  54535. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  54536. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  54537. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  54538. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。<br>
  54539. * width - {number} 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  54540. */
  54541. }, {
  54542. key: "calculateXShapeInfo",
  54543. value: function calculateXShapeInfo() {
  54544. var dvb = this.dataViewBox; // 数据视图框
  54545. var sets = this.setting; // 图表配置对象
  54546. var fvc = this.dataValues.length; // 数组值个数
  54547. if (fvc < 1) {
  54548. return null;
  54549. }
  54550. var xBlank; // x 轴空白间隔参数
  54551. var xShapePositions = []; // x 轴上图形的位置
  54552. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  54553. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  54554. var unitOffset = 0; // 单位偏移量
  54555. // x 轴空白间隔参数处理
  54556. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  54557. xBlank = sets.xShapeBlank;
  54558. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  54559. if (xsLen <= fvc) {
  54560. return null;
  54561. }
  54562. unitOffset = xsLen / (fvc - 1);
  54563. } else {
  54564. // 默认使用等距离空白间隔,空白间隔为图形宽度
  54565. unitOffset = dvbWidth / (fvc + 1);
  54566. xBlank = [unitOffset, unitOffset, unitOffset];
  54567. } // 图形 x 轴上的位置计算
  54568. var xOffset = 0;
  54569. for (var i = 0; i < fvc; i++) {
  54570. if (i == 0) {
  54571. xOffset = xBlank[0];
  54572. } else {
  54573. xOffset += unitOffset;
  54574. }
  54575. xShapePositions.push(dvb[0] + xOffset);
  54576. }
  54577. return {
  54578. "xPositions": xShapePositions,
  54579. "width": xShapeWidth
  54580. };
  54581. }
  54582. }]);
  54583. return Line;
  54584. }(Graph);
  54585. /**
  54586. * @typedef {Object} SuperMap.Feature.Theme.Line.setting
  54587. * @property {number} width - 专题要素(图表)宽度。
  54588. * @property {number} height - 专题要素(图表)高度。
  54589. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54590. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54591. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54592. * @property {Array.<number>} [dataViewBoxParameter] - {Array.<number>} 数据视图框 dataViewBox 参数,
  54593. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54594. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  54595. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54596. * @property {boolean} [useBackground] - 是否使用图表背景框。
  54597. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  54598. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  54599. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  54600. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。长度为 2 的数组,第一元素表示折线左端点与数据视图框左端的空白间距,
  54601. * 第二个元素表示折线右端点右端与数据视图框右端端的空白间距。
  54602. * @property {SuperMap.Feature.ShapeParameters.Line.style} [axisStyle] - 坐标轴样式。
  54603. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  54604. * @property {number} [axisYTick=0] - y 轴刻度数量。
  54605. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  54606. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  54607. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正。
  54608. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  54609. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  54610. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  54611. * 否则沿数据视图框下面条边等距排布标签。
  54612. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  54613. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正;
  54614. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正;
  54615. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  54616. * @property {SuperMap.Feature.ShapeParameters.Line.style} ]xReferenceLineStyle] - 水平参考线样式。
  54617. * @property {SuperMap.Feature.ShapeParameters.Line.style} [lineStyle] - 折线图中折线 style。
  54618. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 折线图中折线节点基础 style,此参数控制折线节点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  54619. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为折线节点赋 style,此参数按字段控制折线节点样式,
  54620. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  54621. * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields|L.supermap.graphThemeLayer.themeFields|ol.source.Graph.themeFields|mapboxgl.supermap.GraphThemeLayer.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  54622. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的折线节点使用 style1,字段 POP_1995 对应的折线节点使用 style2 ,字段 POP_1999 对应的折线节点使用 style3。
  54623. * @property {Array.<Object>} pointStyleByCodomain - 按折线节点代表的数据值所在值域范围控制折线节点样式,优先级高于 pointStyle 和 pointStyleByFields。
  54624. * @property {Object} [pointHoverStyle=true] - 折线节点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  54625. * @property {boolean} [pointHoverAble=true] - 是否允许折线节点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  54626. * @property {boolean} [pointClickAble=true] - 是否允许折线节点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽折线节点对专题图层事件的响应。
  54627. */
  54628. SuperMap.Feature.Theme.Line = Line;
  54629. ;// CONCATENATED MODULE: ./src/common/overlay/Pie.js
  54630. function Pie_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Pie_typeof = function _typeof(obj) { return typeof obj; }; } else { Pie_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Pie_typeof(obj); }
  54631. function Pie_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54632. 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); } }
  54633. function Pie_createClass(Constructor, protoProps, staticProps) { if (protoProps) Pie_defineProperties(Constructor.prototype, protoProps); if (staticProps) Pie_defineProperties(Constructor, staticProps); return Constructor; }
  54634. function Pie_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Pie_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Pie_get(target, property, receiver || target); }
  54635. function Pie_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Pie_getPrototypeOf(object); if (object === null) break; } return object; }
  54636. 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 } }); if (superClass) Pie_setPrototypeOf(subClass, superClass); }
  54637. function Pie_setPrototypeOf(o, p) { Pie_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Pie_setPrototypeOf(o, p); }
  54638. 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); }; }
  54639. function Pie_possibleConstructorReturn(self, call) { if (call && (Pie_typeof(call) === "object" || typeof call === "function")) { return call; } return Pie_assertThisInitialized(self); }
  54640. function Pie_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54641. function Pie_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54642. function Pie_getPrototypeOf(o) { Pie_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Pie_getPrototypeOf(o); }
  54643. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54644. * This program are made available under the terms of the Apache License, Version 2.0
  54645. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54646. /**
  54647. * @class SuperMap.Feature.Theme.Pie
  54648. * @classdesc 饼图。
  54649. * @category Visualization Theme
  54650. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54651. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  54652. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54653. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  54654. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54655. * @extends SuperMap.Feature.Theme.Graph
  54656. * @example
  54657. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54658. * // start: 值域值下限(包含);
  54659. * // end: 值域值上限(不包含);
  54660. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  54661. * // sectorStyleByCodomain 数组形如:
  54662. * [
  54663. * {
  54664. * start:0,
  54665. * end:250,
  54666. * style:{
  54667. * fillColor:"#00CD00"
  54668. * }
  54669. * },
  54670. * {
  54671. * start:250,
  54672. * end:500,
  54673. * style:{
  54674. * fillColor:"#00EE00"
  54675. * }
  54676. * },
  54677. * {
  54678. * start:500,
  54679. * end:750,
  54680. * style:{
  54681. * fillColor:"#00FF7F"
  54682. * }
  54683. * },
  54684. * {
  54685. * start:750,
  54686. * end:1500,
  54687. * style:{
  54688. * fillColor:"#00FF00"
  54689. * }
  54690. * }
  54691. * ]
  54692. * @extends {SuperMap.Feature.Theme.Graph}
  54693. */
  54694. var Pie = /*#__PURE__*/function (_Graph) {
  54695. Pie_inherits(Pie, _Graph);
  54696. var _super = Pie_createSuper(Pie);
  54697. function Pie(data, layer, fields, setting, lonlat) {
  54698. var _this;
  54699. Pie_classCallCheck(this, Pie);
  54700. _this = _super.call(this, data, layer, fields, setting, lonlat);
  54701. _this.CLASS_NAME = "SuperMap.Feature.Theme.Pie";
  54702. return _this;
  54703. }
  54704. /**
  54705. * @function SuperMap.Feature.Theme.Pie.prototype.destroy
  54706. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  54707. */
  54708. Pie_createClass(Pie, [{
  54709. key: "destroy",
  54710. value: function destroy() {
  54711. Pie_get(Pie_getPrototypeOf(Pie.prototype), "destroy", this).call(this);
  54712. }
  54713. /**
  54714. * @function SuperMap.Feature.Theme.Pie.prototype.assembleShapes
  54715. * @description 装配图形(扩展接口)。
  54716. */
  54717. }, {
  54718. key: "assembleShapes",
  54719. value: function assembleShapes() {
  54720. // 图表配置对象
  54721. var sets = this.setting; // 一个默认 style 组
  54722. var defaultStyleGroup = [{
  54723. fillColor: "#ff9277"
  54724. }, {
  54725. fillColor: "#dddd00"
  54726. }, {
  54727. fillColor: "#ffc877"
  54728. }, {
  54729. fillColor: "#bbe3ff"
  54730. }, {
  54731. fillColor: "#d5ffbb"
  54732. }, {
  54733. fillColor: "#bbbbff"
  54734. }, {
  54735. fillColor: "#ddb000"
  54736. }, {
  54737. fillColor: "#b0dd00"
  54738. }, {
  54739. fillColor: "#e2bbff"
  54740. }, {
  54741. fillColor: "#ffbbe3"
  54742. }, {
  54743. fillColor: "#ff7777"
  54744. }, {
  54745. fillColor: "#ff9900"
  54746. }, {
  54747. fillColor: "#83dd00"
  54748. }, {
  54749. fillColor: "#77e3ff"
  54750. }, {
  54751. fillColor: "#778fff"
  54752. }, {
  54753. fillColor: "#c877ff"
  54754. }, {
  54755. fillColor: "#ff77ab"
  54756. }, {
  54757. fillColor: "#ff6600"
  54758. }, {
  54759. fillColor: "#aa8800"
  54760. }, {
  54761. fillColor: "#77c7ff"
  54762. }, {
  54763. fillColor: "#ad77ff"
  54764. }, {
  54765. fillColor: "#ff77ff"
  54766. }, {
  54767. fillColor: "#dd0083"
  54768. }, {
  54769. fillColor: "#777700"
  54770. }, {
  54771. fillColor: "#00aa00"
  54772. }, {
  54773. fillColor: "#0088aa"
  54774. }, {
  54775. fillColor: "#8400dd"
  54776. }, {
  54777. fillColor: "#aa0088"
  54778. }, {
  54779. fillColor: "#dd0000"
  54780. }, {
  54781. fillColor: "#772e00"
  54782. }]; // 重要步骤:初始化参数
  54783. if (!this.initBaseParameter()) {
  54784. return;
  54785. } // 背景框,默认不启用
  54786. if (sets.useBackground) {
  54787. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  54788. } // 数据值数组
  54789. var fv = this.dataValues;
  54790. if (fv.length < 1) {
  54791. return;
  54792. } // 没有数据
  54793. // 值域范围
  54794. var codomain = this.DVBCodomain; // 值域范围检测
  54795. for (var _i = 0; _i < fv.length; _i++) {
  54796. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  54797. return;
  54798. }
  54799. } // 值的绝对值总和
  54800. var valueSum = 0;
  54801. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  54802. valueSum += Math.abs(fv[_i2]);
  54803. } // 重要步骤:定义图表 Pie 数据视图框中单位值的含义,单位值:每度代表的数值
  54804. this.DVBUnitValue = 360 / valueSum;
  54805. var uv = this.DVBUnitValue;
  54806. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  54807. var startAngle = 0; // 扇形起始边角度
  54808. var endAngle = 0; // 扇形终止边角度
  54809. var startAngleTmp = startAngle; // 扇形临时起始边角度
  54810. // 扇形(自适应)半径
  54811. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2;
  54812. for (var i = 0; i < fv.length; i++) {
  54813. var fvi = Math.abs(fv[i]); //计算终止角
  54814. if (i === 0) {
  54815. endAngle = startAngle + fvi * uv;
  54816. } else if (i === fvi.length - 1) {
  54817. endAngle = startAngleTmp;
  54818. } else {
  54819. endAngle = startAngle + fvi * uv;
  54820. } //矫正误差计算
  54821. if (endAngle - startAngle >= 360) {
  54822. endAngle = 359.9999999;
  54823. } // 扇形参数对象
  54824. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle); // 扇形样式
  54825. if (typeof sets.sectorStyleByFields === "undefined") {
  54826. // 使用默认 style 组
  54827. var colorIndex = i % defaultStyleGroup.length;
  54828. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  54829. } else {
  54830. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  54831. } // 扇形 hover 样式
  54832. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  54833. if (typeof sets.sectorHoverAble !== "undefined") {
  54834. sectorSP.hoverable = sets.sectorHoverAble;
  54835. }
  54836. if (typeof sets.sectorClickAble !== "undefined") {
  54837. sectorSP.clickable = sets.sectorClickAble;
  54838. } // 图形携带的数据信息
  54839. sectorSP.refDataID = this.data.id;
  54840. sectorSP.dataInfo = {
  54841. field: this.fields[i],
  54842. value: fv[i]
  54843. }; // 创建扇形并把此扇形添加到图表图形数组
  54844. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  54845. startAngle = endAngle;
  54846. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  54847. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  54848. this.shapesConvertToRelativeCoordinate();
  54849. }
  54850. }]);
  54851. return Pie;
  54852. }(Graph);
  54853. /**
  54854. * @typedef {Object} SuperMap.Feature.Theme.Pie.setting
  54855. * @property {number} width - 专题要素(图表)宽度。
  54856. * @property {number} height - 专题要素(图表)高度。
  54857. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  54858. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  54859. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  54860. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,
  54861. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  54862. * @property {Array.<number>} decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  54863. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  54864. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  54865. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  54866. * @property {SuperMap.Feature.ShapeParameters.Sector.style} sectorStyle - 饼图中扇形的基础 style,此参数控制饼图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  54867. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} sectorStyleByFields - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为饼图扇形赋 style,此参数按字段控制饼图扇形样式,优先级低于 sectorStyleByCodomain,高于 sectorStyle。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  54868. * sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的饼图扇形使用 style1,字段 POP_1995 对应的饼图扇形使用 style2 ,字段 POP_1999 对应的饼图扇形使用 style3。
  54869. * @property {Array.<Object>} sectorStyleByCodomain - 按饼图扇形代表的数据值所在值域范围控制饼图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  54870. * @property {Object} [sectorHoverStyle] 饼图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  54871. * @property {boolean} [sectorHoverAble=true] 是否允许饼图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  54872. * @property {boolean} [sectorClickAble=true] 是否允许饼图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽饼图扇形对专题图层事件的响应。
  54873. */
  54874. SuperMap.Feature.Theme.Pie = Pie;
  54875. ;// CONCATENATED MODULE: ./src/common/overlay/Point.js
  54876. function overlay_Point_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { overlay_Point_typeof = function _typeof(obj) { return typeof obj; }; } else { overlay_Point_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return overlay_Point_typeof(obj); }
  54877. function overlay_Point_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  54878. 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); } }
  54879. function overlay_Point_createClass(Constructor, protoProps, staticProps) { if (protoProps) overlay_Point_defineProperties(Constructor.prototype, protoProps); if (staticProps) overlay_Point_defineProperties(Constructor, staticProps); return Constructor; }
  54880. function overlay_Point_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { overlay_Point_get = Reflect.get; } 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(receiver); } return desc.value; }; } return overlay_Point_get(target, property, receiver || target); }
  54881. function overlay_Point_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = overlay_Point_getPrototypeOf(object); if (object === null) break; } return object; }
  54882. 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 } }); if (superClass) overlay_Point_setPrototypeOf(subClass, superClass); }
  54883. function overlay_Point_setPrototypeOf(o, p) { overlay_Point_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return overlay_Point_setPrototypeOf(o, p); }
  54884. 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); }; }
  54885. function overlay_Point_possibleConstructorReturn(self, call) { if (call && (overlay_Point_typeof(call) === "object" || typeof call === "function")) { return call; } return overlay_Point_assertThisInitialized(self); }
  54886. function overlay_Point_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  54887. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  54888. function overlay_Point_getPrototypeOf(o) { overlay_Point_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return overlay_Point_getPrototypeOf(o); }
  54889. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  54890. * This program are made available under the terms of the Apache License, Version 2.0
  54891. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  54892. /**
  54893. * @class SuperMap.Feature.Theme.Point
  54894. * @classdesc 点状图。
  54895. * @category Visualization Theme
  54896. * @param {SuperMap.Feature.Vector} data - 用户数据。
  54897. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  54898. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  54899. * @param {SuperMap.Feature.Theme.Point.setting} setting - 图表配置对象。
  54900. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  54901. * @example
  54902. * // pointStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  54903. * // start: 值域值下限(包含);
  54904. * // end: 值域值上限(不包含);
  54905. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Point.style> 。
  54906. * // pointStyleByCodomain 数组形如:
  54907. * [
  54908. * {
  54909. * start:0,
  54910. * end:250,
  54911. * style:{
  54912. * fillColor:"#00CD00"
  54913. * }
  54914. * },
  54915. * {
  54916. * start:250,
  54917. * end:500,
  54918. * style:{
  54919. * fillColor:"#00EE00"
  54920. * }
  54921. * },
  54922. * {
  54923. * start:500,
  54924. * end:750,
  54925. * style:{
  54926. * fillColor:"#00FF7F"
  54927. * }
  54928. * },
  54929. * {
  54930. * start:750,
  54931. * end:1500,
  54932. * style:{
  54933. * fillColor:"#00FF00"
  54934. * }
  54935. * }
  54936. * ]
  54937. *@extends {SuperMap.Feature.Theme.Graph}
  54938. */
  54939. var overlay_Point_Point = /*#__PURE__*/function (_Graph) {
  54940. overlay_Point_inherits(Point, _Graph);
  54941. var _super = overlay_Point_createSuper(Point);
  54942. function Point(data, layer, fields, setting, lonlat, options) {
  54943. var _this;
  54944. overlay_Point_classCallCheck(this, Point);
  54945. _this = _super.call(this, data, layer, fields, setting, lonlat, options);
  54946. _this.CLASS_NAME = "SuperMap.Feature.Theme.Point";
  54947. return _this;
  54948. }
  54949. /**
  54950. * @function SuperMap.Feature.Theme.Point.prototype.destroy
  54951. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  54952. */
  54953. overlay_Point_createClass(Point, [{
  54954. key: "destroy",
  54955. value: function destroy() {
  54956. overlay_Point_get(overlay_Point_getPrototypeOf(Point.prototype), "destroy", this).call(this);
  54957. }
  54958. /**
  54959. * @function SuperMap.Feature.Theme.prototype.Point.assembleShapes
  54960. * @description 装配图形(扩展接口)。
  54961. */
  54962. }, {
  54963. key: "assembleShapes",
  54964. value: function assembleShapes() {
  54965. // 图表配置对象
  54966. var sets = this.setting; // 默认数据视图框
  54967. if (!sets.dataViewBoxParameter) {
  54968. if (typeof sets.useAxis === "undefined" || sets.useAxis) {
  54969. sets.dataViewBoxParameter = [45, 15, 15, 15];
  54970. } else {
  54971. sets.dataViewBoxParameter = [5, 5, 5, 5];
  54972. }
  54973. } // 重要步骤:初始化参数
  54974. if (!this.initBaseParameter()) {
  54975. return;
  54976. }
  54977. var dvb = this.dataViewBox; // 值域
  54978. var codomain = this.DVBCodomain; // 重要步骤:定义图表 Bar 数据视图框中单位值的含义
  54979. this.DVBUnitValue = (codomain[1] - codomain[0]) / this.DVBHeight;
  54980. var uv = this.DVBUnitValue;
  54981. var fv = this.dataValues; // 获取 x 轴上的图形信息
  54982. var xShapeInfo = this.calculateXShapeInfo();
  54983. if (!xShapeInfo) {
  54984. return;
  54985. } // 折线每个节点的 x 位置
  54986. var xsLoc = xShapeInfo.xPositions; // 背景框,默认启用
  54987. if (typeof sets.useBackground === "undefined" || sets.useBackground) {
  54988. // 将背景框图形添加到模型的 shapes 数组,注意添加顺序,后添加的图形在先添加的图形之上。
  54989. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  54990. } // 点状图必须使用坐标轴
  54991. this.shapes = this.shapes.concat(ShapeFactory.GraphAxis(this.shapeFactory, dvb, sets, xShapeInfo));
  54992. var xPx; // 图形点 x 坐标
  54993. var yPx; // 图形点 y 坐标
  54994. for (var i = 0, len = fv.length; i < len; i++) {
  54995. // 数据溢出值域检查
  54996. if (fv[i] < codomain[0] || fv[i] > codomain[1]) {
  54997. //isDataEffective = false;
  54998. return null;
  54999. }
  55000. xPx = xsLoc[i];
  55001. yPx = dvb[1] - (fv[i] - codomain[0]) / uv; // 图形点参数对象
  55002. var poiSP = new Point_Point(xPx, yPx); // 图形点 style
  55003. poiSP.style = ShapeFactory.ShapeStyleTool({
  55004. fillColor: "#ee9900"
  55005. }, sets.pointStyle, sets.pointStyleByFields, sets.pointStyleByCodomain, i, fv[i]); // 图形点 hover 样式
  55006. poiSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.pointHoverStyle); // 图形点 hover click
  55007. if (typeof sets.pointHoverAble !== "undefined") {
  55008. poiSP.hoverable = sets.pointHoverAble;
  55009. }
  55010. if (typeof sets.pointClickAble !== "undefined") {
  55011. poiSP.clickable = sets.pointClickAble;
  55012. } // 图形携带的数据信息
  55013. poiSP.refDataID = this.data.id;
  55014. poiSP.dataInfo = {
  55015. field: this.fields[i],
  55016. value: fv[i]
  55017. }; // 创建图形点并把此图形添加到图表图形数组
  55018. this.shapes.push(this.shapeFactory.createShape(poiSP));
  55019. } // 数据范围检测未通过,清空图形
  55020. // if (isDataEffective === false) {
  55021. // this.shapes = [];
  55022. // }
  55023. // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55024. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55025. this.shapesConvertToRelativeCoordinate();
  55026. }
  55027. /**
  55028. * @function SuperMap.Feature.Theme.Point.prototype.calculateXShapeInfo
  55029. * @description 计算 X 轴方向上的图形信息,此信息是一个对象,包含两个属性,
  55030. * 属性 xPositions 是一个一维数组,该数组元素表示图形在 x 轴方向上的像素坐标值,
  55031. * 如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55032. * width 表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55033. * 本函数中图形配置对象 setting 可设属性:<br>
  55034. * xShapeBlank - {Array.<number>} 水平方向上的图形空白间隔参数。
  55035. * 长度为 2 的数组,第一元素表示第折线左端点与数据视图框左端的空白间距,第二个元素表示折线右端点右端与数据视图框右端端的空白间距 。
  55036. * @returns {Object} 如果计算失败,返回 null;如果计算成功,返回 X 轴方向上的图形信息,此信息是一个对象,包含以下两个属性:<br>
  55037. * xPositions - {Array.<number>} 表示图形在 x 轴方向上的像素坐标值,如果图形在 x 方向上有一定宽度,通常取图形在 x 方向上的中心点为图形在 x 方向上的坐标值。
  55038. * width - {number}表示图形的宽度(特别注意:点的宽度始终为 0,而不是其直径)。
  55039. */
  55040. }, {
  55041. key: "calculateXShapeInfo",
  55042. value: function calculateXShapeInfo() {
  55043. var dvb = this.dataViewBox; // 数据视图框
  55044. var sets = this.setting; // 图表配置对象
  55045. var fvc = this.dataValues.length; // 数组值个数
  55046. if (fvc < 1) {
  55047. return null;
  55048. }
  55049. var xBlank; // x 轴空白间隔参数
  55050. var xShapePositions = []; // x 轴上图形的位置
  55051. var xShapeWidth = 0; // x 轴上图形宽度(自适应)
  55052. var dvbWidth = this.DVBWidth; // 数据视图框宽度
  55053. var unitOffset = 0; // 单位偏移量
  55054. // x 轴空白间隔参数处理
  55055. if (sets.xShapeBlank && sets.xShapeBlank.length && sets.xShapeBlank.length == 2) {
  55056. xBlank = sets.xShapeBlank;
  55057. var xsLen = dvbWidth - (xBlank[0] + xBlank[1]);
  55058. if (xsLen <= fvc) {
  55059. return null;
  55060. }
  55061. unitOffset = xsLen / (fvc - 1);
  55062. } else {
  55063. // 默认使用等距离空白间隔,空白间隔为图形宽度
  55064. unitOffset = dvbWidth / (fvc + 1);
  55065. xBlank = [unitOffset, unitOffset, unitOffset];
  55066. } // 图形 x 轴上的位置计算
  55067. var xOffset = 0;
  55068. for (var i = 0; i < fvc; i++) {
  55069. if (i == 0) {
  55070. xOffset = xBlank[0];
  55071. } else {
  55072. xOffset += unitOffset;
  55073. }
  55074. xShapePositions.push(dvb[0] + xOffset);
  55075. }
  55076. return {
  55077. "xPositions": xShapePositions,
  55078. "width": xShapeWidth
  55079. };
  55080. }
  55081. }]);
  55082. return Point;
  55083. }(Graph);
  55084. /**
  55085. * @typedef {Object} SuperMap.Feature.Theme.Point.setting
  55086. * @property {number} width - 专题要素(图表)宽度。
  55087. * @property {number} height - 专题要素(图表)高度。
  55088. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55089. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55090. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55091. * @property {Array.<number>} [dataViewBoxParameter] - 数据视图框 dataViewBox 参数,
  55092. * 它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55093. * 当使用坐标轴时 dataViewBoxParameter 的默认值为:[45, 15, 15, 15];不使用坐标轴时 dataViewBoxParameter 的默认值为:[5, 5, 5, 5]。
  55094. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55095. * @property {boolean} [useBackground] - 是否使用图表背景框。
  55096. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} backgroundStyle - 背景样式。
  55097. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,
  55098. * 则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55099. * @property {Array.<number>} xShapeBlank - 水平方向上的图形空白间隔参数。
  55100. * 长度为 2 的数组,第一个元素表示第一个(沿 x 轴方向)图形点与数据视图框左端的空白间距,第二个元素表示最后一个(沿 x 轴方向)图形点与数据视图框右端端的空白间距 。
  55101. * @property {Object} axisStyle - 坐标轴样式。
  55102. * @property {boolean} [axisUseArrow=false] - 坐标轴是否使用箭头。
  55103. * @property {number} [axisYTick=0] - y 轴刻度数量。
  55104. * @property {Array.<string>} [axisYLabels] - y 轴上的标签组内容,标签顺序沿着数据视图框左面条边自上而下,等距排布。例如:["1000", "750", "500", "250", "0"]。
  55105. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisYLabelsStyle] - y 轴上的标签组样式。
  55106. * @property {Array.<number>} [axisYLabelsOffset=0] - y 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 y 轴标签组横向上的偏移量,向左为正;
  55107. * 数组第二项表示 y 轴标签组纵向上的偏移量,向下为正。
  55108. * @property {Array.<string>} [axisXLabels] - x 轴上的标签组内容,标签顺序沿着数据视图框下面条边自左向右排布,例如:["92年", "95年", "99年"]。
  55109. * 标签排布规则:当标签数量与 xShapeInfo 中的属性 xShapeCenter 数量相同(即标签个数与数据个数相等时), 按照 xShapeCenter 提供的位置排布标签,
  55110. * 否则沿数据视图框下面条边等距排布标签。
  55111. * @property {SuperMap.Feature.ShapeParameters.Label.style} [axisXLabelsStyle] - x 轴上的标签组样式。
  55112. * @property {Array.<number>} [axisXLabelsOffset=0] - x 轴上的标签组偏移量。长度为 2 的数组,数组第一项表示 x 轴标签组横向上的偏移量,向左为正,
  55113. * 数组第二项表示 x 轴标签组纵向上的偏移量,向下为正。
  55114. * @property {boolean} [useXReferenceLine=true] - 是否使用水平参考线,如果为 true,在 axisYTick 大于 0 时有效,水平参考线是 y 轴刻度在数据视图框里的延伸。
  55115. * @property {SuperMap.Feature.ShapeParameters.Line.style} [xReferenceLineStyle] - 水平参考线样式。
  55116. * @property {SuperMap.Feature.ShapeParameters.Point.style} [pointStyle] - 点状图中图形点基础 style,此参数控制图形点基础样式,优先级低于 pointStyleByFields 和 pointStyleByCodomain。
  55117. * @property {Array.<SuperMap.Feature.ShapeParameters.Point.style>} [pointStyleByFields] - 按专题字段 themeFields(<SuperMap.Layer.Graph.themeFields>)为图形点赋 style,此参数按字段控制图形点样式,
  55118. * 优先级低于 pointStyleByCodomain,高于 pointStyle。此数组中的元素是样式对象。
  55119. * 此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],
  55120. * pointStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的图形点使用 style1,字段 POP_1995 对应的图形点使用 style2 ,字段 POP_1999 对应的图形点使用 style3。
  55121. * @property {Array.<Object>} pointStyleByCodomain - 按图形点代表的数据值所在值域范围控制图形点样式,优先级高于 pointStyle 和 pointStyleByFields。
  55122. * @property {Object} [pointHoverStyle] - 图形点 hover 状态时的样式,pointHoverAble 为 true 时有效。
  55123. * @property {Object} [pointHoverAble=true] - 是否允许图形点使用 hover 状态。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  55124. * @property {Object} [pointClickAble=true] - 是否允许图形点被点击。同时设置 pointHoverAble 和 pointClickAble 为 false,可以直接屏蔽图形点对专题图层事件的响应。
  55125. */
  55126. SuperMap.Feature.Theme.Point = overlay_Point_Point;
  55127. ;// CONCATENATED MODULE: ./src/common/overlay/Ring.js
  55128. function Ring_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Ring_typeof = function _typeof(obj) { return typeof obj; }; } else { Ring_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Ring_typeof(obj); }
  55129. function Ring_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55130. 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); } }
  55131. function Ring_createClass(Constructor, protoProps, staticProps) { if (protoProps) Ring_defineProperties(Constructor.prototype, protoProps); if (staticProps) Ring_defineProperties(Constructor, staticProps); return Constructor; }
  55132. function Ring_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Ring_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Ring_get(target, property, receiver || target); }
  55133. function Ring_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Ring_getPrototypeOf(object); if (object === null) break; } return object; }
  55134. 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 } }); if (superClass) Ring_setPrototypeOf(subClass, superClass); }
  55135. function Ring_setPrototypeOf(o, p) { Ring_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Ring_setPrototypeOf(o, p); }
  55136. 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); }; }
  55137. function Ring_possibleConstructorReturn(self, call) { if (call && (Ring_typeof(call) === "object" || typeof call === "function")) { return call; } return Ring_assertThisInitialized(self); }
  55138. function Ring_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55139. function Ring_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  55140. function Ring_getPrototypeOf(o) { Ring_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Ring_getPrototypeOf(o); }
  55141. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  55142. * This program are made available under the terms of the Apache License, Version 2.0
  55143. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55144. /**
  55145. * @class SuperMap.Feature.Theme.Ring
  55146. * @classdesc 环状图。
  55147. * @category Visualization Theme
  55148. * @description 基于路由对象计算指定点 M 值操作的参数类。通过该类提供参数信息。
  55149. * @param {SuperMap.Feature.Vector} data - 用户数据。
  55150. * @param {SuperMap.Layer.Graph} layer - 此专题要素所在图层。
  55151. * @param {Array.<string>} fields - data 中的参与此图表生成的字段名称。
  55152. * @param {SuperMap.Feature.Theme.Ring.setting} setting - 图表配置对象。
  55153. * @param {SuperMap.LonLat} [lonlat] - 专题要素地理位置。默认为 data 指代的地理要素 Bounds 中心。
  55154. * @example
  55155. * // sectorStyleByCodomain 的每个元素是个包含值域信息和与值域对应样式信息的对象,该对象(必须)有三个属性:
  55156. * // start: 值域值下限(包含);
  55157. * // end: 值域值上限(不包含);
  55158. * // style: 数据可视化图形的 style,这个样式对象的可设属性: <SuperMap.Feature.ShapeParameters.Sector.style> 。
  55159. * // sectorStyleByCodomain 数组形如:
  55160. * [
  55161. * {
  55162. * start:0,
  55163. * end:250,
  55164. * style:{
  55165. * fillColor:"#00CD00"
  55166. * }
  55167. * },
  55168. * {
  55169. * start:250,
  55170. * end:500,
  55171. * style:{
  55172. * fillColor:"#00EE00"
  55173. * }
  55174. * },
  55175. * {
  55176. * start:500,
  55177. * end:750,
  55178. * style:{
  55179. * fillColor:"#00FF7F"
  55180. * }
  55181. * },
  55182. * {
  55183. * start:750,
  55184. * end:1500,
  55185. * style:{
  55186. * fillColor:"#00FF00"
  55187. * }
  55188. * }
  55189. * ]
  55190. * @param {Object} [sectorHoverStyle=true] - 环状图扇形 hover 状态时的样式,sectorHoverAble 为 true 时有效。
  55191. * @param {boolean} [sectorHoverAble=true] - 是否允许环状图扇形使用 hover 状态。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  55192. * @param {boolean} [sectorClickAble=true] - 是否允许环状图扇形被点击。同时设置 sectorHoverAble 和 sectorClickAble 为 false,可以直接屏蔽环状图扇形对专题图层事件的响应。
  55193. *
  55194. * @extends {SuperMap.Feature.Theme.Graph}
  55195. */
  55196. var Ring = /*#__PURE__*/function (_Graph) {
  55197. Ring_inherits(Ring, _Graph);
  55198. var _super = Ring_createSuper(Ring);
  55199. function Ring(data, layer, fields, setting, lonlat) {
  55200. var _this;
  55201. Ring_classCallCheck(this, Ring);
  55202. _this = _super.call(this, data, layer, fields, setting, lonlat);
  55203. _this.CLASS_NAME = "SuperMap.Feature.Theme.Ring";
  55204. return _this;
  55205. }
  55206. /**
  55207. * @function SuperMap.Feature.Theme.Ring.prototype.destroy
  55208. * @description 销毁此专题要素。调用 destroy 后此对象所以属性置为 null。
  55209. */
  55210. Ring_createClass(Ring, [{
  55211. key: "destroy",
  55212. value: function destroy() {
  55213. Ring_get(Ring_getPrototypeOf(Ring.prototype), "destroy", this).call(this);
  55214. }
  55215. /**
  55216. * @function SuperMap.Feature.Theme.Ring.prototype.assembleShapes
  55217. * @description 装配图形(扩展接口)。
  55218. */
  55219. }, {
  55220. key: "assembleShapes",
  55221. value: function assembleShapes() {
  55222. // 重要步骤:初始化参数
  55223. if (!this.initBaseParameter()) {
  55224. return;
  55225. } // 一个默认 style 组
  55226. var defaultStyleGroup = [{
  55227. fillColor: "#ff9277"
  55228. }, {
  55229. fillColor: "#dddd00"
  55230. }, {
  55231. fillColor: "#ffc877"
  55232. }, {
  55233. fillColor: "#bbe3ff"
  55234. }, {
  55235. fillColor: "#d5ffbb"
  55236. }, {
  55237. fillColor: "#bbbbff"
  55238. }, {
  55239. fillColor: "#ddb000"
  55240. }, {
  55241. fillColor: "#b0dd00"
  55242. }, {
  55243. fillColor: "#e2bbff"
  55244. }, {
  55245. fillColor: "#ffbbe3"
  55246. }, {
  55247. fillColor: "#ff7777"
  55248. }, {
  55249. fillColor: "#ff9900"
  55250. }, {
  55251. fillColor: "#83dd00"
  55252. }, {
  55253. fillColor: "#77e3ff"
  55254. }, {
  55255. fillColor: "#778fff"
  55256. }, {
  55257. fillColor: "#c877ff"
  55258. }, {
  55259. fillColor: "#ff77ab"
  55260. }, {
  55261. fillColor: "#ff6600"
  55262. }, {
  55263. fillColor: "#aa8800"
  55264. }, {
  55265. fillColor: "#77c7ff"
  55266. }, {
  55267. fillColor: "#ad77ff"
  55268. }, {
  55269. fillColor: "#ff77ff"
  55270. }, {
  55271. fillColor: "#dd0083"
  55272. }, {
  55273. fillColor: "#777700"
  55274. }, {
  55275. fillColor: "#00aa00"
  55276. }, {
  55277. fillColor: "#0088aa"
  55278. }, {
  55279. fillColor: "#8400dd"
  55280. }, {
  55281. fillColor: "#aa0088"
  55282. }, {
  55283. fillColor: "#dd0000"
  55284. }, {
  55285. fillColor: "#772e00"
  55286. }]; // 图表配置对象
  55287. var sets = this.setting; // 背景框,默认不启用
  55288. if (sets.useBackground) {
  55289. this.shapes.push(ShapeFactory.Background(this.shapeFactory, this.chartBox, sets));
  55290. } // 数据值数组
  55291. var fv = this.dataValues;
  55292. if (fv.length < 1) {
  55293. return;
  55294. } // 没有数据
  55295. // 值域范围
  55296. var codomain = this.DVBCodomain; // 值域范围检测
  55297. for (var _i = 0; _i < fv.length; _i++) {
  55298. if (fv[_i] < codomain[0] || fv[_i] > codomain[1]) {
  55299. return;
  55300. }
  55301. } // 值的绝对值总和
  55302. var valueSum = 0;
  55303. for (var _i2 = 0; _i2 < fv.length; _i2++) {
  55304. valueSum += Math.abs(fv[_i2]);
  55305. } // 重要步骤:定义图表 Ring 数据视图框中单位值的含义,单位值:每度代表的数值
  55306. this.DVBUnitValue = 360 / valueSum;
  55307. var uv = this.DVBUnitValue;
  55308. var dvbCenter = this.DVBCenterPoint; // 数据视图框中心作为扇心
  55309. var startAngle = 0; // 扇形起始边角度
  55310. var endAngle = 0; // 扇形终止边角度
  55311. var startAngleTmp = startAngle; // 扇形临时起始边角度
  55312. // 扇形外环(自适应)半径
  55313. var r = this.DVBHeight < this.DVBWidth ? this.DVBHeight / 2 : this.DVBWidth / 2; // 扇形内环(自适应)半径
  55314. var isInRange = sets.innerRingRadius >= 0 && sets.innerRingRadius < r;
  55315. var r0 = typeof sets.innerRingRadius !== "undefined" && !isNaN(sets.innerRingRadius) && isInRange ? sets.innerRingRadius : 0;
  55316. for (var i = 0; i < fv.length; i++) {
  55317. var fvi = Math.abs(fv[i]); // 计算结束角度
  55318. if (i === 0) {
  55319. endAngle = startAngle + fvi * uv;
  55320. } else if (i === fvi.length - 1) {
  55321. endAngle = startAngleTmp;
  55322. } else {
  55323. endAngle = startAngle + fvi * uv;
  55324. } // 扇形参数对象
  55325. var sectorSP = new Sector(dvbCenter[0], dvbCenter[1], r, startAngle, endAngle, r0); // 扇形样式
  55326. if (typeof sets.sectorStyleByFields === "undefined") {
  55327. // 使用默认 style 组
  55328. var colorIndex = i % defaultStyleGroup.length;
  55329. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, defaultStyleGroup, null, colorIndex);
  55330. } else {
  55331. sectorSP.style = ShapeFactory.ShapeStyleTool(null, sets.sectorStyle, sets.sectorStyleByFields, sets.sectorStyleByCodomain, i, fv[i]);
  55332. } // 扇形 hover 样式
  55333. sectorSP.highlightStyle = ShapeFactory.ShapeStyleTool(null, sets.sectorHoverStyle); // 扇形 hover 与 click 设置
  55334. if (typeof sets.sectorHoverAble !== "undefined") {
  55335. sectorSP.hoverable = sets.sectorHoverAble;
  55336. }
  55337. if (typeof sets.sectorClickAble !== "undefined") {
  55338. sectorSP.clickable = sets.sectorClickAble;
  55339. } // 图形携带的数据信息
  55340. sectorSP.refDataID = this.data.id;
  55341. sectorSP.dataInfo = {
  55342. field: this.fields[i],
  55343. value: fv[i]
  55344. }; // 创建扇形并把此扇形添加到图表图形数组
  55345. this.shapes.push(this.shapeFactory.createShape(sectorSP)); // 把上一次的结束角度作为下一次的起始角度
  55346. startAngle = endAngle;
  55347. } // 重要步骤:将图形转为由相对坐标表示的图形,以便在地图平移缩放过程中快速重绘图形
  55348. // (统计专题图模块从结构上要求使用相对坐标,assembleShapes() 函数必须在图形装配完成后调用 shapesConvertToRelativeCoordinate() 函数)
  55349. this.shapesConvertToRelativeCoordinate();
  55350. }
  55351. }]);
  55352. return Ring;
  55353. }(Graph);
  55354. /**
  55355. * @typedef {Object} SuperMap.Feature.Theme.Ring.setting
  55356. * @property {number} width - 专题要素(图表)宽度。
  55357. * @property {number} height - 专题要素(图表)高度。
  55358. * @property {Array.<number>} codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  55359. * @property {number} [XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  55360. * @property {number} [YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  55361. * @property {Array.<number>} [dataViewBoxParameter=[0, 0, 0, 0]] - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值。
  55362. * @property {number} [decimalNumber] - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  55363. * @property {boolean} [useBackground=false] - 是否使用图表背景框。
  55364. * @property {SuperMap.Feature.ShapeParameters.Rectangle.style} [backgroundStyle] - 背景样式,此样式对象对象可设属性。
  55365. * @property {Array.<number>} [backgroundRadius=[0, 0, 0, 0]] - 背景框矩形圆角半径,可以用数组分别指定四个角的圆角半径,设:左上、右上、右下、左下角的半径依次为 r1、r2、r3、r4 ,则 backgroundRadius 为 [r1、r2、r3、r4 ]。
  55366. * @property {number} [innerRingRadius=0] - 环状图内环半径,取值范围大于 0,小于外环半径(外环半径:数据视图框长和宽中较小值的二分之一)。
  55367. * @property {SuperMap.Feature.ShapeParameters.Sector.style} [sectorStyle] - 环状图中扇形的基础 style,此参数控制环状图扇形基础样式,优先级低于 sectorStyleByFields 和 sectorStyleByCodomain。
  55368. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByFields] - 按专题字段 themeFields({@link SuperMap.Layer.Graph.themeFields}|{@link L.supermap.graphThemeLayer.themeFields}|{@link ol.source.Graph.themeFields}|{@link mapboxgl.supermap.GraphThemeLayer.themeFields})为环状图扇形赋 style,此参数按字段控制环状图扇形样式,优先级低于 sectorStyleByCodomain,高于 sectorStyle。此数组中的元素是样式对象。此参数中的 style 与 themeFields 中的字段一一对应 。例如: themeFields(<SuperMap.Layer.Graph.themeFields>) 为 ["POP_1992", "POP_1995", "POP_1999"],sectorStyleByFields 为[style1, style2, style3],则在图表中,字段 POP_1992 对应的环状图扇形使用 style1,字段 POP_1995 对应的环状图扇形使用 style2 ,字段 POP_1999 对应的环状图扇形使用 style3。
  55369. * @property {Array.<SuperMap.Feature.ShapeParameters.Sector.style>} [sectorStyleByCodomain] - 按环状图扇形代表的数据值所在值域范围控制环状图扇形样式,优先级高于 sectorStyle 和 sectorStyleByFields。
  55370. */
  55371. SuperMap.Feature.Theme.Ring = Ring;
  55372. ;// CONCATENATED MODULE: ./src/common/overlay/ThemeVector.js
  55373. function ThemeVector_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThemeVector_typeof = function _typeof(obj) { return typeof obj; }; } else { ThemeVector_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThemeVector_typeof(obj); }
  55374. function ThemeVector_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55375. 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); } }
  55376. function ThemeVector_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeVector_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeVector_defineProperties(Constructor, staticProps); return Constructor; }
  55377. function ThemeVector_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { ThemeVector_get = Reflect.get; } 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(receiver); } return desc.value; }; } return ThemeVector_get(target, property, receiver || target); }
  55378. function ThemeVector_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = ThemeVector_getPrototypeOf(object); if (object === null) break; } return object; }
  55379. 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 } }); if (superClass) ThemeVector_setPrototypeOf(subClass, superClass); }
  55380. function ThemeVector_setPrototypeOf(o, p) { ThemeVector_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThemeVector_setPrototypeOf(o, p); }
  55381. 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); }; }
  55382. function ThemeVector_possibleConstructorReturn(self, call) { if (call && (ThemeVector_typeof(call) === "object" || typeof call === "function")) { return call; } return ThemeVector_assertThisInitialized(self); }
  55383. function ThemeVector_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55384. function ThemeVector_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  55385. function ThemeVector_getPrototypeOf(o) { ThemeVector_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThemeVector_getPrototypeOf(o); }
  55386. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  55387. * This program are made available under the terms of the Apache License, Version 2.0
  55388. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55389. /**
  55390. * @class SuperMap.Feature.Theme.Vector
  55391. * @classdesc 矢量专题要素类。
  55392. * @category Visualization Theme
  55393. * @extends SuperMap.Feature.Theme
  55394. * @param {SuperMap.Feature.Vector} data - 用户数据,的类型为矢量数据 feature。
  55395. * @param {SuperMap.Layer} layer - 此专题要素所在图层。
  55396. * @param {Object} style - 样式。
  55397. * @param {Object} options - 创建专题要素时的可选参数。
  55398. * @param {number} [options.nodesClipPixel=2] - 节点抽稀像素距离, 单位:像素。
  55399. * @param {boolean} [options.isHoverAble=true] - 图形是否可 hover。
  55400. * @param {boolean} [options.isMultiHover=true] - 是否使用多图形高亮,isHoverAble 为 true 时生效。
  55401. * @param {boolean} [options.isClickAble=true] - 图形是否可点击。
  55402. * @param {Object} [options.highlightStyle] - 高亮样式。
  55403. */
  55404. var ThemeVector = /*#__PURE__*/function (_Theme) {
  55405. ThemeVector_inherits(ThemeVector, _Theme);
  55406. var _super = ThemeVector_createSuper(ThemeVector);
  55407. function ThemeVector(data, layer, style, options, shapeOptions) {
  55408. var _this;
  55409. ThemeVector_classCallCheck(this, ThemeVector);
  55410. _this = _super.call(this, data, layer); //数据的 geometry 属性必须存在且类型是 SuperMap.Geometry 或其子类的类型
  55411. if (!data.geometry) {
  55412. return ThemeVector_possibleConstructorReturn(_this);
  55413. }
  55414. if (!(data.geometry instanceof Geometry)) {
  55415. return ThemeVector_possibleConstructorReturn(_this);
  55416. }
  55417. /**
  55418. * @member {SuperMap.Bounds} [SuperMap.Feature.Theme.Vector.prototype.dataBounds]
  55419. * @description 用户数据的(feature.geometry)地理范围。
  55420. */
  55421. _this.dataBounds = data.geometry.getBounds();
  55422. /**
  55423. * @member {number} [SuperMap.Feature.Theme.Vector.prototype.nodesClipPixel=2]
  55424. * @description 节点抽稀像素距离。
  55425. */
  55426. _this.nodesClipPixel = 2;
  55427. /**
  55428. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isHoverAble=true]
  55429. * @description 图形是否可 hover。
  55430. */
  55431. _this.isHoverAble = true;
  55432. /**
  55433. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isMultiHover=true]
  55434. * @description 是否使用多图形高亮,isHoverAble 为 true 时生效。
  55435. */
  55436. _this.isMultiHover = true;
  55437. /**
  55438. * @member {boolean} [SuperMap.Feature.Theme.Vector.prototype.isClickAble=true]
  55439. * @description 图形是否可点击。
  55440. */
  55441. _this.isClickAble = true;
  55442. /**
  55443. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.highlightStyle]
  55444. * @description 高亮样式。
  55445. */
  55446. _this.highlightStyle = null;
  55447. /**
  55448. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.shapeOptions]
  55449. * @description 添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做。
  55450. */
  55451. _this.shapeOptions = {};
  55452. /**
  55453. * @member {Object} [SuperMap.Feature.Theme.Vector.prototype.style]
  55454. * @description 可视化图形的 style。在子类中规定其对象结构和默认属性值。
  55455. */
  55456. _this.style = style || {};
  55457. _this.CLASS_NAME = "SuperMap.Feature.Theme.Vector";
  55458. _this.style = style ? style : {};
  55459. if (options) {
  55460. Util.copyAttributesWithClip(ThemeVector_assertThisInitialized(_this), options, ["shapeOptions", "dataBounds"]);
  55461. }
  55462. if (shapeOptions) {
  55463. Util.copyAttributesWithClip(_this.shapeOptions, shapeOptions);
  55464. } //设置基础参数 dataBounds、lonlat、location
  55465. var geometry = data.geometry;
  55466. _this.lonlat = _this.dataBounds.getCenterLonLat();
  55467. _this.location = _this.getLocalXY(_this.lonlat); //将地理要素转为专题要素
  55468. if (geometry instanceof LinearRing) {
  55469. _this.lineToTF(geometry);
  55470. } else if (geometry instanceof LineString) {
  55471. _this.lineToTF(geometry);
  55472. } else if (geometry instanceof Curve) {//独立几何体
  55473. } else if (geometry instanceof MultiPoint) {
  55474. _this.multiPointToTF(geometry);
  55475. } else if (geometry instanceof MultiLineString) {
  55476. _this.multiLineStringToTF(geometry);
  55477. } else if (geometry instanceof MultiPolygon) {
  55478. _this.multiPolygonToTF(geometry);
  55479. } else if (geometry instanceof Polygon) {
  55480. _this.polygonToTF(geometry);
  55481. } else if (geometry instanceof Collection) {//独立几何体
  55482. } else if (geometry instanceof Point) {
  55483. _this.pointToTF(geometry);
  55484. } else if (geometry instanceof Rectangle) {
  55485. _this.rectangleToTF(geometry);
  55486. } else if (geometry instanceof GeoText) {
  55487. _this.geoTextToTF(geometry);
  55488. }
  55489. return _this;
  55490. }
  55491. /**
  55492. * @function SuperMap.Feature.Theme.Vector.prototype.destroy
  55493. * @override
  55494. */
  55495. ThemeVector_createClass(ThemeVector, [{
  55496. key: "destroy",
  55497. value: function destroy() {
  55498. this.style = null;
  55499. this.dataBounds = null;
  55500. this.nodesClipPixel = null;
  55501. this.isHoverAble = null;
  55502. this.isMultiHover = null;
  55503. this.isClickAble = null;
  55504. this.highlightStyle = null;
  55505. this.shapeOptions = null;
  55506. ThemeVector_get(ThemeVector_getPrototypeOf(ThemeVector.prototype), "destroy", this).call(this);
  55507. }
  55508. /**
  55509. * @function SuperMap.Feature.Theme.Vector.prototype.lineToTF
  55510. * @description 转换线和线环要素。
  55511. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 LineString 或 LineRing。
  55512. */
  55513. }, {
  55514. key: "lineToTF",
  55515. value: function lineToTF(geometry) {
  55516. var components = geometry.components; //节点像素坐标
  55517. var localLX = []; //参考位置,参考中心为
  55518. var refLocal = [];
  55519. var location = this.location;
  55520. var pointList = []; //节点抽稀距离
  55521. var nCPx = this.nodesClipPixel;
  55522. for (var i = 0; i < components.length; i++) {
  55523. var components_i = components[i];
  55524. refLocal = [];
  55525. localLX = this.getLocalXY(components_i);
  55526. refLocal[0] = localLX[0] - location[0];
  55527. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  55528. if (pointList.length > 0) {
  55529. var lastLocalXY = pointList[pointList.length - 1];
  55530. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  55531. continue;
  55532. }
  55533. } //使用参考点
  55534. pointList.push(refLocal);
  55535. }
  55536. if (pointList.length < 2) {
  55537. return null;
  55538. } //赋 style
  55539. var style = new Object();
  55540. style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
  55541. style.pointList = pointList; //创建图形
  55542. var shape = new SmicBrokenLine({
  55543. style: style,
  55544. clickable: this.isClickAble,
  55545. hoverable: this.isHoverAble
  55546. }); //设置高亮样式
  55547. if (this.highlightStyle) {
  55548. shape.highlightStyle = this.highlightStyle;
  55549. } //设置参考中心,指定图形位置
  55550. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  55551. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55552. shape.isHoverByRefDataID = this.isMultiHover; //添加到渲染器前修改 shape 的一些属性,非特殊情况通常不允许这么做
  55553. if (this.shapeOptions) {
  55554. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55555. }
  55556. this.shapes.push(shape);
  55557. }
  55558. /**
  55559. * @function SuperMap.Feature.Theme.Vector.prototype.multiPointToTF
  55560. * @description 转多点要素。
  55561. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPoint。
  55562. */
  55563. }, {
  55564. key: "multiPointToTF",
  55565. value: function multiPointToTF(geometry) {
  55566. /* //-- 不抽稀
  55567. var components = geometry.components;
  55568. for(var i = 0; i < components.length; i++){
  55569. var components_i = components[i];
  55570. this.pointToTF(components_i);
  55571. }
  55572. */
  55573. var components = geometry.components; //节点像素坐标
  55574. var localLX = []; //参考位置,参考中心为
  55575. var refLocal = [];
  55576. var location = this.location;
  55577. var pointList = []; //节点抽稀距离
  55578. var nCPx = this.nodesClipPixel;
  55579. for (var i = 0; i < components.length; i++) {
  55580. var components_i = components[i];
  55581. refLocal = [];
  55582. localLX = this.getLocalXY(components_i);
  55583. refLocal[0] = localLX[0] - location[0];
  55584. refLocal[1] = localLX[1] - location[1]; //抽稀
  55585. if (pointList.length > 0) {
  55586. var lastLocalXY = pointList[pointList.length - 1];
  55587. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  55588. continue;
  55589. }
  55590. } //使用参考点
  55591. pointList.push(refLocal); //赋 style
  55592. var style = new Object();
  55593. style.r = 6; //防止漏设此参数,默认 6 像素
  55594. style = Util.copyAttributesWithClip(style, this.style);
  55595. style.x = refLocal[0];
  55596. style.y = refLocal[1]; //创建图形
  55597. var shape = new SmicPoint({
  55598. style: style,
  55599. clickable: this.isClickAble,
  55600. hoverable: this.isHoverAble
  55601. }); //设置高亮样式
  55602. if (this.highlightStyle) {
  55603. shape.highlightStyle = this.highlightStyle;
  55604. } //设置参考中心,指定图形位置
  55605. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  55606. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55607. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  55608. if (this.shapeOptions) {
  55609. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55610. }
  55611. this.shapes.push(shape);
  55612. }
  55613. }
  55614. /**
  55615. * @function SuperMap.Feature.Theme.Vector.prototype.multiLineStringToTF
  55616. * @description 转换多线要素。
  55617. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiLineString。
  55618. */
  55619. }, {
  55620. key: "multiLineStringToTF",
  55621. value: function multiLineStringToTF(geometry) {
  55622. var components = geometry.components;
  55623. for (var i = 0; i < components.length; i++) {
  55624. var components_i = components[i];
  55625. this.lineToTF(components_i);
  55626. }
  55627. }
  55628. /**
  55629. * @function SuperMap.Feature.Theme.Vector.prototype.multiPolygonToTF
  55630. * @description 转换多面要素。
  55631. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 MultiPolygon。
  55632. */
  55633. }, {
  55634. key: "multiPolygonToTF",
  55635. value: function multiPolygonToTF(geometry) {
  55636. var components = geometry.components;
  55637. for (var i = 0; i < components.length; i++) {
  55638. var components_i = components[i];
  55639. this.polygonToTF(components_i);
  55640. }
  55641. }
  55642. /**
  55643. * @function SuperMap.Feature.Theme.Vector.prototype.pointToTF
  55644. * @description 转换点要素。
  55645. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Point。
  55646. */
  55647. }, {
  55648. key: "pointToTF",
  55649. value: function pointToTF(geometry) {
  55650. //参考位置,参考中心为
  55651. var location = this.location; //geometry 像素坐标
  55652. var localLX = this.getLocalXY(geometry); //赋 style
  55653. var style = new Object();
  55654. style.r = 6; //防止漏设此参数,默认 6 像素
  55655. style = Util.copyAttributesWithClip(style, this.style);
  55656. style.x = localLX[0] - location[0];
  55657. style.y = localLX[1] - location[1]; //创建图形
  55658. var shape = new SmicPoint({
  55659. style: style,
  55660. clickable: this.isClickAble,
  55661. hoverable: this.isHoverAble
  55662. }); //设置高亮样式
  55663. if (this.highlightStyle) {
  55664. shape.highlightStyle = this.highlightStyle;
  55665. } //设置参考中心,指定图形位置
  55666. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  55667. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55668. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  55669. if (this.shapeOptions) {
  55670. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55671. }
  55672. this.shapes.push(shape);
  55673. }
  55674. /**
  55675. * @function SuperMap.Feature.Theme.Vector.prototype.polygonToThemeFeature
  55676. * @description 转换面要素。
  55677. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Polygon。
  55678. */
  55679. }, {
  55680. key: "polygonToTF",
  55681. value: function polygonToTF(geometry) {
  55682. var components = geometry.components; //节点像素坐标
  55683. var localLX = []; //参考位置,参考中心为
  55684. var refLocal = [];
  55685. var location = this.location;
  55686. var pointList = []; //岛洞
  55687. var holePolygonPointList = [];
  55688. var holePolygonPointLists = []; //节点抽稀距离
  55689. var nCPx = this.nodesClipPixel;
  55690. for (var i = 0; i < components.length; i++) {
  55691. var components_i = components[i].components;
  55692. if (i === 0) {
  55693. // 第一个 component 正常绘制
  55694. pointList = [];
  55695. for (var j = 0; j < components_i.length; j++) {
  55696. refLocal = [];
  55697. localLX = this.getLocalXY(components_i[j]);
  55698. refLocal[0] = localLX[0] - location[0];
  55699. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  55700. if (pointList.length > 0) {
  55701. var lastLocalXY = pointList[pointList.length - 1];
  55702. if (Math.abs(lastLocalXY[0] - refLocal[0]) <= nCPx && Math.abs(lastLocalXY[1] - refLocal[1]) <= nCPx) {
  55703. continue;
  55704. }
  55705. } //使用参考点
  55706. pointList.push(refLocal);
  55707. }
  55708. } else {
  55709. // 其它 component 作为岛洞
  55710. holePolygonPointList = [];
  55711. for (var k = 0; k < components_i.length; k++) {
  55712. refLocal = [];
  55713. localLX = this.getLocalXY(components_i[k]);
  55714. refLocal[0] = localLX[0] - location[0];
  55715. refLocal[1] = localLX[1] - location[1]; //抽稀 - 2 px
  55716. if (holePolygonPointList.length > 0) {
  55717. var lastXY = holePolygonPointList[holePolygonPointList.length - 1];
  55718. if (Math.abs(lastXY[0] - refLocal[0]) <= nCPx && Math.abs(lastXY[1] - refLocal[1]) <= nCPx) {
  55719. continue;
  55720. }
  55721. } //使用参考点
  55722. holePolygonPointList.push(refLocal);
  55723. }
  55724. }
  55725. if (holePolygonPointList.length < 2) {
  55726. continue;
  55727. }
  55728. holePolygonPointLists.push(holePolygonPointList);
  55729. }
  55730. if (pointList.length < 2) {
  55731. return;
  55732. } //赋 style
  55733. var style = {};
  55734. style = Util.copyAttributesWithClip(style, this.style, ['pointList']);
  55735. style.pointList = pointList; //创建图形
  55736. var shape = new SmicPolygon({
  55737. style: style,
  55738. clickable: this.isClickAble,
  55739. hoverable: this.isHoverAble
  55740. }); //设置高亮样式
  55741. if (this.highlightStyle) {
  55742. shape.highlightStyle = this.highlightStyle;
  55743. } //设置参考中心,指定图形位置
  55744. shape.refOriginalPosition = this.location; //储存数据 id 属性,用于事件
  55745. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55746. shape.isHoverByRefDataID = this.isMultiHover; //岛洞面
  55747. if (holePolygonPointLists.length > 0) {
  55748. shape.holePolygonPointLists = holePolygonPointLists;
  55749. } //修改一些 shape 可选属性,通常不需要这么做
  55750. if (this.shapeOptions) {
  55751. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55752. }
  55753. this.shapes.push(shape);
  55754. }
  55755. /**
  55756. * @function SuperMap.Feature.Theme.Vector.prototype.rectangleToTF
  55757. * @description 转换矩形要素。
  55758. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 Rectangle。
  55759. */
  55760. }, {
  55761. key: "rectangleToTF",
  55762. value: function rectangleToTF(geometry) {
  55763. //参考位置,参考中心为
  55764. var location = this.location;
  55765. var ll = new LonLat(geometry.x, geometry.y); //地图分辨率
  55766. var res = this.layer.map.getResolution(); //geometry 像素坐标
  55767. var localLX = this.getLocalXY(ll); //赋 style
  55768. var style = new Object();
  55769. style.r = 6; //防止漏设此参数,默认 6 像素
  55770. style = Util.copyAttributesWithClip(style, this.style);
  55771. style.x = localLX[0] - location[0]; // SuperMap.Geometry.Rectangle 使用左下角定位, SmicRectangle 使用左上角定位,需要转换
  55772. style.y = localLX[1] - location[1] - 2 * geometry.width / res;
  55773. style.width = geometry.width / res;
  55774. style.height = geometry.height / res; //创建图形
  55775. var shape = new SmicRectangle({
  55776. style: style,
  55777. clickable: this.isClickAble,
  55778. hoverable: this.isHoverAble
  55779. }); //设置高亮样式
  55780. if (this.highlightStyle) {
  55781. shape.highlightStyle = this.highlightStyle;
  55782. } //设置参考中心,指定图形位置
  55783. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  55784. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55785. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  55786. if (this.shapeOptions) {
  55787. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55788. }
  55789. this.shapes.push(shape);
  55790. }
  55791. /**
  55792. * @function SuperMap.Feature.Theme.Vector.prototype.geoTextToTF
  55793. * @description 转换文本要素。
  55794. * @param {SuperMap.Geometry} geometry - 用户数据几何地理信息,这里必须是 GeoText。
  55795. */
  55796. }, {
  55797. key: "geoTextToTF",
  55798. value: function geoTextToTF(geometry) {
  55799. //参考位置,参考中心为
  55800. var location = this.location; //geometry 像素坐标
  55801. var localLX = this.getLocalXY(geometry); //赋 style
  55802. var style = new Object();
  55803. style.r = 6; //防止漏设此参数,默认 6 像素
  55804. style = Util.copyAttributesWithClip(style, this.style, ["x", "y", "text"]);
  55805. style.x = localLX[0] - location[0];
  55806. style.y = localLX[1] - location[1];
  55807. style.text = geometry.text; //创建图形
  55808. var shape = new SmicText({
  55809. style: style,
  55810. clickable: this.isClickAble,
  55811. hoverable: this.isHoverAble
  55812. }); //设置高亮样式
  55813. if (this.highlightStyle) {
  55814. shape.highlightStyle = this.highlightStyle;
  55815. } //设置参考中心,指定图形位置
  55816. shape.refOriginalPosition = location; //储存数据 id 属性,用于事件
  55817. shape.refDataID = this.data.id; //储存数据 id 属性,用于事件-多图形同时高亮
  55818. shape.isHoverByRefDataID = this.isMultiHover; //修改一些 shape 可选属性,通常不需要这么做
  55819. if (this.shapeOptions) {
  55820. Util.copyAttributesWithClip(shape, this.shapeOptions);
  55821. }
  55822. this.shapes.push(shape);
  55823. }
  55824. /**
  55825. * @function SuperMap.Feature.Theme.Vector.prototype.updateAndAddShapes
  55826. * @description 修改位置,针对地图平移操作,地图漫游操作后调用此函数。
  55827. */
  55828. }, {
  55829. key: "updateAndAddShapes",
  55830. value: function updateAndAddShapes() {
  55831. var newLocalLX = this.getLocalXY(this.lonlat);
  55832. this.location = newLocalLX;
  55833. var render = this.layer.renderer;
  55834. for (var i = 0, len = this.shapes.length; i < len; i++) {
  55835. var shape = this.shapes[i]; //设置参考中心,指定图形位置
  55836. shape.refOriginalPosition = newLocalLX;
  55837. render.addShape(shape);
  55838. }
  55839. }
  55840. /**
  55841. * @function SuperMap.Feature.Theme.Vector.prototype.getShapesCount
  55842. * @description 获得专题要素中可视化图形的数量。
  55843. * @returns {number} 可视化图形的数量。
  55844. */
  55845. }, {
  55846. key: "getShapesCount",
  55847. value: function getShapesCount() {
  55848. return this.shapes.length;
  55849. }
  55850. /**
  55851. * @function SuperMap.Feature.Theme.Vector.prototype.getLocalXY
  55852. * @description 地理坐标转为像素坐标。
  55853. * @param {SuperMap.LonLat} lonlat - 专题要素地理位置。
  55854. */
  55855. }, {
  55856. key: "getLocalXY",
  55857. value: function getLocalXY(lonlat) {
  55858. return this.layer.getLocalXY(lonlat);
  55859. }
  55860. }]);
  55861. return ThemeVector;
  55862. }(Theme_Theme);
  55863. SuperMap.Feature.Theme.ThemeVector = ThemeVector;
  55864. ;// CONCATENATED MODULE: ./src/common/overlay/feature/index.js
  55865. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  55866. * This program are made available under the terms of the Apache License, Version 2.0
  55867. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55868. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Group.js
  55869. function Group_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Group_typeof = function _typeof(obj) { return typeof obj; }; } else { Group_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Group_typeof(obj); }
  55870. function Group_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  55871. 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); } }
  55872. function Group_createClass(Constructor, protoProps, staticProps) { if (protoProps) Group_defineProperties(Constructor.prototype, protoProps); if (staticProps) Group_defineProperties(Constructor, staticProps); return Constructor; }
  55873. function Group_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { Group_get = Reflect.get; } 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(receiver); } return desc.value; }; } return Group_get(target, property, receiver || target); }
  55874. function Group_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Group_getPrototypeOf(object); if (object === null) break; } return object; }
  55875. 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 } }); if (superClass) Group_setPrototypeOf(subClass, superClass); }
  55876. function Group_setPrototypeOf(o, p) { Group_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Group_setPrototypeOf(o, p); }
  55877. 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); }; }
  55878. function Group_possibleConstructorReturn(self, call) { if (call && (Group_typeof(call) === "object" || typeof call === "function")) { return call; } return Group_assertThisInitialized(self); }
  55879. function Group_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  55880. function Group_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  55881. function Group_getPrototypeOf(o) { Group_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Group_getPrototypeOf(o); }
  55882. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  55883. * This program are made available under the terms of the Apache License, Version 2.0
  55884. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  55885. /**
  55886. * @class SuperMap.LevelRenderer.Group
  55887. * @category Visualization Theme
  55888. * @private
  55889. * @classdesc Group 是一个容器,可以插入子节点,Group 的变换也会被应用到子节点上。
  55890. * @extends {SuperMap.LevelRenderer.Transformable}
  55891. * (code)
  55892. * var g = new SuperMap.LevelRenderer.Group();
  55893. * var Circle = new SuperMap.LevelRenderer.Shape.Circle();
  55894. * g.position[0] = 100;
  55895. * g.position[1] = 100;
  55896. * g.addChild(new Circle({
  55897. * style: {
  55898. * x: 100,
  55899. * y: 100,
  55900. * r: 20,
  55901. * brushType: 'fill'
  55902. * }
  55903. * }));
  55904. * LR.addGroup(g);
  55905. * (end)
  55906. */
  55907. var Group = /*#__PURE__*/function (_SuperMap$mixin) {
  55908. Group_inherits(Group, _SuperMap$mixin);
  55909. var _super = Group_createSuper(Group);
  55910. /**
  55911. * @function SuperMap.LevelRenderer.Group.prototype.constructor
  55912. * @description 构造函数。
  55913. * @param {Array} options - Group 的配置(options)项,可以是 Group 的自有属性,也可以是自定义的属性。
  55914. */
  55915. function Group(options) {
  55916. var _this;
  55917. Group_classCallCheck(this, Group);
  55918. _this = _super.call(this, options);
  55919. options = options || {};
  55920. /**
  55921. * @member {string} SuperMap.LevelRenderer.Group.prototype.id
  55922. * @description Group 的唯一标识。
  55923. */
  55924. _this.id = null;
  55925. /**
  55926. * @readonly
  55927. * @member {string} [SuperMap.LevelRenderer.Group.prototype.type='group']
  55928. * @description 类型。
  55929. */
  55930. _this.type = 'group'; //http://www.w3.org/TR/2dcontext/#clipping-region
  55931. /**
  55932. * @member {string} SuperMap.LevelRenderer.Group.prototype.clipShape
  55933. * @description 用于裁剪的图形(shape),所有 Group 内的图形在绘制时都会被这个图形裁剪,该图形会继承 Group 的变换。
  55934. */
  55935. _this.clipShape = null;
  55936. /**
  55937. * @member {Array} SuperMap.LevelRenderer.Group.prototype._children
  55938. * @description _children。
  55939. */
  55940. _this._children = [];
  55941. /**
  55942. * @member {Array} SuperMap.LevelRenderer.Group.prototype._storage
  55943. * @description _storage。
  55944. */
  55945. _this._storage = null;
  55946. /**
  55947. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.__dirty=true]
  55948. * @description __dirty。
  55949. */
  55950. _this.__dirty = true;
  55951. /**
  55952. * @member {boolean} [SuperMap.LevelRenderer.Group.prototype.ignore=false]
  55953. * @description 是否忽略该 Group 及其所有子节点。
  55954. */
  55955. _this.ignore = false;
  55956. Util.extend(Group_assertThisInitialized(_this), options);
  55957. _this.id = _this.id || Util.createUniqueID("smShapeGroup_");
  55958. _this.CLASS_NAME = "SuperMap.LevelRenderer.Group";
  55959. return _this;
  55960. }
  55961. /**
  55962. * @function SuperMap.LevelRenderer.Group.prototype.destroy
  55963. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  55964. */
  55965. Group_createClass(Group, [{
  55966. key: "destroy",
  55967. value: function destroy() {
  55968. this.id = null;
  55969. this.type = null;
  55970. this.clipShape = null;
  55971. this._children = null;
  55972. this._storage = null;
  55973. this.__dirty = null;
  55974. this.ignore = null;
  55975. Group_get(Group_getPrototypeOf(Group.prototype), "destroy", this).call(this);
  55976. }
  55977. /**
  55978. * @function SuperMap.LevelRenderer.Group.prototype.children
  55979. * @description 复制并返回一份新的包含所有儿子节点的数组。
  55980. * @returns {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  55981. */
  55982. }, {
  55983. key: "children",
  55984. value: function children() {
  55985. return this._children.slice();
  55986. }
  55987. /**
  55988. * @function SuperMap.LevelRenderer.Group.prototype.childAt
  55989. * @description 获取指定 index 的儿子节点
  55990. * @param {number} idx - 节点索引。
  55991. * @returns {SuperMap.LevelRenderer.Shape} 图形。
  55992. */
  55993. }, {
  55994. key: "childAt",
  55995. value: function childAt(idx) {
  55996. return this._children[idx];
  55997. }
  55998. /**
  55999. * @function SuperMap.LevelRenderer.Group.prototype.addChild
  56000. * @description 添加子节点,可以是 Shape 或者 Group。
  56001. * @param {(SuperMap.LevelRenderer.Shape|SuperMap.LevelRenderer.Group)} child - 节点图形。
  56002. */
  56003. // TODO Type Check
  56004. }, {
  56005. key: "addChild",
  56006. value: function addChild(child) {
  56007. if (child == this) {
  56008. return;
  56009. }
  56010. if (child.parent == this) {
  56011. return;
  56012. }
  56013. if (child.parent) {
  56014. child.parent.removeChild(child);
  56015. }
  56016. this._children.push(child);
  56017. child.parent = this;
  56018. if (this._storage && this._storage !== child._storage) {
  56019. this._storage.addToMap(child);
  56020. if (child instanceof Group) {
  56021. child.addChildrenToStorage(this._storage);
  56022. }
  56023. }
  56024. }
  56025. /**
  56026. * @function SuperMap.LevelRenderer.Group.prototype.removeChild
  56027. * @description 移除子节点。
  56028. * @param {SuperMap.LevelRenderer.Shape} child - 需要移除的子节点图形。
  56029. */
  56030. }, {
  56031. key: "removeChild",
  56032. value: function removeChild(child) {
  56033. var idx = Util.indexOf(this._children, child);
  56034. this._children.splice(idx, 1);
  56035. child.parent = null;
  56036. if (this._storage) {
  56037. this._storage.delFromMap(child.id);
  56038. if (child instanceof Group) {
  56039. child.delChildrenFromStorage(this._storage);
  56040. }
  56041. }
  56042. }
  56043. /**
  56044. * @function SuperMap.LevelRenderer.Group.prototype.eachChild
  56045. * @description 遍历所有子节点。
  56046. * @param {function} cb - 回调函数。
  56047. * @param {Object} context - 上下文。
  56048. */
  56049. }, {
  56050. key: "eachChild",
  56051. value: function eachChild(cb, context) {
  56052. var haveContext = !!context;
  56053. for (var i = 0; i < this._children.length; i++) {
  56054. var child = this._children[i];
  56055. if (haveContext) {
  56056. cb.call(context, child);
  56057. } else {
  56058. cb(child);
  56059. }
  56060. }
  56061. }
  56062. /**
  56063. * @function SuperMap.LevelRenderer.Group.prototype.traverse
  56064. * @description 深度优先遍历所有子孙节点。
  56065. * @param {function} cb - 回调函数。
  56066. * @param {Object} context - 上下文。
  56067. */
  56068. }, {
  56069. key: "traverse",
  56070. value: function traverse(cb, context) {
  56071. var haveContext = !!context;
  56072. for (var i = 0; i < this._children.length; i++) {
  56073. var child = this._children[i];
  56074. if (haveContext) {
  56075. cb.call(context, child);
  56076. } else {
  56077. cb(child);
  56078. }
  56079. if (child.type === 'group') {
  56080. child.traverse(cb, context);
  56081. }
  56082. }
  56083. }
  56084. /**
  56085. * @function SuperMap.LevelRenderer.Group.prototype.addChildrenToStorage
  56086. * @description 把子图形添加到仓库。
  56087. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  56088. */
  56089. }, {
  56090. key: "addChildrenToStorage",
  56091. value: function addChildrenToStorage(storage) {
  56092. for (var i = 0; i < this._children.length; i++) {
  56093. var child = this._children[i];
  56094. storage.addToMap(child);
  56095. if (child.type === 'group') {
  56096. child.addChildrenToStorage(storage);
  56097. }
  56098. }
  56099. }
  56100. /**
  56101. * @function SuperMap.LevelRenderer.Group.prototype.delChildrenFromStorage
  56102. * @description 从仓库把子图形删除。
  56103. * @param {SuperMap.LevelRenderer.Storage} storage - 图形仓库。
  56104. */
  56105. }, {
  56106. key: "delChildrenFromStorage",
  56107. value: function delChildrenFromStorage(storage) {
  56108. for (var i = 0; i < this._children.length; i++) {
  56109. var child = this._children[i];
  56110. storage.delFromMap(child.id);
  56111. if (child.type === 'group') {
  56112. child.delChildrenFromStorage(storage);
  56113. }
  56114. }
  56115. }
  56116. /**
  56117. * @function SuperMap.LevelRenderer.Group.prototype.modSelf
  56118. * @description 是否修改。
  56119. */
  56120. }, {
  56121. key: "modSelf",
  56122. value: function modSelf() {
  56123. this.__dirty = true;
  56124. }
  56125. }]);
  56126. return Group;
  56127. }(SuperMap.mixin(Eventful, Transformable));
  56128. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Storage.js
  56129. function Storage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56130. 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); } }
  56131. function Storage_createClass(Constructor, protoProps, staticProps) { if (protoProps) Storage_defineProperties(Constructor.prototype, protoProps); if (staticProps) Storage_defineProperties(Constructor, staticProps); return Constructor; }
  56132. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56133. * This program are made available under the terms of the Apache License, Version 2.0
  56134. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56135. /**
  56136. * @private
  56137. * @class SuperMap.LevelRenderer.Storage
  56138. * @category Visualization Theme
  56139. * @classdesc 内容(图像)仓库 (M) 。
  56140. */
  56141. var Storage = /*#__PURE__*/function () {
  56142. /**
  56143. * @function SuperMap.LevelRenderer.Storage.constructor
  56144. * @description 构造函数。
  56145. */
  56146. function Storage() {
  56147. Storage_classCallCheck(this, Storage);
  56148. /**
  56149. * @member {Object} SuperMap.LevelRenderer.Storage.prototype._elements
  56150. * @description 所有常规形状,id 索引的 map。
  56151. */
  56152. this._elements = {};
  56153. /**
  56154. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._hoverElements
  56155. * @description 高亮层形状,不稳定,动态增删,数组位置也是 z 轴方向,靠前显示在下方。
  56156. *
  56157. */
  56158. this._hoverElements = [];
  56159. /**
  56160. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._roots
  56161. * @description _roots。
  56162. *
  56163. */
  56164. this._roots = [];
  56165. /**
  56166. * @member {Array} SuperMap.LevelRenderer.Storage.prototype._shapeList
  56167. * @description _shapeList。
  56168. *
  56169. */
  56170. this._shapeList = [];
  56171. /**
  56172. * @member {number} SuperMap.LevelRenderer.Storage.prototype._shapeListOffset
  56173. * @description _shapeListOffset。默认值:0。
  56174. *
  56175. */
  56176. this._shapeListOffset = 0;
  56177. this.CLASS_NAME = "SuperMap.LevelRenderer.Storage";
  56178. }
  56179. /**
  56180. * @function SuperMap.LevelRenderer.Storage.prototype.destroy
  56181. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  56182. */
  56183. Storage_createClass(Storage, [{
  56184. key: "destroy",
  56185. value: function destroy() {
  56186. this.dispose();
  56187. this._shapeList = null;
  56188. this._shapeListOffset = null;
  56189. }
  56190. /**
  56191. * @function SuperMap.LevelRenderer.Storage.prototype.iterShape
  56192. * @description 遍历迭代器。
  56193. *
  56194. * @param {Function} fun - 迭代回调函数,return true终止迭代。
  56195. * @param {Object} option - 迭代参数,缺省为仅降序遍历普通层图形。
  56196. * @param {boolean} [hover=true] - 是否是高亮层图形。
  56197. * @param {string} [normal='down'] - 是否是普通层图形,迭代时是否指定及z轴顺序。可设值:'down' ,'up'。
  56198. * @param {boolean} [update=false] - 是否在迭代前更新形状列表。
  56199. * @return {SuperMap.LevelRenderer.Storage} this。
  56200. */
  56201. }, {
  56202. key: "iterShape",
  56203. value: function iterShape(fun, option) {
  56204. if (!option) {
  56205. var defaultIterateOption = {
  56206. hover: false,
  56207. normal: 'down',
  56208. update: false
  56209. };
  56210. option = defaultIterateOption;
  56211. }
  56212. if (option.hover) {
  56213. // 高亮层数据遍历
  56214. for (var i = 0, l = this._hoverElements.length; i < l; i++) {
  56215. var el = this._hoverElements[i];
  56216. el.updateTransform();
  56217. if (fun(el)) {
  56218. return this;
  56219. }
  56220. }
  56221. }
  56222. if (option.update) {
  56223. this.updateShapeList();
  56224. } // 遍历: 'down' | 'up'
  56225. switch (option.normal) {
  56226. case 'down':
  56227. {
  56228. // 降序遍历,高层优先
  56229. var _l = this._shapeList.length;
  56230. while (_l--) {
  56231. if (fun(this._shapeList[_l])) {
  56232. return this;
  56233. }
  56234. }
  56235. break;
  56236. }
  56237. // case 'up':
  56238. default:
  56239. {
  56240. // 升序遍历,底层优先
  56241. for (var _i = 0, _l2 = this._shapeList.length; _i < _l2; _i++) {
  56242. if (fun(this._shapeList[_i])) {
  56243. return this;
  56244. }
  56245. }
  56246. break;
  56247. }
  56248. }
  56249. return this;
  56250. }
  56251. /**
  56252. * @function SuperMap.LevelRenderer.Storage.prototype.getHoverShapes
  56253. * @param {boolean} [update=false] - 是否在返回前更新图形的变换。
  56254. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  56255. */
  56256. }, {
  56257. key: "getHoverShapes",
  56258. value: function getHoverShapes(update) {
  56259. // hoverConnect
  56260. var hoverElements = [],
  56261. len = this._hoverElements.length;
  56262. for (var i = 0; i < len; i++) {
  56263. hoverElements.push(this._hoverElements[i]);
  56264. var target = this._hoverElements[i].hoverConnect;
  56265. if (target) {
  56266. var shape;
  56267. target = target instanceof Array ? target : [target];
  56268. for (var j = 0, k = target.length; j < k; j++) {
  56269. shape = target[j].id ? target[j] : this.get(target[j]);
  56270. if (shape) {
  56271. hoverElements.push(shape);
  56272. }
  56273. }
  56274. }
  56275. }
  56276. hoverElements.sort(Storage.shapeCompareFunc);
  56277. if (update) {
  56278. for (var _i2 = 0, l = hoverElements.length; _i2 < l; _i2++) {
  56279. hoverElements[_i2].updateTransform();
  56280. }
  56281. }
  56282. return hoverElements;
  56283. }
  56284. /**
  56285. * @function SuperMap.LevelRenderer.Storage.prototype.getShapeList
  56286. * @description 返回所有图形的绘制队列。
  56287. *
  56288. * @param {boolean} [update=false] - 是否在返回前更新该数组。 详见:<SuperMap.LevelRenderer.Shape> updateShapeList。
  56289. * @return {SuperMap.LevelRenderer.Shape} 图形。
  56290. */
  56291. }, {
  56292. key: "getShapeList",
  56293. value: function getShapeList(update) {
  56294. if (update) {
  56295. this.updateShapeList();
  56296. }
  56297. return this._shapeList;
  56298. }
  56299. /**
  56300. * @function SuperMap.LevelRenderer.Storage.prototype.updateShapeList
  56301. * @description 更新图形的绘制队列。每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列。
  56302. */
  56303. }, {
  56304. key: "updateShapeList",
  56305. value: function updateShapeList() {
  56306. this._shapeListOffset = 0;
  56307. var rootsLen = this._roots.length;
  56308. for (var i = 0; i < rootsLen; i++) {
  56309. var root = this._roots[i];
  56310. this._updateAndAddShape(root);
  56311. }
  56312. this._shapeList.length = this._shapeListOffset;
  56313. var shapeListLen = this._shapeList.length;
  56314. for (var _i3 = 0; _i3 < shapeListLen; _i3++) {
  56315. this._shapeList[_i3].__renderidx = _i3;
  56316. }
  56317. this._shapeList.sort(Storage.shapeCompareFunc);
  56318. }
  56319. /**
  56320. * @function SuperMap.LevelRenderer.Storage.prototype._updateAndAddShape
  56321. * @description 更新并添加图形。
  56322. *
  56323. */
  56324. }, {
  56325. key: "_updateAndAddShape",
  56326. value: function _updateAndAddShape(el, clipShapes) {
  56327. if (el.ignore) {
  56328. return;
  56329. }
  56330. el.updateTransform();
  56331. if (el.type == 'group') {
  56332. if (el.clipShape) {
  56333. // clipShape 的变换是基于 group 的变换
  56334. el.clipShape.parent = el;
  56335. el.clipShape.updateTransform(); // PENDING 效率影响
  56336. if (clipShapes) {
  56337. clipShapes = clipShapes.slice();
  56338. clipShapes.push(el.clipShape);
  56339. } else {
  56340. clipShapes = [el.clipShape];
  56341. }
  56342. }
  56343. for (var i = 0; i < el._children.length; i++) {
  56344. var child = el._children[i]; // Force to mark as dirty if group is dirty
  56345. child.__dirty = el.__dirty || child.__dirty;
  56346. this._updateAndAddShape(child, clipShapes);
  56347. } // Mark group clean here
  56348. el.__dirty = false;
  56349. } else {
  56350. el.__clipShapes = clipShapes;
  56351. this._shapeList[this._shapeListOffset++] = el;
  56352. }
  56353. }
  56354. /**
  56355. * @function SuperMap.LevelRenderer.Storage.prototype.mod
  56356. * @description 修改图形(Shape)或者组(Group)。
  56357. *
  56358. * @param {string} elId - 唯一标识。
  56359. * @param {Object} params - 参数。
  56360. * @return {SuperMap.LevelRenderer.Storage} this。
  56361. */
  56362. }, {
  56363. key: "mod",
  56364. value: function mod(elId, params) {
  56365. var el = this._elements[elId];
  56366. if (el) {
  56367. el.modSelf();
  56368. if (params) {
  56369. // 如果第二个参数直接使用 shape
  56370. // parent, _storage, __startClip 三个属性会有循环引用
  56371. // 主要为了向 1.x 版本兼容,2.x 版本不建议使用第二个参数
  56372. if (params.parent || params._storage || params.__startClip) {
  56373. var target = {};
  56374. for (var name in params) {
  56375. if (name == 'parent' || name == '_storage' || name == '__startClip') {
  56376. continue;
  56377. }
  56378. if (params.hasOwnProperty(name)) {
  56379. target[name] = params[name];
  56380. }
  56381. }
  56382. new Util_Util().merge(el, target, true);
  56383. } else {
  56384. new Util_Util().merge(el, params, true);
  56385. }
  56386. }
  56387. }
  56388. return this;
  56389. }
  56390. /**
  56391. * @function SuperMap.LevelRenderer.Storage.prototype.drift
  56392. * @description 移动指定的图形(Shape)的位置。
  56393. * @param {string} shapeId - 唯一标识。
  56394. * @param {number} dx
  56395. * @param {number} dy
  56396. * @return {SuperMap.LevelRenderer.Storage} this。
  56397. */
  56398. }, {
  56399. key: "drift",
  56400. value: function drift(shapeId, dx, dy) {
  56401. var shape = this._elements[shapeId];
  56402. if (shape) {
  56403. shape.needTransform = true;
  56404. if (shape.draggable === 'horizontal') {
  56405. dy = 0;
  56406. } else if (shape.draggable === 'vertical') {
  56407. dx = 0;
  56408. }
  56409. if (!shape.ondrift // ondrift
  56410. // 有onbrush并且调用执行返回false或undefined则继续
  56411. || shape.ondrift && !shape.ondrift(dx, dy)) {
  56412. shape.drift(dx, dy);
  56413. }
  56414. }
  56415. return this;
  56416. }
  56417. /**
  56418. * @function SuperMap.LevelRenderer.Storage.prototype.addHover
  56419. * @description 添加高亮层数据。
  56420. * @param {SuperMap.LevelRenderer.Shape} shape - 图形。
  56421. * @return {SuperMap.LevelRenderer.Storage} this。
  56422. */
  56423. }, {
  56424. key: "addHover",
  56425. value: function addHover(shape) {
  56426. shape.updateNeedTransform();
  56427. this._hoverElements.push(shape);
  56428. return this;
  56429. }
  56430. /**
  56431. * @function SuperMap.LevelRenderer.Storage.prototype.delHover
  56432. * @description 清空高亮层数据。
  56433. * @return {SuperMap.LevelRenderer.Storage} this。
  56434. */
  56435. }, {
  56436. key: "delHover",
  56437. value: function delHover() {
  56438. this._hoverElements = [];
  56439. return this;
  56440. }
  56441. /**
  56442. * @function SuperMap.LevelRenderer.Storage.prototype.hasHoverShape
  56443. * @description 是否有图形在高亮层里。
  56444. * @return {boolean} 是否有图形在高亮层里。
  56445. */
  56446. }, {
  56447. key: "hasHoverShape",
  56448. value: function hasHoverShape() {
  56449. return this._hoverElements.length > 0;
  56450. }
  56451. /**
  56452. * @function SuperMap.LevelRenderer.Storage.prototype.addRoot
  56453. * @description 添加图形(Shape)或者组(Group)到根节点。
  56454. *
  56455. * @param {(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)} el - 图形。
  56456. *
  56457. */
  56458. }, {
  56459. key: "addRoot",
  56460. value: function addRoot(el) {
  56461. if (el instanceof Group) {
  56462. el.addChildrenToStorage(this);
  56463. }
  56464. this.addToMap(el);
  56465. this._roots.push(el);
  56466. }
  56467. /**
  56468. * @function SuperMap.LevelRenderer.Storage.prototype.delRoot
  56469. * @description 删除指定的图形(Shape)或者组(Group)。
  56470. *
  56471. * @param {Array.<string>} elId - 删除图形(Shape)或者组(Group)的 id 数组。如果为空清空整个Storage。
  56472. *
  56473. */
  56474. }, {
  56475. key: "delRoot",
  56476. value: function delRoot(elId) {
  56477. if (typeof elId == 'undefined') {
  56478. // 不指定elId清空
  56479. for (var i = 0; i < this._roots.length; i++) {
  56480. var root = this._roots[i];
  56481. if (root instanceof Group) {
  56482. root.delChildrenFromStorage(this);
  56483. }
  56484. }
  56485. this._elements = {};
  56486. this._hoverElements = [];
  56487. this._roots = [];
  56488. return;
  56489. }
  56490. if (elId instanceof Array) {
  56491. var elIdLen = elId.length;
  56492. for (var _i4 = 0; _i4 < elIdLen; _i4++) {
  56493. this.delRoot(elId[_i4]);
  56494. }
  56495. return;
  56496. }
  56497. var el;
  56498. if (typeof elId == 'string') {
  56499. el = this._elements[elId];
  56500. } else {
  56501. el = elId;
  56502. }
  56503. var idx = new Util_Util().indexOf(this._roots, el);
  56504. if (idx >= 0) {
  56505. this.delFromMap(el.id);
  56506. this._roots.splice(idx, 1);
  56507. if (el instanceof Group) {
  56508. el.delChildrenFromStorage(this);
  56509. }
  56510. }
  56511. }
  56512. /**
  56513. * @function SuperMap.LevelRenderer.Storage.prototype.addToMap
  56514. * @description 添加图形到 map。
  56515. *
  56516. * @param {SuperMap.LevelRenderer.Shape} el - 图形。
  56517. * @return {SuperMap.LevelRenderer.Storage} this。
  56518. */
  56519. }, {
  56520. key: "addToMap",
  56521. value: function addToMap(el) {
  56522. if (el instanceof Group) {
  56523. el._storage = this;
  56524. }
  56525. el.modSelf();
  56526. this._elements[el.id] = el;
  56527. return this;
  56528. }
  56529. /**
  56530. * @function SuperMap.LevelRenderer.Storage.prototype.get
  56531. * @description 获取指定图形。
  56532. *
  56533. * @param {string} elId - 图形 id。
  56534. * @return {SuperMap.LevelRenderer.Shape} 图形。
  56535. */
  56536. }, {
  56537. key: "get",
  56538. value: function get(elId) {
  56539. return this._elements[elId];
  56540. }
  56541. /**
  56542. * @function SuperMap.LevelRenderer.Storage.prototype.delFromMap
  56543. * @description 从 map 中删除指定图形。
  56544. *
  56545. * @param {string} elId - 图形id。
  56546. * @return {SuperMap.LevelRenderer.Storage} this。
  56547. */
  56548. }, {
  56549. key: "delFromMap",
  56550. value: function delFromMap(elId) {
  56551. var el = this._elements[elId];
  56552. if (el) {
  56553. delete this._elements[elId];
  56554. if (el instanceof Group) {
  56555. el._storage = null;
  56556. }
  56557. }
  56558. return this;
  56559. }
  56560. /**
  56561. * @function SuperMap.LevelRenderer.Storage.prototype.dispose
  56562. * @description 清空并且释放 Storage。
  56563. */
  56564. }, {
  56565. key: "dispose",
  56566. value: function dispose() {
  56567. this._elements = null; // this._renderList = null;
  56568. this._roots = null;
  56569. this._hoverElements = null;
  56570. }
  56571. }], [{
  56572. key: "shapeCompareFunc",
  56573. value: function shapeCompareFunc(a, b) {
  56574. if (a.zlevel == b.zlevel) {
  56575. if (a.z == b.z) {
  56576. return a.__renderidx - b.__renderidx;
  56577. }
  56578. return a.z - b.z;
  56579. }
  56580. return a.zlevel - b.zlevel;
  56581. }
  56582. }]);
  56583. return Storage;
  56584. }();
  56585. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Painter.js
  56586. function Painter_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Painter_typeof = function _typeof(obj) { return typeof obj; }; } else { Painter_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Painter_typeof(obj); }
  56587. 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 } }); if (superClass) Painter_setPrototypeOf(subClass, superClass); }
  56588. function Painter_setPrototypeOf(o, p) { Painter_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Painter_setPrototypeOf(o, p); }
  56589. 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); }; }
  56590. function Painter_possibleConstructorReturn(self, call) { if (call && (Painter_typeof(call) === "object" || typeof call === "function")) { return call; } return Painter_assertThisInitialized(self); }
  56591. function Painter_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  56592. function Painter_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  56593. function Painter_getPrototypeOf(o) { Painter_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Painter_getPrototypeOf(o); }
  56594. function Painter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  56595. 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); } }
  56596. function Painter_createClass(Constructor, protoProps, staticProps) { if (protoProps) Painter_defineProperties(Constructor.prototype, protoProps); if (staticProps) Painter_defineProperties(Constructor, staticProps); return Constructor; }
  56597. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  56598. * This program are made available under the terms of the Apache License, Version 2.0
  56599. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  56600. /**
  56601. * @private
  56602. * @class SuperMap.LevelRenderer.Painter
  56603. * @category Visualization Theme
  56604. * @classdesc Painter 绘图模块。
  56605. */
  56606. var Painter = /*#__PURE__*/function () {
  56607. /**
  56608. * @function SuperMap.LevelRenderer.Painter.constructor
  56609. * @description 构造函数。
  56610. *
  56611. * @param {HTMLElement} root - 绘图区域(DIV)。
  56612. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  56613. *
  56614. */
  56615. function Painter(root, storage) {
  56616. Painter_classCallCheck(this, Painter);
  56617. /**
  56618. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype.root
  56619. * @description 绘图容器。
  56620. *
  56621. */
  56622. this.root = root;
  56623. /**
  56624. * @member {Array} SuperMap.LevelRenderer.Painter.prototype.storage
  56625. * @description 图形仓库。
  56626. *
  56627. */
  56628. this.storage = storage;
  56629. /**
  56630. * @member {HTMLElement} SuperMap.LevelRenderer.Painter.prototype._domRoot
  56631. * @description 容器根 dom 对象。
  56632. *
  56633. */
  56634. this._domRoot = null;
  56635. /**
  56636. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layers
  56637. * @description 绘制层对象。
  56638. *
  56639. */
  56640. this._layers = {};
  56641. /**
  56642. * @member {Array} SuperMap.LevelRenderer.Painter.prototype._zlevelList
  56643. * @description 层列表。
  56644. *
  56645. */
  56646. this._zlevelList = [];
  56647. /**
  56648. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._layerConfig
  56649. * @description 绘制层配置对象。
  56650. *
  56651. */
  56652. this._layerConfig = {};
  56653. /**
  56654. * @member {Object} SuperMap.LevelRenderer.Painter.prototype._bgDom
  56655. * @description 背景层 Canvas (Dom)。
  56656. *
  56657. */
  56658. this._bgDom = null;
  56659. /**
  56660. * @member {Function} SuperMap.LevelRenderer.Painter.prototype.shapeToImage
  56661. * @description 形状转图像函数。
  56662. *
  56663. */
  56664. this.shapeToImage = null; // retina 屏幕优化
  56665. Painter.devicePixelRatio = Math.max(window.devicePixelRatio || 1, 1);
  56666. this.CLASS_NAME = "SuperMap.LevelRenderer.Painter";
  56667. this.root.innerHTML = '';
  56668. this._width = this._getWidth(); // 宽,缓存记录
  56669. this._height = this._getHeight(); // 高,缓存记录
  56670. var domRoot = document.createElement('div');
  56671. this._domRoot = domRoot; // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
  56672. domRoot.style.position = 'relative';
  56673. domRoot.style.overflow = 'hidden';
  56674. domRoot.style.width = this._width + 'px';
  56675. domRoot.style.height = this._height + 'px';
  56676. this.root.appendChild(domRoot);
  56677. this.shapeToImage = this._createShapeToImageProcessor(); // 创建各层canvas
  56678. // 背景
  56679. //this._bgDom = Painter.createDom('bg', 'div', this);
  56680. this._bgDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme_background_"), 'div', this);
  56681. domRoot.appendChild(this._bgDom);
  56682. this._bgDom.onselectstart = returnFalse;
  56683. this._bgDom.style['-webkit-user-select'] = 'none';
  56684. this._bgDom.style['user-select'] = 'none';
  56685. this._bgDom.style['-webkit-touch-callout'] = 'none'; // 高亮
  56686. //var hoverLayer = new PaintLayer('_hoverLayer_', this);
  56687. var hoverLayer = new PaintLayer(Util.createUniqueID("_highLightLayer_"), this);
  56688. this._layers['hover'] = hoverLayer;
  56689. domRoot.appendChild(hoverLayer.dom);
  56690. hoverLayer.initContext();
  56691. hoverLayer.dom.onselectstart = returnFalse;
  56692. hoverLayer.dom.style['-webkit-user-select'] = 'none';
  56693. hoverLayer.dom.style['user-select'] = 'none';
  56694. hoverLayer.dom.style['-webkit-touch-callout'] = 'none';
  56695. var me = this;
  56696. this.updatePainter = function (shapeList, callback) {
  56697. me.refreshShapes(shapeList, callback);
  56698. }; // 返回false的方法,用于避免页面被选中
  56699. function returnFalse() {
  56700. return false;
  56701. }
  56702. /* eslint-disable */
  56703. // 什么都不干的空方法
  56704. function doNothing() {//NOSONAR
  56705. }
  56706. /* eslint-enable */
  56707. }
  56708. /**
  56709. * @function SuperMap.LevelRenderer.Painter.prototype.destroy
  56710. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  56711. */
  56712. Painter_createClass(Painter, [{
  56713. key: "destroy",
  56714. value: function destroy() {
  56715. this.dispose();
  56716. this._zlevelList = null;
  56717. this._layerConfig = null;
  56718. this._bgDom = null;
  56719. this.shapeToImage = null;
  56720. }
  56721. /**
  56722. * @function SuperMap.LevelRenderer.Painter.prototype.render
  56723. * @description 渲染。首次绘图,创建各种 dom 和 context。
  56724. *
  56725. * @param {Function} callback - 绘画结束后的回调函数。
  56726. * @return {SuperMap.LevelRenderer.Painter} this。
  56727. */
  56728. }, {
  56729. key: "render",
  56730. value: function render(callback) {
  56731. // TODO
  56732. this.refresh(callback, true);
  56733. return this;
  56734. }
  56735. /**
  56736. * @function SuperMap.LevelRenderer.Painter.prototype.refresh
  56737. * @description 刷新。
  56738. *
  56739. * @param {Function} callback - 刷新结束后的回调函数。
  56740. * @param {boolean} paintAll - 强制绘制所有 shape。
  56741. * @return {SuperMap.LevelRenderer.Painter} this。
  56742. */
  56743. }, {
  56744. key: "refresh",
  56745. value: function refresh(callback, paintAll) {
  56746. var list = this.storage.getShapeList(true);
  56747. this._paintList(list, paintAll);
  56748. if (typeof callback == 'function') {
  56749. callback();
  56750. }
  56751. return this;
  56752. }
  56753. /**
  56754. * Method: _paintList
  56755. * 按列表绘制图形。
  56756. */
  56757. }, {
  56758. key: "_paintList",
  56759. value: function _paintList(list, paintAll) {
  56760. if (typeof paintAll == 'undefined') {
  56761. paintAll = false;
  56762. }
  56763. this._updateLayerStatus(list);
  56764. var currentLayer;
  56765. var currentZLevel;
  56766. var ctx;
  56767. for (var id in this._layers) {
  56768. if (id !== 'hover') {
  56769. this._layers[id].unusedCount++;
  56770. this._layers[id].updateTransform();
  56771. }
  56772. }
  56773. var invTransform = [];
  56774. for (var i = 0, l = list.length; i < l; i++) {
  56775. var shape = list[i];
  56776. if (currentZLevel !== shape.zlevel) {
  56777. if (currentLayer && currentLayer.needTransform) {
  56778. ctx.restore();
  56779. }
  56780. currentLayer = this.getLayer(shape.zlevel);
  56781. ctx = currentLayer.ctx;
  56782. currentZLevel = shape.zlevel; // Reset the count
  56783. currentLayer.unusedCount = 0;
  56784. if (currentLayer.dirty || paintAll) {
  56785. currentLayer.clear();
  56786. }
  56787. if (currentLayer.needTransform) {
  56788. ctx.save();
  56789. currentLayer.setTransform(ctx);
  56790. }
  56791. } // Start group clipping
  56792. if (ctx && shape.__startClip) {
  56793. var clipShape = shape.__startClip;
  56794. ctx.save(); // Set transform
  56795. if (clipShape.needTransform) {
  56796. var m = clipShape.transform;
  56797. SUtil_SUtil.Util_matrix.invert(invTransform, m);
  56798. ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
  56799. }
  56800. ctx.beginPath();
  56801. clipShape.buildPath(ctx, clipShape.style);
  56802. ctx.clip(); // Transform back
  56803. if (clipShape.needTransform) {
  56804. var _m = invTransform;
  56805. ctx.transform(_m[0], _m[1], _m[2], _m[3], _m[4], _m[5]);
  56806. }
  56807. }
  56808. if ((currentLayer && currentLayer.dirty || paintAll) && !shape.invisible) {
  56809. if (!shape.onbrush || shape.onbrush && !shape.onbrush(ctx, false)) {
  56810. if (Config.catchBrushException) {
  56811. try {
  56812. shape.brush(ctx, false, this.updatePainter);
  56813. } catch (error) {
  56814. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  56815. }
  56816. } else {
  56817. shape.brush(ctx, false, this.updatePainter);
  56818. }
  56819. }
  56820. } // Stop group clipping
  56821. if (ctx && shape.__stopClip) {
  56822. ctx.restore();
  56823. }
  56824. shape.__dirty = false;
  56825. }
  56826. if (ctx && currentLayer && currentLayer.needTransform) {
  56827. ctx.restore();
  56828. }
  56829. for (var _id in this._layers) {
  56830. if (_id !== 'hover') {
  56831. var layer = this._layers[_id];
  56832. layer.dirty = false; // 删除过期的层
  56833. // PENDING
  56834. // if (layer.unusedCount >= 500) {
  56835. // this.delLayer(id);
  56836. // }
  56837. if (layer.unusedCount == 1) {
  56838. layer.clear();
  56839. }
  56840. }
  56841. }
  56842. }
  56843. /**
  56844. * @function SuperMap.LevelRenderer.Painter.prototype.getLayer
  56845. * @description 获取 zlevel 所在层,如果不存在则会创建一个新的层。
  56846. *
  56847. * @param {number} zlevel - zlevel。
  56848. * @return {SuperMap.LevelRenderer.Painter} this。
  56849. */
  56850. }, {
  56851. key: "getLayer",
  56852. value: function getLayer(zlevel) {
  56853. // Change draw layer
  56854. var currentLayer = this._layers[zlevel];
  56855. if (!currentLayer) {
  56856. var len = this._zlevelList.length;
  56857. var prevLayer = null;
  56858. var i = -1;
  56859. if (len > 0 && zlevel > this._zlevelList[0]) {
  56860. for (i = 0; i < len - 1; i++) {
  56861. if (this._zlevelList[i] < zlevel && this._zlevelList[i + 1] > zlevel) {
  56862. break;
  56863. }
  56864. }
  56865. prevLayer = this._layers[this._zlevelList[i]];
  56866. }
  56867. this._zlevelList.splice(i + 1, 0, zlevel); // Create a new layer
  56868. //currentLayer = new PaintLayer(zlevel, this);
  56869. currentLayer = new PaintLayer(Util.createUniqueID("_levelLayer_" + zlevel), this);
  56870. var prevDom = prevLayer ? prevLayer.dom : this._bgDom;
  56871. if (prevDom.nextSibling) {
  56872. prevDom.parentNode.insertBefore(currentLayer.dom, prevDom.nextSibling);
  56873. } else {
  56874. prevDom.parentNode.appendChild(currentLayer.dom);
  56875. }
  56876. currentLayer.initContext();
  56877. this._layers[zlevel] = currentLayer;
  56878. if (this._layerConfig[zlevel]) {
  56879. new Util_Util().merge(currentLayer, this._layerConfig[zlevel], true);
  56880. }
  56881. currentLayer.updateTransform();
  56882. }
  56883. return currentLayer;
  56884. }
  56885. /**
  56886. * @function SuperMap.LevelRenderer.Painter.prototype.getLayers
  56887. * @description 获取所有已创建的层。
  56888. * @return {Array.<Painter.Layer>} 已创建的层
  56889. */
  56890. }, {
  56891. key: "getLayers",
  56892. value: function getLayers() {
  56893. return this._layers;
  56894. }
  56895. /**
  56896. * Method: _updateLayerStatus
  56897. * 更新绘制层状态。
  56898. */
  56899. }, {
  56900. key: "_updateLayerStatus",
  56901. value: function _updateLayerStatus(list) {
  56902. var layers = this._layers;
  56903. var elCounts = {};
  56904. for (var z in layers) {
  56905. if (z !== 'hover') {
  56906. elCounts[z] = layers[z].elCount;
  56907. layers[z].elCount = 0;
  56908. }
  56909. }
  56910. for (var i = 0; i < list.length; i++) {
  56911. var shape = list[i];
  56912. var zlevel = shape.zlevel;
  56913. var layer = layers[zlevel];
  56914. if (layer) {
  56915. layer.elCount++; // 已经被标记为需要刷新
  56916. if (layer.dirty) {
  56917. continue;
  56918. }
  56919. layer.dirty = shape.__dirty;
  56920. }
  56921. } // 层中的元素数量有发生变化
  56922. for (var _z in layers) {
  56923. if (_z !== 'hover') {
  56924. if (elCounts[_z] !== layers[_z].elCount) {
  56925. layers[_z].dirty = true;
  56926. }
  56927. }
  56928. }
  56929. }
  56930. /**
  56931. * @function SuperMap.LevelRenderer.Painter.prototype.refreshShapes
  56932. * @description 更新的图形元素列表。
  56933. *
  56934. * @param {number} shapeList - 需要更新的图形元素列表。
  56935. * @param {number} callback - 视图更新后回调函数。
  56936. * @return {SuperMap.LevelRenderer.Painter} this。
  56937. */
  56938. }, {
  56939. key: "refreshShapes",
  56940. value: function refreshShapes(shapeList, callback) {
  56941. for (var i = 0, l = shapeList.length; i < l; i++) {
  56942. var shape = shapeList[i];
  56943. this.storage.mod(shape.id);
  56944. }
  56945. this.refresh(callback);
  56946. return this;
  56947. }
  56948. /**
  56949. * @function SuperMap.LevelRenderer.Painter.prototype.clear
  56950. * @description 清除 hover 层外所有内容。
  56951. * @return {SuperMap.LevelRenderer.Painter} this。
  56952. */
  56953. }, {
  56954. key: "clear",
  56955. value: function clear() {
  56956. for (var k in this._layers) {
  56957. if (k == 'hover') {
  56958. continue;
  56959. }
  56960. this._layers[k].clear();
  56961. }
  56962. return this;
  56963. }
  56964. /**
  56965. * @function SuperMap.LevelRenderer.Painter.prototype.modLayer
  56966. * @description 修改指定 zlevel 的绘制参数。
  56967. *
  56968. * @param {string} zlevel - zlevel。
  56969. * @param {Object} config - 配置对象。
  56970. * @param {string} [config.clearColor=0] - 每次清空画布的颜色。
  56971. * @param {boolean} [config.motionBlur=false] - 是否开启动态模糊。
  56972. * @param {number} [config.lastFrameAlpha=0.7] - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  56973. * @param {Array.<number>} config.position - 层的平移。
  56974. * @param {Array.<number>} config.rotation - 层的旋转。
  56975. * @param {Array.<number>} config.scale - 层的缩放。
  56976. * @param {boolean} config.zoomable - 层是否支持鼠标缩放操作。默认值:false。
  56977. * @param {boolean} config.panable - 层是否支持鼠标平移操作。默认值:false。
  56978. *
  56979. */
  56980. }, {
  56981. key: "modLayer",
  56982. value: function modLayer(zlevel, config) {
  56983. if (config) {
  56984. if (!this._layerConfig[zlevel]) {
  56985. this._layerConfig[zlevel] = config;
  56986. } else {
  56987. new Util_Util().merge(this._layerConfig[zlevel], config, true);
  56988. }
  56989. var layer = this._layers[zlevel];
  56990. if (layer) {
  56991. new Util_Util().merge(layer, this._layerConfig[zlevel], true);
  56992. }
  56993. }
  56994. }
  56995. /**
  56996. * @function SuperMap.LevelRenderer.Painter.prototype.delLayer
  56997. * @description 删除指定层。
  56998. *
  56999. * @param {string} zlevel - 层所在的 zlevel。
  57000. */
  57001. }, {
  57002. key: "delLayer",
  57003. value: function delLayer(zlevel) {
  57004. var layer = this._layers[zlevel];
  57005. if (!layer) {
  57006. return;
  57007. } // Save config
  57008. this.modLayer(zlevel, {
  57009. position: layer.position,
  57010. rotation: layer.rotation,
  57011. scale: layer.scale
  57012. });
  57013. layer.dom.parentNode.removeChild(layer.dom);
  57014. delete this._layers[zlevel];
  57015. this._zlevelList.splice(new Util_Util().indexOf(this._zlevelList, zlevel), 1);
  57016. }
  57017. /**
  57018. * @function SuperMap.LevelRenderer.Painter.prototype.refreshHover
  57019. * @description 刷新 hover 层。
  57020. * @return {SuperMap.LevelRenderer.Painter} this。
  57021. */
  57022. }, {
  57023. key: "refreshHover",
  57024. value: function refreshHover() {
  57025. this.clearHover();
  57026. var list = this.storage.getHoverShapes(true);
  57027. for (var i = 0, l = list.length; i < l; i++) {
  57028. this._brushHover(list[i]);
  57029. }
  57030. this.storage.delHover();
  57031. return this;
  57032. }
  57033. /**
  57034. * @function SuperMap.LevelRenderer.Painter.prototype.clearHover
  57035. * @description 清除 hover 层所有内容。
  57036. * @return {SuperMap.LevelRenderer.Painter} this。
  57037. */
  57038. }, {
  57039. key: "clearHover",
  57040. value: function clearHover() {
  57041. var hover = this._layers.hover;
  57042. hover && hover.clear();
  57043. return this;
  57044. }
  57045. /**
  57046. * @function SuperMap.LevelRenderer.Painter.prototype.resize
  57047. * @description 区域大小变化后重绘。
  57048. * @return {SuperMap.LevelRenderer.Painter} this。
  57049. */
  57050. }, {
  57051. key: "resize",
  57052. value: function resize() {
  57053. var domRoot = this._domRoot;
  57054. domRoot.style.display = 'none';
  57055. var width = this._getWidth();
  57056. var height = this._getHeight();
  57057. domRoot.style.display = ''; // 优化没有实际改变的resize
  57058. if (this._width != width || height != this._height) {
  57059. this._width = width;
  57060. this._height = height;
  57061. domRoot.style.width = width + 'px';
  57062. domRoot.style.height = height + 'px';
  57063. for (var id in this._layers) {
  57064. this._layers[id].resize(width, height);
  57065. }
  57066. this.refresh(null, true);
  57067. }
  57068. return this;
  57069. }
  57070. /**
  57071. * @function SuperMap.LevelRenderer.Painter.prototype.clearLayer
  57072. * @description 清除指定的一个层。
  57073. * @param {number} zLevel - 层。
  57074. */
  57075. }, {
  57076. key: "clearLayer",
  57077. value: function clearLayer(zLevel) {
  57078. var layer = this._layers[zLevel];
  57079. if (layer) {
  57080. layer.clear();
  57081. }
  57082. }
  57083. /**
  57084. * @function SuperMap.LevelRenderer.Painter.prototype.dispose
  57085. * @description 释放。
  57086. *
  57087. */
  57088. }, {
  57089. key: "dispose",
  57090. value: function dispose() {
  57091. this.root.innerHTML = '';
  57092. this.root = null;
  57093. this.storage = null;
  57094. this._domRoot = null;
  57095. this._layers = null;
  57096. }
  57097. /**
  57098. * @function SuperMap.LevelRenderer.Painter.prototype.getDomHover
  57099. * @description 获取 Hover 层的 Dom。
  57100. */
  57101. }, {
  57102. key: "getDomHover",
  57103. value: function getDomHover() {
  57104. return this._layers.hover.dom;
  57105. }
  57106. /**
  57107. * @function SuperMap.LevelRenderer.Painter.prototype.toDataURL
  57108. * @description 图像导出。
  57109. * @param {string} type - 图片类型。
  57110. * @param {string} backgroundColor - 背景色。默认值:'#fff'。
  57111. * @param {Object} args
  57112. * @return {string} 图片的Base64 url。
  57113. */
  57114. }, {
  57115. key: "toDataURL",
  57116. value: function toDataURL(type, backgroundColor, args) {
  57117. //var imageDom = Painter.createDom('image', 'canvas', this);
  57118. var imageDom = Painter.createDom(Util.createUniqueID("SuperMap.Theme.image_"), 'canvas', this);
  57119. this._bgDom.appendChild(imageDom);
  57120. var ctx = imageDom.getContext('2d');
  57121. Painter.devicePixelRatio != 1 && ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57122. ctx.fillStyle = backgroundColor || '#fff';
  57123. ctx.rect(0, 0, this._width * Painter.devicePixelRatio, this._height * Painter.devicePixelRatio);
  57124. ctx.fill();
  57125. var self = this; // 升序遍历,shape上的zlevel指定绘画图层的z轴层叠
  57126. this.storage.iterShape(function (shape) {
  57127. if (!shape.invisible) {
  57128. if (!shape.onbrush // 没有onbrush
  57129. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  57130. || shape.onbrush && !shape.onbrush(ctx, false)) {
  57131. if (Config.catchBrushException) {
  57132. try {
  57133. shape.brush(ctx, false, self.updatePainter);
  57134. } catch (error) {
  57135. SUtil_SUtil.Util_log(error, 'brush error of ' + shape.type, shape);
  57136. }
  57137. } else {
  57138. shape.brush(ctx, false, self.updatePainter);
  57139. }
  57140. }
  57141. }
  57142. }, {
  57143. normal: 'up',
  57144. update: true
  57145. });
  57146. var image = imageDom.toDataURL(type, args);
  57147. ctx = null;
  57148. this._bgDom.removeChild(imageDom);
  57149. return image;
  57150. }
  57151. /**
  57152. * @function SuperMap.LevelRenderer.Painter.prototype.getWidth
  57153. * @description 获取绘图区域宽度。
  57154. * @return {number} 绘图区域宽度。
  57155. */
  57156. }, {
  57157. key: "getWidth",
  57158. value: function getWidth() {
  57159. return this._width;
  57160. }
  57161. /**
  57162. * @function SuperMap.LevelRenderer.Painter.prototype.getHeight
  57163. * @description 获取绘图区域高度。
  57164. * @return {number} 绘图区域高度。
  57165. */
  57166. }, {
  57167. key: "getHeight",
  57168. value: function getHeight() {
  57169. return this._height;
  57170. }
  57171. /**
  57172. * Method: _getWidth
  57173. *
  57174. */
  57175. }, {
  57176. key: "_getWidth",
  57177. value: function _getWidth() {
  57178. var root = this.root;
  57179. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  57180. return ((root.clientWidth || parseInt(stl.width, 10)) - parseInt(stl.paddingLeft, 10) // 请原谅我这比较粗暴
  57181. - parseInt(stl.paddingRight, 10)).toFixed(0) - 0;
  57182. }
  57183. /**
  57184. * Method: _getHeight
  57185. *
  57186. */
  57187. }, {
  57188. key: "_getHeight",
  57189. value: function _getHeight() {
  57190. var root = this.root;
  57191. var stl = root.currentStyle || document.defaultView.getComputedStyle(root);
  57192. return ((root.clientHeight || parseInt(stl.height, 10)) - parseInt(stl.paddingTop, 10) // 请原谅我这比较粗暴
  57193. - parseInt(stl.paddingBottom, 10)).toFixed(0) - 0;
  57194. }
  57195. /**
  57196. * Method: _brushHover
  57197. *
  57198. */
  57199. }, {
  57200. key: "_brushHover",
  57201. value: function _brushHover(shape) {
  57202. var ctx = this._layers.hover.ctx;
  57203. if (!shape.onbrush // 没有onbrush
  57204. // 有onbrush并且调用执行返回false或undefined则继续粉刷
  57205. || shape.onbrush && !shape.onbrush(ctx, true)) {
  57206. var layer = this.getLayer(shape.zlevel);
  57207. if (layer.needTransform) {
  57208. ctx.save();
  57209. layer.setTransform(ctx);
  57210. } // Retina 优化
  57211. if (Config.catchBrushException) {
  57212. try {
  57213. shape.brush(ctx, true, this.updatePainter);
  57214. } catch (error) {
  57215. SUtil_SUtil.Util_log(error, 'hoverBrush error of ' + shape.type, shape);
  57216. }
  57217. } else {
  57218. shape.brush(ctx, true, this.updatePainter);
  57219. }
  57220. if (layer.needTransform) {
  57221. ctx.restore();
  57222. }
  57223. }
  57224. }
  57225. /**
  57226. * Method: _shapeToImage
  57227. *
  57228. */
  57229. }, {
  57230. key: "_shapeToImage",
  57231. value: function _shapeToImage(id, shape, width, height, devicePixelRatio) {
  57232. var canvas = document.createElement('canvas');
  57233. var ctx = canvas.getContext('2d');
  57234. var _devicePixelRatio = devicePixelRatio || window.devicePixelRatio || 1;
  57235. canvas.style.width = width + 'px';
  57236. canvas.style.height = height + 'px';
  57237. canvas.setAttribute('width', width * _devicePixelRatio);
  57238. canvas.setAttribute('height', height * _devicePixelRatio);
  57239. ctx.clearRect(0, 0, width * _devicePixelRatio, height * _devicePixelRatio);
  57240. var shapeTransform = {
  57241. position: shape.position,
  57242. rotation: shape.rotation,
  57243. scale: shape.scale
  57244. };
  57245. shape.position = [0, 0, 0];
  57246. shape.rotation = 0;
  57247. shape.scale = [1, 1];
  57248. if (shape) {
  57249. shape.brush(ctx, false);
  57250. }
  57251. var imgShape = new SmicImage({
  57252. id: id,
  57253. style: {
  57254. x: 0,
  57255. y: 0,
  57256. image: canvas
  57257. }
  57258. });
  57259. if (shapeTransform.position != null) {
  57260. imgShape.position = shape.position = shapeTransform.position;
  57261. }
  57262. if (shapeTransform.rotation != null) {
  57263. imgShape.rotation = shape.rotation = shapeTransform.rotation;
  57264. }
  57265. if (shapeTransform.scale != null) {
  57266. imgShape.scale = shape.scale = shapeTransform.scale;
  57267. }
  57268. return imgShape;
  57269. }
  57270. /**
  57271. * Method: _createShapeToImageProcessor
  57272. *
  57273. */
  57274. }, {
  57275. key: "_createShapeToImageProcessor",
  57276. value: function _createShapeToImageProcessor() {
  57277. var me = this;
  57278. return function (id, e, width, height) {
  57279. return me._shapeToImage(id, e, width, height, Painter.devicePixelRatio);
  57280. };
  57281. } // SMIC-方法扩展 - start
  57282. /**
  57283. * @function SuperMap.LevelRenderer.Painter.prototype.updateHoverLayer
  57284. * @description 更新设置显示高亮图层。
  57285. * @param {Array} shapes - 图形数组。
  57286. */
  57287. }, {
  57288. key: "updateHoverLayer",
  57289. value: function updateHoverLayer(shapes) {
  57290. if (!(shapes instanceof Array)) {
  57291. return this;
  57292. } //清除高亮
  57293. this.clearHover();
  57294. this.storage.delHover();
  57295. for (var i = 0; i < shapes.length; i++) {
  57296. this.storage.addHover(shapes[i]);
  57297. this._brushHover(shapes[i]);
  57298. }
  57299. }
  57300. /**
  57301. * @function SuperMap.LevelRenderer.Painter.prototype.createDom
  57302. * @description 创建 Dom。
  57303. *
  57304. * @param {string} id - Dom id
  57305. * @param {string} type - Dom type
  57306. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  57307. * @return {Object} Dom
  57308. */
  57309. }], [{
  57310. key: "createDom",
  57311. value: function createDom(id, type, painter) {
  57312. var newDom = document.createElement(type);
  57313. var width = painter._width;
  57314. var height = painter._height; // 没append呢,请原谅我这样写,清晰~
  57315. newDom.style.position = 'absolute';
  57316. newDom.style.left = 0;
  57317. newDom.style.top = 0;
  57318. newDom.style.width = width + 'px';
  57319. newDom.style.height = height + 'px';
  57320. newDom.setAttribute('width', width * Painter.devicePixelRatio);
  57321. newDom.setAttribute('height', height * Painter.devicePixelRatio); // id不作为索引用,避免可能造成的重名,定义为私有属性
  57322. //newDom.setAttribute('data-zr-dom-id', id);
  57323. newDom.setAttribute('id', id);
  57324. return newDom;
  57325. }
  57326. }]);
  57327. return Painter;
  57328. }();
  57329. /**
  57330. * @private
  57331. * @class Painter.Layer
  57332. * @classdesc 绘制层类。
  57333. * @extends SuperMap.LevelRenderer.Transformable
  57334. */
  57335. var PaintLayer = /*#__PURE__*/function (_Transformable) {
  57336. Painter_inherits(PaintLayer, _Transformable);
  57337. var _super = Painter_createSuper(PaintLayer);
  57338. /**
  57339. * @function Painter.Layer.constructor
  57340. * @description 构造函数。
  57341. *
  57342. * @param {string} id - id。
  57343. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  57344. *
  57345. */
  57346. function PaintLayer(id, painter) {
  57347. var _this;
  57348. Painter_classCallCheck(this, PaintLayer);
  57349. _this = _super.call(this, id, painter);
  57350. /**
  57351. * @member {Object} Painter.Layer.prototype.dom
  57352. * @description dom。
  57353. */
  57354. _this.dom = null;
  57355. /**
  57356. * @member {Object} Painter.Layer.prototype.domBack
  57357. * @description domBack。
  57358. */
  57359. _this.domBack = null;
  57360. /**
  57361. * @member {Object} Painter.Layer.prototype.ctxBack
  57362. * @description ctxBack。
  57363. */
  57364. _this.ctxBack = null;
  57365. /**
  57366. * @member {SuperMap.LevelRenderer.Painter} Painter.Layer.prototype.painter
  57367. * @description painter。
  57368. */
  57369. _this.painter = painter;
  57370. /**
  57371. * @member {number} Painter.Layer.prototype.unusedCount
  57372. * @description unusedCount。
  57373. */
  57374. _this.unusedCount = 0;
  57375. /**
  57376. * @member {Object} Painter.Layer.prototype.config
  57377. * @description config。
  57378. */
  57379. _this.config = null;
  57380. /**
  57381. * @member {boolean} Painter.Layer.prototype.dirty
  57382. * @description dirty。
  57383. */
  57384. _this.dirty = true;
  57385. /**
  57386. * @member {number} Painter.Layer.prototype.elCount
  57387. * @description elCount。
  57388. */
  57389. _this.elCount = 0; // Configs
  57390. /**
  57391. * @member {string} Painter.Layer.prototype.clearColor
  57392. * @description 每次清空画布的颜色。默认值:0;
  57393. */
  57394. _this.clearColor = 0;
  57395. /**
  57396. * @member {boolean} Painter.Layer.prototype.motionBlur
  57397. * @description 是否开启动态模糊。默认值:false;
  57398. */
  57399. _this.motionBlur = false;
  57400. /**
  57401. * @member {number} Painter.Layer.prototype.lastFrameAlpha
  57402. * @description 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
  57403. */
  57404. _this.lastFrameAlpha = 0.7;
  57405. /**
  57406. * @member {boolean} Painter.Layer.prototype.zoomable
  57407. * @description 层是否支持鼠标平移操作。默认值:false;
  57408. */
  57409. _this.zoomable = false;
  57410. /**
  57411. * @member {boolean} Painter.Layer.prototype.panable
  57412. * @description 层是否支持鼠标缩放操作。默认值:false;
  57413. */
  57414. _this.panable = false;
  57415. /**
  57416. * @member {number} Painter.Layer.prototype.maxZoom
  57417. * @description maxZoom。默认值:Infinity。
  57418. */
  57419. _this.maxZoom = Infinity;
  57420. /**
  57421. * @member {number} Painter.Layer.prototype.minZoom
  57422. * @description minZoom。默认值:0。
  57423. */
  57424. _this.minZoom = 0;
  57425. /**
  57426. * @member {number} Painter.Layer.prototype.ctx
  57427. * @description Canvas 上下文。
  57428. */
  57429. _this.ctx = null;
  57430. _this.dom = Painter.createDom(Util.createUniqueID("SuperMap.Theme" + id), 'canvas', painter);
  57431. _this.dom.onselectstart = returnFalse; // 避免页面选中的尴尬
  57432. _this.dom.style['-webkit-user-select'] = 'none';
  57433. _this.dom.style['user-select'] = 'none';
  57434. _this.dom.style['-webkit-touch-callout'] = 'none'; // Function
  57435. // 返回false的方法,用于避免页面被选中
  57436. function returnFalse() {
  57437. return false;
  57438. }
  57439. _this.CLASS_NAME = "SuperMap.LevelRenderer.Painter.Layer";
  57440. return _this;
  57441. }
  57442. /**
  57443. * @function Painter.Layer.prototype.destroy
  57444. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  57445. */
  57446. Painter_createClass(PaintLayer, [{
  57447. key: "destroy",
  57448. value: function destroy() {
  57449. this.dom = null;
  57450. this.domBack = null;
  57451. this.ctxBack = null;
  57452. this.painter = null;
  57453. this.unusedCount = null;
  57454. this.config = null;
  57455. this.dirty = null;
  57456. this.elCount = null;
  57457. this.clearColor = null;
  57458. this.motionBlur = null;
  57459. this.lastFrameAlpha = null;
  57460. this.zoomable = null;
  57461. this.panable = null;
  57462. this.maxZoom = null;
  57463. this.minZoom = null;
  57464. this.ctx = null;
  57465. Transformable.destroy.apply(this, arguments);
  57466. }
  57467. /**
  57468. * @function Painter.Layer.prototype.initContext
  57469. * @description 初始化 Canvan 2D 上下文。
  57470. */
  57471. }, {
  57472. key: "initContext",
  57473. value: function initContext() {
  57474. this.ctx = this.dom.getContext('2d');
  57475. if (Painter.devicePixelRatio != 1) {
  57476. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57477. }
  57478. }
  57479. /**
  57480. * @function Painter.Layer.prototype.createBackBuffer
  57481. * @description 创建备份缓冲。
  57482. */
  57483. }, {
  57484. key: "createBackBuffer",
  57485. value: function createBackBuffer() {
  57486. this.domBack = Painter.createDom(Util.createUniqueID("SuperMap.Theme.back-" + this.id), 'canvas', this.painter);
  57487. this.ctxBack = this.domBack.getContext('2d');
  57488. if (Painter.devicePixelRatio != 1) {
  57489. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57490. }
  57491. }
  57492. /**
  57493. * @function Painter.Layer.prototype.resize
  57494. * @description 改变大小。
  57495. *
  57496. * @param {number} width - 宽。
  57497. * @param {number} height - 高。
  57498. */
  57499. }, {
  57500. key: "resize",
  57501. value: function resize(width, height) {
  57502. this.dom.style.width = width + 'px';
  57503. this.dom.style.height = height + 'px';
  57504. this.dom.setAttribute('width', width * Painter.devicePixelRatio);
  57505. this.dom.setAttribute('height', height * Painter.devicePixelRatio);
  57506. if (Painter.devicePixelRatio != 1) {
  57507. this.ctx.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57508. }
  57509. if (this.domBack) {
  57510. this.domBack.setAttribute('width', width * Painter.devicePixelRatio);
  57511. this.domBack.setAttribute('height', height * Painter.devicePixelRatio);
  57512. if (Painter.devicePixelRatio != 1) {
  57513. this.ctxBack.scale(Painter.devicePixelRatio, Painter.devicePixelRatio);
  57514. }
  57515. }
  57516. }
  57517. /**
  57518. * @function Painter.Layer.prototype.clear
  57519. * @description 清空该层画布。
  57520. */
  57521. }, {
  57522. key: "clear",
  57523. value: function clear() {
  57524. var dom = this.dom;
  57525. var ctx = this.ctx;
  57526. var width = dom.width;
  57527. var height = dom.height;
  57528. var haveClearColor = this.clearColor;
  57529. var haveMotionBLur = this.motionBlur;
  57530. var lastFrameAlpha = this.lastFrameAlpha;
  57531. if (haveMotionBLur) {
  57532. if (!this.domBack) {
  57533. this.createBackBuffer();
  57534. }
  57535. this.ctxBack.globalCompositeOperation = 'copy';
  57536. this.ctxBack.drawImage(dom, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  57537. }
  57538. if (haveClearColor) {
  57539. ctx.save();
  57540. ctx.fillStyle = this.config.clearColor;
  57541. ctx.fillRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  57542. ctx.restore();
  57543. } else {
  57544. ctx.clearRect(0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  57545. }
  57546. if (haveMotionBLur) {
  57547. var domBack = this.domBack;
  57548. ctx.save();
  57549. ctx.globalAlpha = lastFrameAlpha;
  57550. ctx.drawImage(domBack, 0, 0, width / Painter.devicePixelRatio, height / Painter.devicePixelRatio);
  57551. ctx.restore();
  57552. }
  57553. }
  57554. }]);
  57555. return PaintLayer;
  57556. }(Transformable);
  57557. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Handler.js
  57558. function Handler_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Handler_typeof = function _typeof(obj) { return typeof obj; }; } else { Handler_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Handler_typeof(obj); }
  57559. function Handler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  57560. 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); } }
  57561. function Handler_createClass(Constructor, protoProps, staticProps) { if (protoProps) Handler_defineProperties(Constructor.prototype, protoProps); if (staticProps) Handler_defineProperties(Constructor, staticProps); return Constructor; }
  57562. 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 } }); if (superClass) Handler_setPrototypeOf(subClass, superClass); }
  57563. function Handler_setPrototypeOf(o, p) { Handler_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Handler_setPrototypeOf(o, p); }
  57564. 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); }; }
  57565. function Handler_possibleConstructorReturn(self, call) { if (call && (Handler_typeof(call) === "object" || typeof call === "function")) { return call; } return Handler_assertThisInitialized(self); }
  57566. function Handler_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  57567. function Handler_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  57568. function Handler_getPrototypeOf(o) { Handler_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Handler_getPrototypeOf(o); }
  57569. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  57570. * This program are made available under the terms of the Apache License, Version 2.0
  57571. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  57572. /**
  57573. * @private
  57574. * @class SuperMap.LevelRenderer.Handler
  57575. * @category Visualization Theme
  57576. * @classdesc Handler控制模块。
  57577. * @extends {SuperMap.LevelRenderer.Eventful}
  57578. */
  57579. var Handler = /*#__PURE__*/function (_Eventful) {
  57580. Handler_inherits(Handler, _Eventful);
  57581. var _super = Handler_createSuper(Handler);
  57582. /**
  57583. * @function SuperMap.LevelRenderer.Handler.constructor
  57584. * @description 构造函数。
  57585. * @param {HTMLElement} root - 绘图区域。
  57586. * @param {SuperMap.LevelRenderer.Storage} storage - Storage 实例。
  57587. * @param {SuperMap.LevelRenderer.Painter} painter - Painter 实例。
  57588. */
  57589. function Handler(root, storage, painter) {
  57590. var _this;
  57591. Handler_classCallCheck(this, Handler);
  57592. _this = _super.call(this, root, storage, painter);
  57593. /**
  57594. * @member {HTMLElement} SuperMap.LevelRenderer.Handler.prototype.root
  57595. * @description 绘图区域
  57596. */
  57597. _this.root = root;
  57598. /**
  57599. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Handler.prototype.storage
  57600. * @description Storage 实例
  57601. */
  57602. _this.storage = storage;
  57603. /**
  57604. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Handler.prototype.Painter
  57605. * @description Painter 实例
  57606. */
  57607. _this.painter = painter;
  57608. /**
  57609. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastX=0]
  57610. * @description 上一次鼠标位置x坐标值
  57611. */
  57612. _this._lastX = 0;
  57613. /**
  57614. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._lastY=0]
  57615. * @description 上一次鼠标位置y坐标值
  57616. */
  57617. _this._lastY = 0;
  57618. /**
  57619. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseX=0]
  57620. * @description 当前鼠标位置x坐标值
  57621. */
  57622. _this._mouseX = 0;
  57623. /**
  57624. * @member {number} [SuperMap.LevelRenderer.Handler.prototype._mouseY=0]
  57625. * @description 当前鼠标位置y坐标值
  57626. */
  57627. _this._mouseY = 0;
  57628. /**
  57629. * @member {Function} SuperMap.LevelRenderer.Handler.prototype._findHover
  57630. * @description 查找 Hover 图形
  57631. */
  57632. _this._findHover = null;
  57633. /**
  57634. * @member {Object} SuperMap.LevelRenderer.Handler.prototype._domHover
  57635. * @description 高亮 DOM
  57636. */
  57637. _this._domHover = null; // 各种事件标识的私有变量
  57638. // this._hasfound = false; // 是否找到 hover 图形元素
  57639. // this._lastHover = null; // 最后一个 hover 图形元素
  57640. // this._mouseDownTarget = null;
  57641. // this._draggingTarget = null; // 当前被拖拽的图形元素
  57642. // this._isMouseDown = false;
  57643. // this._isDragging = false;
  57644. // this._lastMouseDownMoment;
  57645. // this._lastTouchMoment;
  57646. // this._lastDownButton;
  57647. _this._findHover = bind3Arg(findHover, Handler_assertThisInitialized(_this));
  57648. _this._domHover = painter.getDomHover();
  57649. _this.CLASS_NAME = "SuperMap.LevelRenderer.Handler";
  57650. var domHandlers = {
  57651. /**
  57652. * Method: resize
  57653. * 窗口大小改变响应函数。
  57654. *
  57655. * Parameters:
  57656. * event - {Event} event。
  57657. *
  57658. */
  57659. resize: function resize(event) {
  57660. event = event || window.event;
  57661. this._lastHover = null;
  57662. this._isMouseDown = 0; // 分发SuperMap.LevelRenderer.Config.EVENT.RESIZE事件,global
  57663. this.dispatch(Config.EVENT.RESIZE, event);
  57664. },
  57665. /**
  57666. * Method: click
  57667. * 点击响应函数。
  57668. *
  57669. * Parameters:
  57670. * event - {Event} event。
  57671. *
  57672. */
  57673. click: function click(event) {
  57674. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.CLICK事件
  57675. var _lastHover = this._lastHover;
  57676. if (_lastHover && _lastHover.clickable || !_lastHover) {
  57677. // 判断没有发生拖拽才触发click事件
  57678. if (this._clickThreshold < 10) {
  57679. this._dispatchAgency(_lastHover, Config.EVENT.CLICK, event);
  57680. }
  57681. }
  57682. this._mousemoveHandler(event);
  57683. },
  57684. /**
  57685. * Method: dblclick
  57686. * 双击响应函数。
  57687. *
  57688. * Parameters:
  57689. * event - {Event} event。
  57690. *
  57691. */
  57692. dblclick: function dblclick(event) {
  57693. event = event || window.event;
  57694. event = this._zrenderEventFixed(event); // 分发SuperMap.LevelRenderer.Config.EVENT.DBLCLICK事件
  57695. var _lastHover = this._lastHover;
  57696. if (_lastHover && _lastHover.clickable || !_lastHover) {
  57697. // 判断没有发生拖拽才触发dblclick事件
  57698. if (this._clickThreshold < 5) {
  57699. this._dispatchAgency(_lastHover, Config.EVENT.DBLCLICK, event);
  57700. }
  57701. }
  57702. this._mousemoveHandler(event);
  57703. },
  57704. /**
  57705. * Method: mousewheel
  57706. * 鼠标滚轮响应函数。
  57707. *
  57708. * Parameters:
  57709. * event - {Event} event。
  57710. *
  57711. */
  57712. mousewheel: function mousewheel(event) {
  57713. event = this._zrenderEventFixed(event); // http://www.sitepoint.com/html5-javascript-mouse-wheel/
  57714. // https://developer.mozilla.org/en-US/docs/DOM/DOM_event_reference/mousewheel
  57715. var delta = event.wheelDelta // Webkit
  57716. || -event.detail; // Firefox
  57717. var scale = delta > 0 ? 1.1 : 1 / 1.1;
  57718. var layers = this.painter.getLayers();
  57719. var needsRefresh = false;
  57720. for (var z in layers) {
  57721. if (z !== 'hover') {
  57722. var layer = layers[z];
  57723. var pos = layer.position;
  57724. if (layer.zoomable) {
  57725. layer.__zoom = layer.__zoom || 1;
  57726. var newZoom = layer.__zoom;
  57727. newZoom *= scale;
  57728. newZoom = Math.max(Math.min(layer.maxZoom, newZoom), layer.minZoom);
  57729. scale = newZoom / layer.__zoom;
  57730. layer.__zoom = newZoom; // Keep the mouse center when scaling
  57731. pos[0] -= (this._mouseX - pos[0]) * (scale - 1);
  57732. pos[1] -= (this._mouseY - pos[1]) * (scale - 1);
  57733. layer.scale[0] *= scale;
  57734. layer.scale[1] *= scale;
  57735. layer.dirty = true;
  57736. needsRefresh = true;
  57737. }
  57738. }
  57739. }
  57740. if (needsRefresh) {
  57741. this.painter.refresh();
  57742. } // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEWHEEL事件
  57743. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEWHEEL, event);
  57744. this._mousemoveHandler(event);
  57745. },
  57746. /**
  57747. * Method: mousemove
  57748. * 鼠标(手指)移动响应函数。
  57749. *
  57750. * Parameters:
  57751. * event - {Event} event。
  57752. *
  57753. */
  57754. mousemove: function mousemove(event) {
  57755. // 拖拽不触发click事件
  57756. this._clickThreshold++;
  57757. event = this._zrenderEventFixed(event);
  57758. this._lastX = this._mouseX;
  57759. this._lastY = this._mouseY;
  57760. this._mouseX = SUtil_SUtil.Util_event.getX(event);
  57761. this._mouseY = SUtil_SUtil.Util_event.getY(event);
  57762. var dx = this._mouseX - this._lastX;
  57763. var dy = this._mouseY - this._lastY; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGSTART事件
  57764. // 避免手抖点击误认为拖拽
  57765. // if (this._mouseX - this._lastX > 1 || this._mouseY - this._lastY > 1) {
  57766. this._processDragStart(event); // }
  57767. this._hasfound = 0;
  57768. this._event = event;
  57769. this._iterateAndFindHover(); // 找到的在迭代函数里做了处理,没找到得在迭代完后处理
  57770. if (!this._hasfound) {
  57771. // 过滤首次拖拽产生的mouseout和dragLeave
  57772. if (!this._draggingTarget || this._lastHover && this._lastHover != this._draggingTarget) {
  57773. // 可能出现SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  57774. this._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  57775. this._processDragLeave(event);
  57776. }
  57777. this._lastHover = null;
  57778. this.storage.delHover();
  57779. this.painter.clearHover();
  57780. } // set cursor for root element
  57781. var cursor = ''; // 如果存在拖拽中元素,被拖拽的图形元素最后addHover
  57782. if (this._draggingTarget) {
  57783. this.storage.drift(this._draggingTarget.id, dx, dy);
  57784. this._draggingTarget.modSelf();
  57785. this.storage.addHover(this._draggingTarget);
  57786. } else if (this._isMouseDown) {
  57787. // Layer dragging
  57788. var layers = this.painter.getLayers();
  57789. var needsRefresh = false;
  57790. for (var z in layers) {
  57791. if (z !== 'hover') {
  57792. var layer = layers[z];
  57793. if (layer.panable) {
  57794. // PENDING
  57795. cursor = 'move'; // Keep the mouse center when scaling
  57796. layer.position[0] += dx;
  57797. layer.position[1] += dy;
  57798. needsRefresh = true;
  57799. layer.dirty = true;
  57800. }
  57801. }
  57802. }
  57803. if (needsRefresh) {
  57804. this.painter.refresh();
  57805. }
  57806. }
  57807. if (this._draggingTarget || this._hasfound && this._lastHover.draggable) {
  57808. cursor = 'move';
  57809. } else if (this._hasfound && this._lastHover.clickable) {
  57810. cursor = 'pointer';
  57811. }
  57812. this.root.style.cursor = cursor; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEMOVE事件
  57813. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEMOVE, event);
  57814. if (this._draggingTarget || this._hasfound || this.storage.hasHoverShape()) {
  57815. this.painter.refreshHover();
  57816. }
  57817. },
  57818. /**
  57819. * Method: mouseout
  57820. * 鼠标(手指)离开响应函数。
  57821. *
  57822. * Parameters:
  57823. * event - {Event} event。
  57824. *
  57825. */
  57826. mouseout: function mouseout(event) {
  57827. event = this._zrenderEventFixed(event);
  57828. var element = event.toElement || event.relatedTarget;
  57829. if (element != this.root) {
  57830. while (element && element.nodeType != 9) {
  57831. // 忽略包含在root中的dom引起的mouseOut
  57832. if (element == this.root) {
  57833. this._mousemoveHandler(event);
  57834. return;
  57835. }
  57836. element = element.parentNode;
  57837. }
  57838. }
  57839. event.zrenderX = this._lastX;
  57840. event.zrenderY = this._lastY;
  57841. this.root.style.cursor = '';
  57842. this._isMouseDown = 0;
  57843. this._processOutShape(event);
  57844. this._processDrop(event);
  57845. this._processDragEnd(event);
  57846. this.painter.refreshHover();
  57847. this.dispatch(Config.EVENT.GLOBALOUT, event);
  57848. },
  57849. /**
  57850. * Method: mousedown
  57851. * 鼠标(手指)按下响应函数。
  57852. *
  57853. * Parameters:
  57854. * event - {Event} event。
  57855. *
  57856. */
  57857. mousedown: function mousedown(event) {
  57858. // 重置 clickThreshold
  57859. this._clickThreshold = 0;
  57860. if (this._lastDownButton == 2) {
  57861. this._lastDownButton = event.button;
  57862. this._mouseDownTarget = null; // 仅作为关闭右键菜单使用
  57863. return;
  57864. }
  57865. this._lastMouseDownMoment = new Date();
  57866. event = this._zrenderEventFixed(event);
  57867. this._isMouseDown = 1; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEDOWN事件
  57868. this._mouseDownTarget = this._lastHover;
  57869. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEDOWN, event);
  57870. this._lastDownButton = event.button;
  57871. },
  57872. /**
  57873. * Method: mouseup
  57874. * 鼠标(手指)抬起响应函数。
  57875. *
  57876. * Parameters:
  57877. * event - {Event} event。
  57878. *
  57879. */
  57880. mouseup: function mouseup(event) {
  57881. event = this._zrenderEventFixed(event);
  57882. this.root.style.cursor = '';
  57883. this._isMouseDown = 0;
  57884. this._mouseDownTarget = null; // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEUP事件
  57885. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEUP, event);
  57886. this._processDrop(event);
  57887. this._processDragEnd(event);
  57888. },
  57889. /**
  57890. * Method: touchstart
  57891. * Touch 开始响应函数。
  57892. *
  57893. * Parameters:
  57894. * event - {Event} event。
  57895. *
  57896. */
  57897. touchstart: function touchstart(event) {
  57898. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  57899. event = this._zrenderEventFixed(event, true);
  57900. this._lastTouchMoment = new Date(); // 平板补充一次findHover
  57901. this._mobildFindFixed(event);
  57902. this._mousedownHandler(event);
  57903. },
  57904. /**
  57905. * Method: touchmove
  57906. * Touch 移动响应函数。
  57907. *
  57908. * Parameters:
  57909. * event - {Event} event。
  57910. *
  57911. */
  57912. touchmove: function touchmove(event) {
  57913. event = this._zrenderEventFixed(event, true);
  57914. this._mousemoveHandler(event);
  57915. if (this._isDragging) {
  57916. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  57917. }
  57918. },
  57919. /**
  57920. * Method: touchend
  57921. * Touch 结束响应函数。
  57922. *
  57923. * Parameters:
  57924. * event - {Event} event。
  57925. *
  57926. */
  57927. touchend: function touchend(event) {
  57928. // SUtil.Util_event.stop(event);// 阻止浏览器默认事件,重要
  57929. event = this._zrenderEventFixed(event, true);
  57930. this._mouseupHandler(event);
  57931. var now = new Date();
  57932. if (now - this._lastTouchMoment < Config.EVENT.touchClickDelay) {
  57933. this._mobildFindFixed(event);
  57934. this._clickHandler(event);
  57935. if (now - this._lastClickMoment < Config.EVENT.touchClickDelay / 2) {
  57936. this._dblclickHandler(event);
  57937. if (this._lastHover && this._lastHover.clickable) {
  57938. SUtil_SUtil.Util_event.stop(event); // 阻止浏览器默认事件,重要
  57939. }
  57940. }
  57941. this._lastClickMoment = now;
  57942. }
  57943. this.painter.clearHover();
  57944. }
  57945. };
  57946. initDomHandler(Handler_assertThisInitialized(_this)); // 初始化,事件绑定,支持的所有事件都由如下原生事件计算得来
  57947. if (window.addEventListener) {
  57948. window.addEventListener('resize', _this._resizeHandler);
  57949. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  57950. // mobile支持
  57951. root.addEventListener('touchstart', _this._touchstartHandler);
  57952. root.addEventListener('touchmove', _this._touchmoveHandler);
  57953. root.addEventListener('touchend', _this._touchendHandler);
  57954. } else {
  57955. // mobile的click/move/up/down自己模拟
  57956. root.addEventListener('click', _this._clickHandler);
  57957. root.addEventListener('dblclick', _this._dblclickHandler);
  57958. root.addEventListener('mousewheel', _this._mousewheelHandler);
  57959. root.addEventListener('mousemove', _this._mousemoveHandler);
  57960. root.addEventListener('mousedown', _this._mousedownHandler);
  57961. root.addEventListener('mouseup', _this._mouseupHandler);
  57962. }
  57963. root.addEventListener('DOMMouseScroll', _this._mousewheelHandler);
  57964. root.addEventListener('mouseout', _this._mouseoutHandler);
  57965. } else {
  57966. window.attachEvent('onresize', _this._resizeHandler);
  57967. root.attachEvent('onclick', _this._clickHandler); //root.attachEvent('ondblclick ', this._dblclickHandler);
  57968. root.ondblclick = _this._dblclickHandler;
  57969. root.attachEvent('onmousewheel', _this._mousewheelHandler);
  57970. root.attachEvent('onmousemove', _this._mousemoveHandler);
  57971. root.attachEvent('onmouseout', _this._mouseoutHandler);
  57972. root.attachEvent('onmousedown', _this._mousedownHandler);
  57973. root.attachEvent('onmouseup', _this._mouseupHandler);
  57974. } // 辅助函数 start
  57975. /**
  57976. * Method: bind1Arg
  57977. * bind 一个参数的 function。
  57978. *
  57979. * Parameters:
  57980. * handler - {Function} 要 bind 的 function。
  57981. * context - {Object} 运行时 this 环境。
  57982. *
  57983. * Returns:
  57984. * {Function}
  57985. */
  57986. function bind1Arg(handler, context) {
  57987. return function (e) {
  57988. return handler.call(context, e);
  57989. };
  57990. }
  57991. /*
  57992. // bind 两个参数的 function
  57993. function bind2Arg(handler, context) {
  57994. return function (arg1, arg2) {
  57995. return handler.call(context, arg1, arg2);
  57996. };
  57997. }
  57998. */
  57999. // bind 三个参数的 function
  58000. function bind3Arg(handler, context) {
  58001. return function (arg1, arg2, arg3) {
  58002. return handler.call(context, arg1, arg2, arg3);
  58003. };
  58004. }
  58005. /**
  58006. * Method: initDomHandler
  58007. * 为控制类实例初始化 dom 事件处理函数。
  58008. *
  58009. * Parameters:
  58010. * instance - {<SuperMap.LevelRenderer.Handler>} 控制类实例 。
  58011. *
  58012. * Returns:
  58013. * {Function}
  58014. */
  58015. function initDomHandler(instance) {
  58016. var domHandlerNames = ['resize', 'click', 'dblclick', 'mousewheel', 'mousemove', 'mouseout', 'mouseup', 'mousedown', 'touchstart', 'touchend', 'touchmove'];
  58017. var len = domHandlerNames.length;
  58018. while (len--) {
  58019. var name = domHandlerNames[len];
  58020. instance['_' + name + 'Handler'] = bind1Arg(domHandlers[name], instance);
  58021. }
  58022. }
  58023. /**
  58024. * Method: findHover
  58025. * 迭代函数,查找 hover 到的图形元素并即时做些事件分发。
  58026. *
  58027. * Parameters:
  58028. * shape - {Object} 图形。
  58029. * x - {number} 鼠标 x。
  58030. * y - {number} 鼠标 y。
  58031. *
  58032. * Returns:
  58033. * {boolean} 是否找到图形。
  58034. *
  58035. */
  58036. function findHover(shape, x, y) {
  58037. var me = this;
  58038. if (me._draggingTarget && me._draggingTarget.id == shape.id || // 迭代到当前拖拽的图形上
  58039. shape.isSilent() // 打酱油的路过,啥都不响应的shape~
  58040. ) {
  58041. return false;
  58042. }
  58043. var event = me._event;
  58044. if (shape.isCover(x, y)) {
  58045. if (shape.hoverable) {
  58046. // SMIC-修改 - start
  58047. if (shape.isHoverByRefDataID && shape.isHoverByRefDataID === true) {
  58048. if (shape.refDataID) {
  58049. var fid = shape.refDataID; //me.painter.clearHover();
  58050. //me.storage.delHover();
  58051. var hoverGroup = null;
  58052. if (shape.refDataHoverGroup) {
  58053. hoverGroup = shape.refDataHoverGroup;
  58054. } //查找同一个用户数据 feature 的所有图形
  58055. var shapeList = me.storage._shapeList;
  58056. for (var i = 0, len = shapeList.length; i < len; i++) {
  58057. var si = shapeList[i];
  58058. if (si.refDataID && fid === si.refDataID) {
  58059. if (hoverGroup) {
  58060. if (si.refDataHoverGroup && hoverGroup === si.refDataHoverGroup) {
  58061. me.storage.addHover(si);
  58062. }
  58063. } else {
  58064. me.storage.addHover(si);
  58065. }
  58066. }
  58067. }
  58068. }
  58069. } else {
  58070. me.storage.addHover(shape);
  58071. } //初始代码:
  58072. // me.storage.addHover(shape);
  58073. // SMIC-修改 - end
  58074. } // 查找是否在 clipShape 中
  58075. var p = shape.parent;
  58076. while (p) {
  58077. if (p.clipShape && !p.clipShape.isCover(me._mouseX, me._mouseY)) {
  58078. // 已经被祖先 clip 掉了
  58079. return false;
  58080. }
  58081. p = p.parent;
  58082. }
  58083. if (me._lastHover != shape) {
  58084. me._processOutShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  58085. me._processDragLeave(event);
  58086. me._lastHover = shape; // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  58087. me._processDragEnter(event);
  58088. }
  58089. me._processOverShape(event); // 可能出现SuperMap.LevelRenderer.Config.EVENT.DRAGOVER
  58090. me._processDragOver(event);
  58091. me._hasfound = 1;
  58092. return true; // 找到则中断迭代查找
  58093. }
  58094. return false;
  58095. } // 辅助函数 end
  58096. return _this;
  58097. }
  58098. /**
  58099. * @function SuperMap.LevelRenderer.Handler.prototype.destroy
  58100. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  58101. */
  58102. Handler_createClass(Handler, [{
  58103. key: "destroy",
  58104. value: function destroy() {
  58105. this.dispose();
  58106. this._lastX = null;
  58107. this._lastY = null;
  58108. this._mouseX = null;
  58109. this._mouseY = null;
  58110. this._findHover = null;
  58111. Eventful.prototype.destroy.apply(this, arguments);
  58112. }
  58113. /**
  58114. * @function SuperMap.LevelRenderer.Handler.prototype.on
  58115. * @description 自定义事件绑定。
  58116. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58117. * @param {function} handler - 响应函数。
  58118. * @returns {SuperMap.LevelRenderer.Handler} this。
  58119. */
  58120. }, {
  58121. key: "on",
  58122. value: function on(eventName, handler) {
  58123. this.bind(eventName, handler);
  58124. return this;
  58125. }
  58126. /**
  58127. * @function SuperMap.LevelRenderer.Handler.prototype.un
  58128. * @description 自定义事件解除绑定。
  58129. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58130. * @param {function} handler - 响应函数。
  58131. * @returns {SuperMap.LevelRenderer.Handler} this。
  58132. */
  58133. }, {
  58134. key: "un",
  58135. value: function un(eventName, handler) {
  58136. this.unbind(eventName, handler);
  58137. return this;
  58138. }
  58139. /**
  58140. * @function SuperMap.LevelRenderer.Handler.prototype.trigger
  58141. * @description 事件触发。
  58142. * @param {string} eventName - 事件名称,resize、hover、drag等。
  58143. * @param {event} eventArgs - dom事件对象。
  58144. */
  58145. }, {
  58146. key: "trigger",
  58147. value: function trigger(eventName, eventArgs) {
  58148. var EVENT = Config.EVENT;
  58149. switch (eventName) {
  58150. case EVENT.RESIZE:
  58151. case EVENT.CLICK:
  58152. case EVENT.DBLCLICK:
  58153. case EVENT.MOUSEWHEEL:
  58154. case EVENT.MOUSEMOVE:
  58155. case EVENT.MOUSEDOWN:
  58156. case EVENT.MOUSEUP:
  58157. case EVENT.MOUSEOUT:
  58158. this['_' + eventName + 'Handler'](eventArgs);
  58159. break;
  58160. }
  58161. }
  58162. /**
  58163. * @function SuperMap.LevelRenderer.Handler.prototype.dispose
  58164. * @description 释放,解绑所有事件。
  58165. */
  58166. }, {
  58167. key: "dispose",
  58168. value: function dispose() {
  58169. var root = this.root;
  58170. if (window.removeEventListener) {
  58171. window.removeEventListener('resize', this._resizeHandler);
  58172. if (SUtil_SUtil.Util_env.os.tablet || SUtil_SUtil.Util_env.os.phone) {
  58173. // mobile支持
  58174. root.removeEventListener('touchstart', this._touchstartHandler);
  58175. root.removeEventListener('touchmove', this._touchmoveHandler);
  58176. root.removeEventListener('touchend', this._touchendHandler);
  58177. } else {
  58178. // mobile的click自己模拟
  58179. root.removeEventListener('click', this._clickHandler);
  58180. root.removeEventListener('dblclick', this._dblclickHandler);
  58181. root.removeEventListener('mousewheel', this._mousewheelHandler);
  58182. root.removeEventListener('mousemove', this._mousemoveHandler);
  58183. root.removeEventListener('mousedown', this._mousedownHandler);
  58184. root.removeEventListener('mouseup', this._mouseupHandler);
  58185. }
  58186. root.removeEventListener('DOMMouseScroll', this._mousewheelHandler);
  58187. root.removeEventListener('mouseout', this._mouseoutHandler);
  58188. } else {
  58189. window.detachEvent('onresize', this._resizeHandler);
  58190. root.detachEvent('onclick', this._clickHandler);
  58191. root.detachEvent('dblclick', this._dblclickHandler);
  58192. root.detachEvent('onmousewheel', this._mousewheelHandler);
  58193. root.detachEvent('onmousemove', this._mousemoveHandler);
  58194. root.detachEvent('onmouseout', this._mouseoutHandler);
  58195. root.detachEvent('onmousedown', this._mousedownHandler);
  58196. root.detachEvent('onmouseup', this._mouseupHandler);
  58197. }
  58198. this.root = null;
  58199. this._domHover = null;
  58200. this.storage = null;
  58201. this.painter = null;
  58202. this.un();
  58203. }
  58204. /**
  58205. * Method: _processDragStart
  58206. * 拖拽开始。
  58207. *
  58208. * Parameters:
  58209. * event - {Object} 事件对象。
  58210. *
  58211. */
  58212. }, {
  58213. key: "_processDragStart",
  58214. value: function _processDragStart(event) {
  58215. var _lastHover = this._lastHover;
  58216. if (this._isMouseDown && _lastHover && _lastHover.draggable && !this._draggingTarget && this._mouseDownTarget == _lastHover) {
  58217. // 拖拽点击生效时长阀门,某些场景需要降低拖拽敏感度
  58218. if (_lastHover.dragEnableTime && new Date() - this._lastMouseDownMoment < _lastHover.dragEnableTime) {
  58219. return;
  58220. }
  58221. var _draggingTarget = _lastHover;
  58222. this._draggingTarget = _draggingTarget;
  58223. this._isDragging = 1;
  58224. _draggingTarget.invisible = true;
  58225. this.storage.mod(_draggingTarget.id); // 分发 Config.EVENT.DRAGSTART事件
  58226. this._dispatchAgency(_draggingTarget, Config.EVENT.DRAGSTART, event);
  58227. this.painter.refresh();
  58228. }
  58229. }
  58230. /**
  58231. * Method: _processDragEnter
  58232. * 拖拽进入目标元素。
  58233. *
  58234. * Parameters:
  58235. * event - {Object} 事件对象。
  58236. *
  58237. */
  58238. }, {
  58239. key: "_processDragEnter",
  58240. value: function _processDragEnter(event) {
  58241. if (this._draggingTarget) {
  58242. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGENTER事件
  58243. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGENTER, event, this._draggingTarget);
  58244. }
  58245. }
  58246. /**
  58247. * Method: _processDragOver
  58248. * 拖拽在目标元素上移动。
  58249. *
  58250. * Parameters:
  58251. * event - {Object} 事件对象。
  58252. *
  58253. */
  58254. }, {
  58255. key: "_processDragOver",
  58256. value: function _processDragOver(event) {
  58257. if (this._draggingTarget) {
  58258. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGOVER事件
  58259. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGOVER, event, this._draggingTarget);
  58260. }
  58261. }
  58262. /**
  58263. * Method: _processDragLeave
  58264. * 拖拽离开目标元素。
  58265. *
  58266. * Parameters:
  58267. * event - {Object} 事件对象。
  58268. *
  58269. */
  58270. }, {
  58271. key: "_processDragLeave",
  58272. value: function _processDragLeave(event) {
  58273. if (this._draggingTarget) {
  58274. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGLEAVE事件
  58275. this._dispatchAgency(this._lastHover, Config.EVENT.DRAGLEAVE, event, this._draggingTarget);
  58276. }
  58277. }
  58278. /**
  58279. * Method: _processDrop
  58280. * 拖拽在目标元素上完成。
  58281. *
  58282. * Parameters:
  58283. * event - {Object} 事件对象。
  58284. *
  58285. */
  58286. }, {
  58287. key: "_processDrop",
  58288. value: function _processDrop(event) {
  58289. if (this._draggingTarget) {
  58290. this._draggingTarget.invisible = false;
  58291. this.storage.mod(this._draggingTarget.id);
  58292. this.painter.refresh(); // 分发SuperMap.LevelRenderer.Config.EVENT.DROP事件
  58293. this._dispatchAgency(this._lastHover, Config.EVENT.DROP, event, this._draggingTarget);
  58294. }
  58295. }
  58296. /**
  58297. * Method: _processDragEnd
  58298. * 拖拽结束。
  58299. *
  58300. * Parameters:
  58301. * event - {Object} 事件对象。
  58302. *
  58303. */
  58304. }, {
  58305. key: "_processDragEnd",
  58306. value: function _processDragEnd(event) {
  58307. if (this._draggingTarget) {
  58308. // 分发SuperMap.LevelRenderer.Config.EVENT.DRAGEND事件
  58309. this._dispatchAgency(this._draggingTarget, Config.EVENT.DRAGEND, event);
  58310. this._lastHover = null;
  58311. }
  58312. this._isDragging = 0;
  58313. this._draggingTarget = null;
  58314. }
  58315. /**
  58316. * Method: _processOverShape
  58317. * 鼠标在某个图形元素上移动。
  58318. *
  58319. * Parameters:
  58320. * event - {Object} 事件对象。
  58321. *
  58322. */
  58323. }, {
  58324. key: "_processOverShape",
  58325. value: function _processOverShape(event) {
  58326. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOVER事件
  58327. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOVER, event);
  58328. }
  58329. /**
  58330. * Method: _processOutShape
  58331. * 鼠标离开某个图形元素。
  58332. *
  58333. * Parameters:
  58334. * event - {Object} 事件对象。
  58335. *
  58336. */
  58337. }, {
  58338. key: "_processOutShape",
  58339. value: function _processOutShape(event) {
  58340. // 分发SuperMap.LevelRenderer.Config.EVENT.MOUSEOUT事件
  58341. this._dispatchAgency(this._lastHover, Config.EVENT.MOUSEOUT, event);
  58342. }
  58343. /**
  58344. * Method: _dispatchAgency
  58345. * 鼠标离开某个图形元素。
  58346. *
  58347. * Parameters:
  58348. * targetShape - {Object} 目标图形元素。
  58349. * eventName - {Object} 事件名称。
  58350. * event - {Object} 事件对象。
  58351. * draggedShape - {Object} 拖拽事件特有,当前被拖拽图形元素。
  58352. *
  58353. */
  58354. }, {
  58355. key: "_dispatchAgency",
  58356. value: function _dispatchAgency(targetShape, eventName, event, draggedShape) {
  58357. var eventHandler = 'on' + eventName;
  58358. var eventPacket = {
  58359. type: eventName,
  58360. event: event,
  58361. target: targetShape,
  58362. cancelBubble: false
  58363. };
  58364. var el = targetShape;
  58365. if (draggedShape) {
  58366. eventPacket.dragged = draggedShape;
  58367. }
  58368. while (el) {
  58369. el[eventHandler] && (eventPacket.cancelBubble = el[eventHandler](eventPacket));
  58370. el.dispatch(eventName, eventPacket);
  58371. el = el.parent;
  58372. if (eventPacket.cancelBubble) {
  58373. break;
  58374. }
  58375. }
  58376. if (targetShape) {
  58377. // 冒泡到顶级 zrender 对象
  58378. if (!eventPacket.cancelBubble) {
  58379. this.dispatch(eventName, eventPacket);
  58380. }
  58381. } else if (!draggedShape) {
  58382. // 无hover目标,无拖拽对象,原生事件分发
  58383. this.dispatch(eventName, {
  58384. type: eventName,
  58385. event: event
  58386. });
  58387. }
  58388. }
  58389. /**
  58390. * Method: _iterateAndFindHover
  58391. * 迭代寻找 hover shape。
  58392. *
  58393. */
  58394. }, {
  58395. key: "_iterateAndFindHover",
  58396. value: function _iterateAndFindHover() {
  58397. var invTransform = SUtil_SUtil.Util_matrix.create();
  58398. var list = this.storage.getShapeList();
  58399. var currentZLevel;
  58400. var currentLayer;
  58401. var tmp = [0, 0];
  58402. for (var i = list.length - 1; i >= 0; i--) {
  58403. var shape = list[i];
  58404. if (currentZLevel !== shape.zlevel) {
  58405. currentLayer = this.painter.getLayer(shape.zlevel, currentLayer);
  58406. tmp[0] = this._mouseX;
  58407. tmp[1] = this._mouseY;
  58408. if (currentLayer.needTransform) {
  58409. SUtil_SUtil.Util_matrix.invert(invTransform, currentLayer.transform);
  58410. SUtil_SUtil.Util_vector.applyTransform(tmp, tmp, invTransform);
  58411. }
  58412. }
  58413. if (this._findHover(shape, tmp[0], tmp[1])) {
  58414. break;
  58415. }
  58416. }
  58417. }
  58418. /**
  58419. * Method: _mobildFindFixed
  58420. * touch 有指尖错觉,四向尝试,让touch上的点击更好触发事件。
  58421. *
  58422. * Parameters:
  58423. * event - {Object} 事件对象。
  58424. *
  58425. */
  58426. }, {
  58427. key: "_mobildFindFixed",
  58428. value: function _mobildFindFixed(event) {
  58429. // touch指尖错觉的尝试偏移量配置
  58430. var MOBILE_TOUCH_OFFSETS = [{
  58431. x: 10
  58432. }, {
  58433. x: -20
  58434. }, {
  58435. x: 10,
  58436. y: 10
  58437. }, {
  58438. y: -20
  58439. }];
  58440. this._lastHover = null;
  58441. this._mouseX = event.zrenderX;
  58442. this._mouseY = event.zrenderY;
  58443. this._event = event;
  58444. this._iterateAndFindHover();
  58445. for (var i = 0; !this._lastHover && i < MOBILE_TOUCH_OFFSETS.length; i++) {
  58446. var offset = MOBILE_TOUCH_OFFSETS[i];
  58447. offset.x && (this._mouseX += offset.x);
  58448. offset.y && (this._mouseX += offset.y);
  58449. this._iterateAndFindHover();
  58450. }
  58451. if (this._lastHover) {
  58452. event.zrenderX = this._mouseX;
  58453. event.zrenderY = this._mouseY;
  58454. }
  58455. }
  58456. /**
  58457. * Method: _zrenderEventFixed
  58458. * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标 。
  58459. *
  58460. * Parameters:
  58461. * event - {Object} 事件。
  58462. * isTouch - {boolean} 是否触摸。
  58463. *
  58464. */
  58465. }, {
  58466. key: "_zrenderEventFixed",
  58467. value: function _zrenderEventFixed(event, isTouch) {
  58468. if (event.zrenderFixed) {
  58469. return event;
  58470. }
  58471. if (!isTouch) {
  58472. event = event || window.event; // 进入对象优先~
  58473. var target = event.toElement || event.relatedTarget || event.srcElement || event.target;
  58474. if (target && target != this._domHover) {
  58475. event.zrenderX = (typeof event.offsetX != 'undefined' ? event.offsetX : event.layerX) + target.offsetLeft;
  58476. event.zrenderY = (typeof event.offsetY != 'undefined' ? event.offsetY : event.layerY) + target.offsetTop;
  58477. }
  58478. } else {
  58479. var touch = event.type != 'touchend' ? event.targetTouches[0] : event.changedTouches[0];
  58480. if (touch) {
  58481. var rBounding = this.root.getBoundingClientRect(); // touch事件坐标是全屏的~
  58482. event.zrenderX = touch.clientX - rBounding.left;
  58483. event.zrenderY = touch.clientY - rBounding.top;
  58484. }
  58485. }
  58486. event.zrenderFixed = 1;
  58487. return event;
  58488. } // SMIC-方法扩展 - start
  58489. /**
  58490. * @function SuperMap.LevelRenderer.Handler.prototype.getLastHoverOne
  58491. * @description 获取单个高亮图形
  58492. */
  58493. }, {
  58494. key: "getLastHoverOne",
  58495. value: function getLastHoverOne() {
  58496. if (this._lastHover) {
  58497. return this._lastHover;
  58498. }
  58499. return null;
  58500. } // SMIC-方法扩展 - end
  58501. }]);
  58502. return Handler;
  58503. }(Eventful);
  58504. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Easing.js
  58505. function Easing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58506. 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); } }
  58507. function Easing_createClass(Constructor, protoProps, staticProps) { if (protoProps) Easing_defineProperties(Constructor.prototype, protoProps); if (staticProps) Easing_defineProperties(Constructor, staticProps); return Constructor; }
  58508. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58509. * This program are made available under the terms of the Apache License, Version 2.0
  58510. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58511. /**
  58512. * @class SuperMap.LevelRenderer.Animation.easing
  58513. * @category Visualization Theme
  58514. * @classdesc 缓动
  58515. * @private
  58516. */
  58517. // 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
  58518. // http://sole.github.io/tween.js/examples/03_graphs.html
  58519. var Easing = /*#__PURE__*/function () {
  58520. /**
  58521. * @function SuperMap.LevelRenderer.Animation.easing.constructor
  58522. * @description 构造函数。
  58523. */
  58524. function Easing() {
  58525. Easing_classCallCheck(this, Easing);
  58526. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.easing";
  58527. }
  58528. /**
  58529. * @function SuperMap.LevelRenderer.Animation.easing.destroy
  58530. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  58531. */
  58532. Easing_createClass(Easing, [{
  58533. key: "destroy",
  58534. value: function destroy() {}
  58535. /**
  58536. * @function SuperMap.LevelRenderer.Animation.easing.Linear
  58537. * @description 线性缓动
  58538. * @param {number} k - 参数
  58539. * @return {number} 输入值
  58540. */
  58541. }, {
  58542. key: "Linear",
  58543. value: function Linear(k) {
  58544. return k;
  58545. }
  58546. /**
  58547. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticIn
  58548. * @description 二次方的缓动(t^2)
  58549. * @param {number} k - 参数
  58550. * @return {number} 二次方的缓动的值
  58551. */
  58552. }, {
  58553. key: "QuadraticIn",
  58554. value: function QuadraticIn(k) {
  58555. return k * k;
  58556. }
  58557. /**
  58558. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticOut
  58559. * @description 返回按二次方缓动退出的值
  58560. * @param {number} k - 参数
  58561. * @return {number} 按二次方缓动退出的值
  58562. */
  58563. }, {
  58564. key: "QuadraticOut",
  58565. value: function QuadraticOut(k) {
  58566. return k * (2 - k);
  58567. }
  58568. /**
  58569. * @function SuperMap.LevelRenderer.Animation.easing.QuadraticInOut
  58570. * @description 返回按二次方缓动进入和退出的值
  58571. * @param {number} k - 参数
  58572. * @return {number} 按二次方缓动进入和退出的值
  58573. */
  58574. }, {
  58575. key: "QuadraticInOut",
  58576. value: function QuadraticInOut(k) {
  58577. if ((k *= 2) < 1) {
  58578. return 0.5 * k * k;
  58579. }
  58580. return -0.5 * (--k * (k - 2) - 1);
  58581. }
  58582. /**
  58583. * @function SuperMap.LevelRenderer.Animation.easing.CubicIn
  58584. * @description 三次方的缓动(t^3)
  58585. * @param {number} k - 参数
  58586. * @return {number} 按三次方缓动的值
  58587. */
  58588. }, {
  58589. key: "CubicIn",
  58590. value: function CubicIn(k) {
  58591. return k * k * k;
  58592. }
  58593. /**
  58594. * @function SuperMap.LevelRenderer.Animation.easing.CubicOut
  58595. * @description 返回按三次方缓动退出的值
  58596. * @param {number} k - 参数
  58597. * @return {number} 按三次方缓动退出的值
  58598. */
  58599. }, {
  58600. key: "CubicOut",
  58601. value: function CubicOut(k) {
  58602. return --k * k * k + 1;
  58603. }
  58604. /**
  58605. * @function SuperMap.LevelRenderer.Animation.easing.CubicInOut
  58606. * @description 返回按三次方缓动进入退出的值
  58607. * @param {number} k - 参数
  58608. * @return {number} 按三次方缓动进入退出的值
  58609. */
  58610. }, {
  58611. key: "CubicInOut",
  58612. value: function CubicInOut(k) {
  58613. if ((k *= 2) < 1) {
  58614. return 0.5 * k * k * k;
  58615. }
  58616. return 0.5 * ((k -= 2) * k * k + 2);
  58617. }
  58618. /**
  58619. * @function SuperMap.LevelRenderer.Animation.easing.QuarticIn
  58620. * @description 返回按四次方缓动进入的值
  58621. * @param {number} k - 参数
  58622. * @return {number} 按四次方缓动进入的值
  58623. */
  58624. }, {
  58625. key: "QuarticIn",
  58626. value: function QuarticIn(k) {
  58627. return k * k * k * k;
  58628. }
  58629. /**
  58630. * @function SuperMap.LevelRenderer.Animation.easing.QuarticOut
  58631. * @description 返回按四次方缓动退出的值
  58632. * @param {number} k - 参数
  58633. * @return {number} 按四次方缓动退出的值
  58634. */
  58635. }, {
  58636. key: "QuarticOut",
  58637. value: function QuarticOut(k) {
  58638. return 1 - --k * k * k * k;
  58639. }
  58640. /**
  58641. * @function SuperMap.LevelRenderer.Animation.easing.QuarticInOut
  58642. * @description 返回按四次方缓动进入退出的值
  58643. * @param {number} k - 参数
  58644. * @return {number} 按四次方缓动进入退出的值
  58645. */
  58646. }, {
  58647. key: "QuarticInOut",
  58648. value: function QuarticInOut(k) {
  58649. if ((k *= 2) < 1) {
  58650. return 0.5 * k * k * k * k;
  58651. }
  58652. return -0.5 * ((k -= 2) * k * k * k - 2);
  58653. } // 五次方的缓动(t^5)
  58654. /**
  58655. * @function SuperMap.LevelRenderer.Animation.easing.QuinticIn
  58656. * @description 返回按五次方缓动的值
  58657. * @param {number} k - 参数
  58658. * @return {number} 按五次方缓动的值
  58659. */
  58660. }, {
  58661. key: "QuinticIn",
  58662. value: function QuinticIn(k) {
  58663. return k * k * k * k * k;
  58664. }
  58665. /**
  58666. * @function SuperMap.LevelRenderer.Animation.easing.QuinticOut
  58667. * @description 返回按五次方缓动退出的值
  58668. * @param {number} k - 参数
  58669. * @return {number} 按五次方缓动退出的值
  58670. */
  58671. }, {
  58672. key: "QuinticOut",
  58673. value: function QuinticOut(k) {
  58674. return --k * k * k * k * k + 1;
  58675. }
  58676. /**
  58677. * @function SuperMap.LevelRenderer.Animation.easing.QuinticInOut
  58678. * @description 返回按五次方缓动进入退出的值
  58679. * @param {number} k - 参数
  58680. * @return {number} 按五次方缓动进入退出的值
  58681. */
  58682. }, {
  58683. key: "QuinticInOut",
  58684. value: function QuinticInOut(k) {
  58685. if ((k *= 2) < 1) {
  58686. return 0.5 * k * k * k * k * k;
  58687. }
  58688. return 0.5 * ((k -= 2) * k * k * k * k + 2);
  58689. } // 正弦曲线的缓动(sin(t))
  58690. /**
  58691. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalIn
  58692. * @description 返回按正弦曲线的缓动进入的值
  58693. * @param {number} k - 参数
  58694. * @return {number} 按正弦曲线的缓动进入的值
  58695. */
  58696. }, {
  58697. key: "SinusoidalIn",
  58698. value: function SinusoidalIn(k) {
  58699. return 1 - Math.cos(k * Math.PI / 2);
  58700. }
  58701. /**
  58702. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalOut
  58703. * @description 返回按正弦曲线的缓动退出的值
  58704. * @param {number} k - 参数
  58705. * @return {number} 按正弦曲线的缓动退出的值
  58706. */
  58707. }, {
  58708. key: "SinusoidalOut",
  58709. value: function SinusoidalOut(k) {
  58710. return Math.sin(k * Math.PI / 2);
  58711. }
  58712. /**
  58713. * @function SuperMap.LevelRenderer.Animation.easing.SinusoidalInOut
  58714. * @description 返回按正弦曲线的缓动进入退出的值
  58715. * @param {number} k - 参数
  58716. * @return {number} 按正弦曲线的缓动进入退出的值
  58717. */
  58718. }, {
  58719. key: "SinusoidalInOut",
  58720. value: function SinusoidalInOut(k) {
  58721. return 0.5 * (1 - Math.cos(Math.PI * k));
  58722. } // 指数曲线的缓动(2^t)
  58723. /**
  58724. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialIn
  58725. * @description 返回按指数曲线的缓动进入的值
  58726. * @param {number} k - 参数
  58727. * @return {number} 按指数曲线的缓动进入的值
  58728. */
  58729. }, {
  58730. key: "ExponentialIn",
  58731. value: function ExponentialIn(k) {
  58732. return k === 0 ? 0 : Math.pow(1024, k - 1);
  58733. }
  58734. /**
  58735. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialOut
  58736. * @description 返回按指数曲线的缓动退出的值
  58737. * @param {number} k - 参数
  58738. * @return {number} 按指数曲线的缓动退出的值
  58739. */
  58740. }, {
  58741. key: "ExponentialOut",
  58742. value: function ExponentialOut(k) {
  58743. return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
  58744. }
  58745. /**
  58746. * @function SuperMap.LevelRenderer.Animation.easing.ExponentialInOut
  58747. * @description 返回按指数曲线的缓动进入退出的值
  58748. * @param {number} k - 参数
  58749. * @return {number} 按指数曲线的缓动进入退出的值
  58750. */
  58751. }, {
  58752. key: "ExponentialInOut",
  58753. value: function ExponentialInOut(k) {
  58754. if (k === 0) {
  58755. return 0;
  58756. }
  58757. if (k === 1) {
  58758. return 1;
  58759. }
  58760. if ((k *= 2) < 1) {
  58761. return 0.5 * Math.pow(1024, k - 1);
  58762. }
  58763. return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
  58764. } // 圆形曲线的缓动(sqrt(1-t^2))
  58765. /**
  58766. * @function SuperMap.LevelRenderer.Animation.easing.CircularIn
  58767. * @description 返回按圆形曲线的缓动进入的值
  58768. * @param {number} k - 参数
  58769. * @return {number} 按圆形曲线的缓动进入的值
  58770. */
  58771. }, {
  58772. key: "CircularIn",
  58773. value: function CircularIn(k) {
  58774. return 1 - Math.sqrt(1 - k * k);
  58775. }
  58776. /**
  58777. * @function SuperMap.LevelRenderer.Animation.easing.CircularOut
  58778. * @description 返回按圆形曲线的缓动退出的值
  58779. * @param {number} k - 参数
  58780. * @return {number} 按圆形曲线的缓动退出的值
  58781. */
  58782. }, {
  58783. key: "CircularOut",
  58784. value: function CircularOut(k) {
  58785. return Math.sqrt(1 - --k * k);
  58786. }
  58787. /**
  58788. * @function SuperMap.LevelRenderer.Animation.easing.CircularInOut
  58789. * @description 返回按圆形曲线的缓动进入退出的值
  58790. * @param {number} k - 参数
  58791. * @return {number} 按圆形曲线的缓动进入退出的值
  58792. */
  58793. }, {
  58794. key: "CircularInOut",
  58795. value: function CircularInOut(k) {
  58796. if ((k *= 2) < 1) {
  58797. return -0.5 * (Math.sqrt(1 - k * k) - 1);
  58798. }
  58799. return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
  58800. } // 创建类似于弹簧在停止前来回振荡的动画
  58801. /**
  58802. * @function SuperMap.LevelRenderer.Animation.easing.ElasticIn
  58803. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  58804. * @param {number} k - 参数
  58805. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入的值
  58806. */
  58807. }, {
  58808. key: "ElasticIn",
  58809. value: function ElasticIn(k) {
  58810. var s;
  58811. var a = 0.1;
  58812. var p = 0.4;
  58813. if (k === 0) {
  58814. return 0;
  58815. }
  58816. if (k === 1) {
  58817. return 1;
  58818. }
  58819. if (a < 1) {
  58820. a = 1;
  58821. s = p / 4;
  58822. } else {
  58823. s = p * Math.asin(1 / a) / (2 * Math.PI);
  58824. }
  58825. return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  58826. }
  58827. /**
  58828. * @function SuperMap.LevelRenderer.Animation.easing.ElasticOut
  58829. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  58830. * @param {number} k - 参数
  58831. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动退出的值
  58832. */
  58833. }, {
  58834. key: "ElasticOut",
  58835. value: function ElasticOut(k) {
  58836. var s;
  58837. var a = 0.1;
  58838. var p = 0.4;
  58839. if (k === 0) {
  58840. return 0;
  58841. }
  58842. if (k === 1) {
  58843. return 1;
  58844. }
  58845. if (a < 1) {
  58846. a = 1;
  58847. s = p / 4;
  58848. } else {
  58849. s = p * Math.asin(1 / a) / (2 * Math.PI);
  58850. }
  58851. return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;
  58852. }
  58853. /**
  58854. * @function SuperMap.LevelRenderer.Animation.easing.ElasticInOut
  58855. * @description 返回按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  58856. * @param {number} k - 参数
  58857. * @return {number} 按类似于弹簧在停止前来回振荡的动画的缓动进入退出的值
  58858. */
  58859. }, {
  58860. key: "ElasticInOut",
  58861. value: function ElasticInOut(k) {
  58862. var s;
  58863. var a = 0.1;
  58864. var p = 0.4;
  58865. if (k === 0) {
  58866. return 0;
  58867. }
  58868. if (k === 1) {
  58869. return 1;
  58870. }
  58871. if (a < 1) {
  58872. a = 1;
  58873. s = p / 4;
  58874. } else {
  58875. s = p * Math.asin(1 / a) / (2 * Math.PI);
  58876. }
  58877. if ((k *= 2) < 1) {
  58878. return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));
  58879. }
  58880. return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
  58881. } // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
  58882. /**
  58883. * @function SuperMap.LevelRenderer.Animation.easing.BackIn
  58884. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  58885. * @param {number} k - 参数
  58886. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入的值
  58887. */
  58888. }, {
  58889. key: "BackIn",
  58890. value: function BackIn(k) {
  58891. var s = 1.70158;
  58892. return k * k * ((s + 1) * k - s);
  58893. }
  58894. /**
  58895. * @function SuperMap.LevelRenderer.Animation.easing.BackOut
  58896. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  58897. * @param {number} k - 参数
  58898. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动退出的值
  58899. */
  58900. }, {
  58901. key: "BackOut",
  58902. value: function BackOut(k) {
  58903. var s = 1.70158;
  58904. return --k * k * ((s + 1) * k + s) + 1;
  58905. }
  58906. /**
  58907. * @function SuperMap.LevelRenderer.Animation.easing.BackInOut
  58908. * @description 返回按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  58909. * @param {number} k - 参数
  58910. * @return {number} 按在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动的缓动进入退出的值
  58911. */
  58912. }, {
  58913. key: "BackInOut",
  58914. value: function BackInOut(k) {
  58915. var s = 1.70158 * 1.525;
  58916. if ((k *= 2) < 1) {
  58917. return 0.5 * (k * k * ((s + 1) * k - s));
  58918. }
  58919. return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
  58920. } // 创建弹跳效果
  58921. /**
  58922. * @function SuperMap.LevelRenderer.Animation.easing.BounceIn
  58923. * @description 返回按弹跳效果的缓动进入的值
  58924. * @param {number} k - 参数
  58925. * @return {number} 按弹跳效果的缓动进入的值
  58926. */
  58927. }, {
  58928. key: "BounceIn",
  58929. value: function BounceIn(k) {
  58930. return 1 - this.BounceOut(1 - k);
  58931. }
  58932. /**
  58933. * @function SuperMap.LevelRenderer.Animation.easing.BounceOut
  58934. * @description 返回按弹跳效果的缓动退出的值
  58935. * @param {number} k - 参数
  58936. * @return {number} 按弹跳效果的缓动退出的值
  58937. */
  58938. }, {
  58939. key: "BounceOut",
  58940. value: function BounceOut(k) {
  58941. if (k < 1 / 2.75) {
  58942. return 7.5625 * k * k;
  58943. } else if (k < 2 / 2.75) {
  58944. return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;
  58945. } else if (k < 2.5 / 2.75) {
  58946. return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;
  58947. } else {
  58948. return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;
  58949. }
  58950. }
  58951. /**
  58952. * @function SuperMap.LevelRenderer.Animation.easing.BounceInOut
  58953. * @description 返回按弹跳效果的缓动进入退出的值
  58954. * @param {number} k - 参数
  58955. * @return {number} 按弹跳效果的缓动进入退出的值
  58956. */
  58957. }, {
  58958. key: "BounceInOut",
  58959. value: function BounceInOut(k) {
  58960. if (k < 0.5) {
  58961. return this.BounceIn(k * 2) * 0.5;
  58962. }
  58963. return this.BounceOut(k * 2 - 1) * 0.5 + 0.5;
  58964. }
  58965. }]);
  58966. return Easing;
  58967. }();
  58968. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Clip.js
  58969. function Clip_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  58970. 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); } }
  58971. function Clip_createClass(Constructor, protoProps, staticProps) { if (protoProps) Clip_defineProperties(Constructor.prototype, protoProps); if (staticProps) Clip_defineProperties(Constructor, staticProps); return Constructor; }
  58972. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  58973. * This program are made available under the terms of the Apache License, Version 2.0
  58974. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  58975. /**
  58976. * @class SuperMap.LevelRenderer.Animation.Clip
  58977. * @category Visualization Theme
  58978. * @classdec 动画片段
  58979. * @private
  58980. */
  58981. var Clip = /*#__PURE__*/function () {
  58982. /**
  58983. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.constructor
  58984. * @description 构造函数。
  58985. * @param {Object} options - 参数。
  58986. * @param {Object} options.target - 动画对象,可以是数组,如果是数组的话会批量分发 onframe 等事件。
  58987. * @param {number} [options.life=1000] - 动画时长。
  58988. * @param {number} [options.delay=0] - 动画延迟时间。
  58989. * @param {boolean} [options.loop=true] - 是否循环。
  58990. * @param {number} [options.gap=0] - 循环的间隔时间。
  58991. * @param {Object} options.onframe - 帧。
  58992. * @param {boolean} options.easing - 是否消除。
  58993. * @param {boolean} options.ondestroy - 是否销毁。
  58994. * @param {boolean} options.onrestart - 是否重播。
  58995. */
  58996. function Clip(options) {
  58997. Clip_classCallCheck(this, Clip);
  58998. this._targetPool = options.target || {};
  58999. if (!(this._targetPool instanceof Array)) {
  59000. this._targetPool = [this._targetPool];
  59001. } // 生命周期
  59002. this._life = options.life || 1000; // 延时
  59003. this._delay = options.delay || 0; // 开始时间
  59004. this._startTime = new Date().getTime() + this._delay; // 单位毫秒
  59005. // 结束时间
  59006. this._endTime = this._startTime + this._life * 1000; // 是否循环
  59007. this.loop = typeof options.loop == 'undefined' ? false : options.loop;
  59008. this.gap = options.gap || 0;
  59009. this.easing = options.easing || 'Linear';
  59010. this.onframe = options.onframe;
  59011. this.ondestroy = options.ondestroy;
  59012. this.onrestart = options.onrestart;
  59013. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Clip";
  59014. }
  59015. /**
  59016. * @function SuperMap.LevelRenderer.Animation.Clip.prototype.destroy
  59017. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  59018. */
  59019. Clip_createClass(Clip, [{
  59020. key: "destroy",
  59021. value: function destroy() {}
  59022. }, {
  59023. key: "step",
  59024. value: function step(time) {
  59025. var easing = new Easing();
  59026. var percent = (time - this._startTime) / this._life; // 还没开始
  59027. if (percent < 0) {
  59028. return;
  59029. }
  59030. percent = Math.min(percent, 1);
  59031. var easingFunc = typeof this.easing == 'string' ? easing[this.easing] : this.easing;
  59032. var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;
  59033. this.fire('frame', schedule); // 结束
  59034. if (percent == 1) {
  59035. if (this.loop) {
  59036. this.restart(); // 重新开始周期
  59037. // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
  59038. return 'restart';
  59039. } // 动画完成将这个控制器标识为待删除
  59040. // 在Animation.update中进行批量删除
  59041. this._needsRemove = true;
  59042. return 'destroy';
  59043. }
  59044. return null;
  59045. }
  59046. }, {
  59047. key: "restart",
  59048. value: function restart() {
  59049. var time = new Date().getTime();
  59050. var remainder = (time - this._startTime) % this._life;
  59051. this._startTime = new Date().getTime() - remainder + this.gap;
  59052. }
  59053. }, {
  59054. key: "fire",
  59055. value: function fire(eventType, arg) {
  59056. for (var i = 0, len = this._targetPool.length; i < len; i++) {
  59057. if (this['on' + eventType]) {
  59058. this['on' + eventType](this._targetPool[i], arg);
  59059. }
  59060. }
  59061. }
  59062. }]);
  59063. return Clip;
  59064. }();
  59065. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Animation.js
  59066. function Animation_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Animation_typeof = function _typeof(obj) { return typeof obj; }; } else { Animation_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Animation_typeof(obj); }
  59067. function Animation_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59068. 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); } }
  59069. function Animation_createClass(Constructor, protoProps, staticProps) { if (protoProps) Animation_defineProperties(Constructor.prototype, protoProps); if (staticProps) Animation_defineProperties(Constructor, staticProps); return Constructor; }
  59070. 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 } }); if (superClass) Animation_setPrototypeOf(subClass, superClass); }
  59071. function Animation_setPrototypeOf(o, p) { Animation_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Animation_setPrototypeOf(o, p); }
  59072. 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); }; }
  59073. function Animation_possibleConstructorReturn(self, call) { if (call && (Animation_typeof(call) === "object" || typeof call === "function")) { return call; } return Animation_assertThisInitialized(self); }
  59074. function Animation_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  59075. function Animation_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  59076. function Animation_getPrototypeOf(o) { Animation_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Animation_getPrototypeOf(o); }
  59077. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  59078. * This program are made available under the terms of the Apache License, Version 2.0
  59079. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59080. /**
  59081. * @class SuperMap.LevelRenderer.Animation
  59082. * @classdesc 动画主类, 调度和管理所有动画控制器
  59083. * @category Visualization Theme
  59084. * @extends {SuperMap.LevelRenderer.Eventful}
  59085. * @private
  59086. */
  59087. var Animation = /*#__PURE__*/function (_Eventful) {
  59088. Animation_inherits(Animation, _Eventful);
  59089. var _super = Animation_createSuper(Animation);
  59090. /**
  59091. * @function SuperMap.LevelRenderer.Animation.prototype.constructor
  59092. * @description 构造函数。
  59093. * @param {Object} options - 动画参数。
  59094. * @param {Object} options.onframe - onframe。
  59095. * @param {Object} options.stage - stage。
  59096. * (start code)
  59097. * var animation = new SuperMap.LevelRenderer.Animation();
  59098. * var obj = {
  59099. * x: 100,
  59100. * y: 100
  59101. * };
  59102. * animation.animate(node.position)
  59103. * .when(1000, {
  59104. * x: 500,
  59105. * y: 500
  59106. * })
  59107. * .when(2000, {
  59108. * x: 100,
  59109. * y: 100
  59110. * })
  59111. * .start('spline');
  59112. * (end)
  59113. */
  59114. function Animation(options) {
  59115. var _this;
  59116. Animation_classCallCheck(this, Animation);
  59117. _this = _super.call(this, options);
  59118. options = options || {};
  59119. /**
  59120. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.stage
  59121. * @description stage。
  59122. */
  59123. _this.stage = {};
  59124. /**
  59125. * @member {Object} SuperMap.LevelRenderer.Animation.prototype.onframe
  59126. * @description onframe。
  59127. */
  59128. _this.onframe = function () {};
  59129. /**
  59130. * @member {Array} SuperMap.LevelRenderer.Animation.prototype._clips
  59131. * @description _clips。
  59132. */
  59133. _this._clips = [];
  59134. /**
  59135. * @member {boolean} SuperMap.LevelRenderer.Animation.prototype._running
  59136. * @description _running。
  59137. */
  59138. _this._running = false;
  59139. /**
  59140. * @member {number} SuperMap.LevelRenderer.Animation.prototype._time
  59141. * @description _time。
  59142. */
  59143. _this._time = 0;
  59144. Util.extend(Animation_assertThisInitialized(_this), options);
  59145. _this.CLASS_NAME = "SuperMap.LevelRenderer.Animation";
  59146. return _this;
  59147. }
  59148. /**
  59149. * @function SuperMap.LevelRenderer.Animation.prototype.add
  59150. * @description 添加动画片段。
  59151. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  59152. */
  59153. Animation_createClass(Animation, [{
  59154. key: "add",
  59155. value: function add(clip) {
  59156. this._clips.push(clip);
  59157. }
  59158. /**
  59159. * @function SuperMap.LevelRenderer.Animation.prototype.remove
  59160. * @description 删除动画片段。
  59161. * @param {SuperMap.LevelRenderer.Animation.Clip} clip - 动画片段。
  59162. */
  59163. }, {
  59164. key: "remove",
  59165. value: function remove(clip) {
  59166. var idx = new Util_Util().indexOf(this._clips, clip);
  59167. if (idx >= 0) {
  59168. this._clips.splice(idx, 1);
  59169. }
  59170. }
  59171. /**
  59172. * @function SuperMap.LevelRenderer.Animation.prototype.update
  59173. * @description 更新动画片段。
  59174. */
  59175. }, {
  59176. key: "_update",
  59177. value: function _update() {
  59178. var time = new Date().getTime();
  59179. var delta = time - this._time;
  59180. var clips = this._clips;
  59181. var len = clips.length;
  59182. var deferredEvents = [];
  59183. var deferredClips = [];
  59184. for (var i = 0; i < len; i++) {
  59185. var clip = clips[i];
  59186. var e = clip.step(time); // Throw out the events need to be called after
  59187. // stage.update, like destroy
  59188. if (e) {
  59189. deferredEvents.push(e);
  59190. deferredClips.push(clip);
  59191. }
  59192. }
  59193. if (this.stage.update) {
  59194. this.stage.update();
  59195. } // Remove the finished clip
  59196. for (var _i = 0; _i < len;) {
  59197. if (clips[_i]._needsRemove) {
  59198. clips[_i] = clips[len - 1];
  59199. clips.pop();
  59200. len--;
  59201. } else {
  59202. _i++;
  59203. }
  59204. }
  59205. len = deferredEvents.length;
  59206. for (var _i2 = 0; _i2 < len; _i2++) {
  59207. deferredClips[_i2].fire(deferredEvents[_i2]);
  59208. }
  59209. this._time = time;
  59210. this.onframe(delta);
  59211. this.dispatch('frame', delta);
  59212. }
  59213. /**
  59214. * @function SuperMap.LevelRenderer.Animation.prototype.start
  59215. * @description 开始运行动画。
  59216. */
  59217. }, {
  59218. key: "start",
  59219. value: function start() {
  59220. var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function (func) {
  59221. setTimeout(func, 16);
  59222. };
  59223. var self = this;
  59224. this._running = true;
  59225. function step() {
  59226. if (self._running) {
  59227. self._update();
  59228. requestAnimationFrame(step);
  59229. }
  59230. }
  59231. this._time = new Date().getTime();
  59232. requestAnimationFrame(step);
  59233. }
  59234. /**
  59235. * @function SuperMap.LevelRenderer.Animation.prototype.stop
  59236. * @description 停止运行动画。
  59237. */
  59238. }, {
  59239. key: "stop",
  59240. value: function stop() {
  59241. this._running = false;
  59242. }
  59243. /**
  59244. * @function SuperMap.LevelRenderer.Animation.prototype.clear
  59245. * @description 清除所有动画片段。
  59246. */
  59247. }, {
  59248. key: "clear",
  59249. value: function clear() {
  59250. this._clips = [];
  59251. }
  59252. /**
  59253. * @function SuperMap.LevelRenderer.Animation.prototype.animate
  59254. * @description 对一个目标创建一个animator对象,可以指定目标中的属性使用动画。
  59255. * @param {Object} target - 目标对象。
  59256. * @param {Object} options - 动画参数选项。
  59257. * @param {boolean} [options.loop=false] - 是否循环播放动画。
  59258. * @param {function} [options.getter] - 如果指定getter函数,会通过getter函数取属性值。
  59259. * @param {function} [options.setter] - 如果指定setter函数,会通过setter函数设置属性值。
  59260. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator。
  59261. */
  59262. }, {
  59263. key: "animate",
  59264. value: function animate(target, options) {
  59265. options = options || {};
  59266. var deferred = new Animator(target, options.loop, options.getter, options.setter);
  59267. deferred.animation = this;
  59268. return deferred;
  59269. }
  59270. }], [{
  59271. key: "_interpolateNumber",
  59272. value: function _interpolateNumber(p0, p1, percent) {
  59273. return (p1 - p0) * percent + p0;
  59274. }
  59275. }, {
  59276. key: "_interpolateArray",
  59277. value: function _interpolateArray(p0, p1, percent, out, arrDim) {
  59278. var len = p0.length;
  59279. if (arrDim == 1) {
  59280. for (var i = 0; i < len; i++) {
  59281. out[i] = Animation._interpolateNumber(p0[i], p1[i], percent);
  59282. }
  59283. } else {
  59284. var len2 = p0[0].length;
  59285. for (var _i3 = 0; _i3 < len; _i3++) {
  59286. for (var j = 0; j < len2; j++) {
  59287. out[_i3][j] = Animation._interpolateNumber(p0[_i3][j], p1[_i3][j], percent);
  59288. }
  59289. }
  59290. }
  59291. }
  59292. }, {
  59293. key: "_isArrayLike",
  59294. value: function _isArrayLike(data) {
  59295. switch (Animation_typeof(data)) {
  59296. case 'undefined':
  59297. case 'string':
  59298. return false;
  59299. }
  59300. return typeof data.length !== 'undefined';
  59301. }
  59302. }, {
  59303. key: "_catmullRomInterpolateArray",
  59304. value: function _catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {
  59305. var len = p0.length;
  59306. if (arrDim == 1) {
  59307. for (var i = 0; i < len; i++) {
  59308. out[i] = Animation._catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);
  59309. }
  59310. } else {
  59311. var len2 = p0[0].length;
  59312. for (var _i4 = 0; _i4 < len; _i4++) {
  59313. for (var j = 0; j < len2; j++) {
  59314. out[_i4][j] = Animation._catmullRomInterpolate(p0[_i4][j], p1[_i4][j], p2[_i4][j], p3[_i4][j], t, t2, t3);
  59315. }
  59316. }
  59317. }
  59318. }
  59319. }, {
  59320. key: "_catmullRomInterpolate",
  59321. value: function _catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
  59322. var v0 = (p2 - p0) * 0.5;
  59323. var v1 = (p3 - p1) * 0.5;
  59324. return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;
  59325. }
  59326. }, {
  59327. key: "_cloneValue",
  59328. value: function _cloneValue(value) {
  59329. var arraySlice = Array.prototype.slice;
  59330. if (Animation._isArrayLike(value)) {
  59331. var len = value.length;
  59332. if (Animation._isArrayLike(value[0])) {
  59333. var ret = [];
  59334. for (var i = 0; i < len; i++) {
  59335. ret.push(arraySlice.call(value[i]));
  59336. }
  59337. return ret;
  59338. } else {
  59339. return arraySlice.call(value);
  59340. }
  59341. } else {
  59342. return value;
  59343. }
  59344. }
  59345. }, {
  59346. key: "rgba2String",
  59347. value: function rgba2String(rgba) {
  59348. rgba[0] = Math.floor(rgba[0]);
  59349. rgba[1] = Math.floor(rgba[1]);
  59350. rgba[2] = Math.floor(rgba[2]);
  59351. return 'rgba(' + rgba.join(',') + ')';
  59352. }
  59353. }]);
  59354. return Animation;
  59355. }(Eventful);
  59356. /**
  59357. * @class SuperMap.LevelRenderer.Animation.Animator
  59358. */
  59359. var Animator = /*#__PURE__*/function () {
  59360. /**
  59361. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.animate
  59362. * @description 构造函数
  59363. * @param {Object} target - 目标对象。
  59364. * @param {Object} options - 动画参数选项。
  59365. * @param {boolean} [loop=false] - 是否循环播放动画。
  59366. * @param {function} [getterl] - 如果指定getter函数,会通过getter函数取属性值。
  59367. * @param {function} [setter] - 如果指定setter函数,会通过setter函数设置属性值。
  59368. */
  59369. function Animator(target, loop, getter, setter) {
  59370. Animation_classCallCheck(this, Animator);
  59371. /**
  59372. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._tracks
  59373. * @description _tracks。
  59374. */
  59375. this._tracks = {};
  59376. /**
  59377. * @member {Object} SuperMap.LevelRenderer.Animation.Animator.prototype._target
  59378. * @description _target。
  59379. */
  59380. this._target = target;
  59381. /**
  59382. * @member {boolean} SuperMap.LevelRenderer.Animation.Animator.prototype._loop
  59383. * @description _loop。
  59384. */
  59385. this._loop = loop || false;
  59386. /**
  59387. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._getter
  59388. * @description _getter。
  59389. */
  59390. this._getter = getter || _defaultGetter;
  59391. /**
  59392. * @member {function} SuperMap.LevelRenderer.Animation.Animator.prototype._setter
  59393. * @description _setter。
  59394. */
  59395. this._setter = setter || _defaultSetter;
  59396. /**
  59397. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._clipCount
  59398. * @description _clipCount。
  59399. */
  59400. this._clipCount = 0;
  59401. /**
  59402. * @member {number} SuperMap.LevelRenderer.Animation.Animator.prototype._delay
  59403. * @description _delay。
  59404. */
  59405. this._delay = 0;
  59406. /**
  59407. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._doneList
  59408. * @description _doneList。
  59409. */
  59410. this._doneList = [];
  59411. /**
  59412. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._onframeList
  59413. * @description _onframeList。
  59414. */
  59415. this._onframeList = [];
  59416. /**
  59417. * @member {Array} SuperMap.LevelRenderer.Animation.Animator.prototype._clipList
  59418. * @description _clipList。
  59419. */
  59420. this._clipList = [];
  59421. this.CLASS_NAME = "SuperMap.LevelRenderer.Animation.Animator"; //Function
  59422. function _defaultGetter(target, key) {
  59423. return target[key];
  59424. }
  59425. function _defaultSetter(target, key, value) {
  59426. target[key] = value;
  59427. }
  59428. }
  59429. /**
  59430. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.when
  59431. * @description 设置动画关键帧
  59432. * @param {number} time - 关键帧时间,单位是ms
  59433. * @param {Object} props - 关键帧的属性值,key-value表示
  59434. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  59435. */
  59436. Animation_createClass(Animator, [{
  59437. key: "when",
  59438. value: function when(time
  59439. /* ms */
  59440. , props) {
  59441. for (var propName in props) {
  59442. if (!this._tracks[propName]) {
  59443. this._tracks[propName] = []; // If time is 0
  59444. // Then props is given initialize value
  59445. // Else
  59446. // Initialize value from current prop value
  59447. if (time !== 0) {
  59448. this._tracks[propName].push({
  59449. time: 0,
  59450. value: Animation._cloneValue(this._getter(this._target, propName))
  59451. });
  59452. }
  59453. }
  59454. this._tracks[propName].push({
  59455. time: parseInt(time, 10),
  59456. value: props[propName]
  59457. });
  59458. }
  59459. return this;
  59460. }
  59461. /**
  59462. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.during
  59463. * @description 添加动画每一帧的回调函数
  59464. * @param {RequestCallback} callback - 回调函数
  59465. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  59466. */
  59467. }, {
  59468. key: "during",
  59469. value: function during(callback) {
  59470. this._onframeList.push(callback);
  59471. return this;
  59472. }
  59473. /**
  59474. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.start
  59475. * @description 开始执行动画
  59476. * @param {(string|function)} easing - 动画缓动函数。详见:<{@link SuperMap.LevelRenderer.Animation.easing}>。
  59477. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  59478. */
  59479. }, {
  59480. key: "start",
  59481. value: function start(easing) {
  59482. var self = this;
  59483. var setter = this._setter;
  59484. var getter = this._getter;
  59485. var onFrameListLen = self._onframeList.length;
  59486. var useSpline = easing === 'spline';
  59487. var ondestroy = function ondestroy() {
  59488. self._clipCount--;
  59489. if (self._clipCount === 0) {
  59490. // Clear all tracks
  59491. self._tracks = {};
  59492. var len = self._doneList.length;
  59493. for (var i = 0; i < len; i++) {
  59494. self._doneList[i].call(self);
  59495. }
  59496. }
  59497. };
  59498. var createTrackClip = function createTrackClip(keyframes, propName) {
  59499. var trackLen = keyframes.length;
  59500. if (!trackLen) {
  59501. return;
  59502. } // Guess data type
  59503. var firstVal = keyframes[0].value;
  59504. var isValueArray = Animation._isArrayLike(firstVal);
  59505. var isValueColor = false; // For vertices morphing
  59506. var arrDim = isValueArray && Animation._isArrayLike(firstVal[0]) ? 2 : 1; // Sort keyframe as ascending
  59507. keyframes.sort(function (a, b) {
  59508. return a.time - b.time;
  59509. });
  59510. var trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe
  59511. var kfPercents = []; // Value of each keyframe
  59512. var kfValues = [];
  59513. for (var _i5 = 0; _i5 < trackLen; _i5++) {
  59514. kfPercents.push(keyframes[_i5].time / trackMaxTime); // Assume value is a color when it is a string
  59515. var value = keyframes[_i5].value;
  59516. if (typeof value == 'string') {
  59517. value = SUtil_SUtil.Util_color.toArray(value);
  59518. if (value.length === 0) {
  59519. // Invalid color
  59520. value[0] = value[1] = value[2] = 0;
  59521. value[3] = 1;
  59522. }
  59523. isValueColor = true;
  59524. }
  59525. kfValues.push(value);
  59526. } // Cache the key of last frame to speed up when
  59527. // animation playback is sequency
  59528. var cacheKey = 0;
  59529. var cachePercent = 0;
  59530. var start;
  59531. var i;
  59532. var w;
  59533. var p0;
  59534. var p1;
  59535. var p2;
  59536. var p3;
  59537. if (isValueColor) {
  59538. var rgba = [0, 0, 0, 0];
  59539. }
  59540. var onframe = function onframe(target, percent) {
  59541. // Find the range keyframes
  59542. // kf1-----kf2---------current--------kf3
  59543. // find kf2 and kf3 and do interpolation
  59544. if (percent < cachePercent) {
  59545. // Start from next key
  59546. start = Math.min(cacheKey + 1, trackLen - 1);
  59547. for (i = start; i >= 0; i--) {
  59548. if (kfPercents[i] <= percent) {
  59549. break;
  59550. }
  59551. }
  59552. i = Math.min(i, trackLen - 2);
  59553. } else {
  59554. for (i = cacheKey; i < trackLen; i++) {
  59555. if (kfPercents[i] > percent) {
  59556. break;
  59557. }
  59558. }
  59559. i = Math.min(i - 1, trackLen - 2);
  59560. }
  59561. cacheKey = i;
  59562. cachePercent = percent;
  59563. var range = kfPercents[i + 1] - kfPercents[i];
  59564. if (range === 0) {
  59565. return;
  59566. } else {
  59567. w = (percent - kfPercents[i]) / range;
  59568. }
  59569. if (useSpline) {
  59570. p1 = kfValues[i];
  59571. p0 = kfValues[i === 0 ? i : i - 1];
  59572. p2 = kfValues[i > trackLen - 2 ? trackLen - 1 : i + 1];
  59573. p3 = kfValues[i > trackLen - 3 ? trackLen - 1 : i + 2];
  59574. if (isValueArray) {
  59575. Animation._catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);
  59576. } else {
  59577. var _value;
  59578. if (isValueColor) {
  59579. // value = SuperMap.LevelRenderer.Animation._catmullRomInterpolateArray(
  59580. // p0, p1, p2, p3, w, w * w, w * w * w,
  59581. // rgba, 1
  59582. // );
  59583. _value = Animation.rgba2String(rgba);
  59584. } else {
  59585. _value = Animation._catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);
  59586. }
  59587. setter(target, propName, _value);
  59588. }
  59589. } else {
  59590. if (isValueArray) {
  59591. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, getter(target, propName), arrDim);
  59592. } else {
  59593. var _value2;
  59594. if (isValueColor) {
  59595. Animation._interpolateArray(kfValues[i], kfValues[i + 1], w, rgba, 1);
  59596. _value2 = Animation.rgba2String(rgba);
  59597. } else {
  59598. _value2 = Animation._interpolateNumber(kfValues[i], kfValues[i + 1], w);
  59599. }
  59600. setter(target, propName, _value2);
  59601. }
  59602. }
  59603. for (i = 0; i < onFrameListLen; i++) {
  59604. self._onframeList[i](target, percent);
  59605. }
  59606. };
  59607. var clip = new Clip({
  59608. target: self._target,
  59609. life: trackMaxTime,
  59610. loop: self._loop,
  59611. delay: self._delay,
  59612. onframe: onframe,
  59613. ondestroy: ondestroy
  59614. });
  59615. if (easing && easing !== 'spline') {
  59616. clip.easing = easing;
  59617. }
  59618. self._clipList.push(clip);
  59619. self._clipCount++;
  59620. self.animation.add(clip);
  59621. };
  59622. for (var propName in this._tracks) {
  59623. createTrackClip(this._tracks[propName], propName);
  59624. }
  59625. return this;
  59626. }
  59627. /**
  59628. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.stop
  59629. * @description 停止动画
  59630. */
  59631. }, {
  59632. key: "stop",
  59633. value: function stop() {
  59634. for (var i = 0; i < this._clipList.length; i++) {
  59635. var clip = this._clipList[i];
  59636. this.animation.remove(clip);
  59637. }
  59638. this._clipList = [];
  59639. }
  59640. /**
  59641. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.delay
  59642. * @description 设置动画延迟开始的时间
  59643. * @param {number} time - 时间,单位ms
  59644. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  59645. */
  59646. }, {
  59647. key: "delay",
  59648. value: function delay(time) {
  59649. this._delay = time;
  59650. return this;
  59651. }
  59652. /**
  59653. * @function SuperMap.LevelRenderer.Animation.Animator.prototype.done
  59654. * @description 添加动画结束的回调
  59655. * @param {function} cb - Function
  59656. * @returns {SuperMap.LevelRenderer.Animation.Animator} Animator
  59657. */
  59658. }, {
  59659. key: "done",
  59660. value: function done(cb) {
  59661. if (cb) {
  59662. this._doneList.push(cb);
  59663. }
  59664. return this;
  59665. }
  59666. }]);
  59667. return Animator;
  59668. }();
  59669. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/Render.js
  59670. function Render_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  59671. 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); } }
  59672. function Render_createClass(Constructor, protoProps, staticProps) { if (protoProps) Render_defineProperties(Constructor.prototype, protoProps); if (staticProps) Render_defineProperties(Constructor, staticProps); return Constructor; }
  59673. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  59674. * This program are made available under the terms of the Apache License, Version 2.0
  59675. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  59676. /**
  59677. * @private
  59678. * @class SuperMap.LevelRenderer.Render
  59679. * @category Visualization Theme
  59680. * @classdesc Render 接口类,对外可用的所有接口都在这里。内部使用非 get 接口统一返回 this 对象,支持链式调用。
  59681. */
  59682. var Render = /*#__PURE__*/function () {
  59683. /**
  59684. * @function SuperMap.LevelRenderer.Render.constructor
  59685. * @description 构造函数。
  59686. *
  59687. * @param {string} id - 唯一标识。
  59688. * @param {HTMLElement} dom - Dom 对象。
  59689. */
  59690. function Render(id, dom) {
  59691. Render_classCallCheck(this, Render);
  59692. /**
  59693. * @member {string} SuperMap.LevelRenderer.Render.prototype.id
  59694. * @description 唯一标识。
  59695. */
  59696. this.id = id;
  59697. /**
  59698. * @member {SuperMap.LevelRenderer.Storage} SuperMap.LevelRenderer.Render.prototype.storage
  59699. * @description 图形仓库对象。
  59700. */
  59701. this.storage = new Storage();
  59702. /**
  59703. * @member {SuperMap.LevelRenderer.Painter} SuperMap.LevelRenderer.Render.prototype.painter
  59704. * @description 绘制器对象。
  59705. *
  59706. */
  59707. this.painter = new Painter(dom, this.storage);
  59708. /**
  59709. * @member {SuperMap.LevelRenderer.Handler} SuperMap.LevelRenderer.Render.prototype.handler
  59710. * @description 事件处理对象。
  59711. *
  59712. */
  59713. this.handler = new Handler(dom, this.storage, this.painter);
  59714. /**
  59715. * @member {Array} SuperMap.LevelRenderer.Render.prototype.animatingElements
  59716. * @description 动画控制数组。
  59717. *
  59718. */
  59719. this.animatingElements = [];
  59720. /**
  59721. * @member {SuperMap.LevelRenderer.animation.Animation} SuperMap.LevelRenderer.Render.prototype.animation
  59722. * @description 动画对象。
  59723. *
  59724. */
  59725. this.animation = new Animation({
  59726. stage: {
  59727. update: Render.getFrameCallback(this)
  59728. }
  59729. });
  59730. /**
  59731. * @member {boolean} SuperMap.LevelRenderer.Render.prototype._needsRefreshNextFrame
  59732. * @description 是否需要刷新下一帧。
  59733. *
  59734. */
  59735. this._needsRefreshNextFrame = false;
  59736. this.animation.start();
  59737. this.CLASS_NAME = "SuperMap.LevelRenderer.Render";
  59738. }
  59739. /**
  59740. * @function SuperMap.LevelRenderer.Render.prototype.destory
  59741. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  59742. */
  59743. Render_createClass(Render, [{
  59744. key: "destroy",
  59745. value: function destroy() {
  59746. this.id = null;
  59747. this.storage = null;
  59748. this.painter = null;
  59749. this.handler = null;
  59750. this.animatingElements = null;
  59751. this.animation = null;
  59752. this._needsRefreshNextFrame = null;
  59753. }
  59754. /**
  59755. * @function SuperMap.LevelRenderer.Render.prototype.getId
  59756. * @description 获取实例唯一标识。
  59757. * @return {string} 实例唯一标识。
  59758. */
  59759. }, {
  59760. key: "getId",
  59761. value: function getId() {
  59762. return this.id;
  59763. }
  59764. /**
  59765. * @function SuperMap.LevelRenderer.Render.prototype.addShape
  59766. * @description 添加图形形状到根节点。
  59767. *
  59768. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象,可用属性全集,详见各 shape。
  59769. * @return {SuperMap.LevelRenderer.Render} this。
  59770. */
  59771. }, {
  59772. key: "addShape",
  59773. value: function addShape(shape) {
  59774. this.storage.addRoot(shape);
  59775. return this;
  59776. }
  59777. /**
  59778. * @function SuperMap.LevelRenderer.Render.prototype.addGroup
  59779. * @description 添加组到根节点。
  59780. *
  59781. * (code)
  59782. * //添加组到根节点例子
  59783. * var render = new SuperMap.LevelRenderer.Render("Render",document.getElementById('lRendertest'));
  59784. * render.clear();
  59785. * var g = new SuperMap.LevelRenderer.Group();
  59786. * g.addChild(new SuperMap.LevelRenderer.Shape.Circle({
  59787. * style: {
  59788. * x: 100,
  59789. * y: 100,
  59790. * r: 20,
  59791. * brushType: 'fill'
  59792. * }
  59793. * }));
  59794. * render.addGroup(g);
  59795. * render.render();
  59796. * (end)
  59797. *
  59798. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  59799. * @return {SuperMap.LevelRenderer.Render} this。
  59800. */
  59801. }, {
  59802. key: "addGroup",
  59803. value: function addGroup(group) {
  59804. this.storage.addRoot(group);
  59805. return this;
  59806. }
  59807. /**
  59808. * @function SuperMap.LevelRenderer.Render.prototype.delShape
  59809. * @description 从根节点删除图形形状。
  59810. *
  59811. * @param {string} shapeId - 图形对象唯一标识。
  59812. * @return {SuperMap.LevelRenderer.Render} this。
  59813. */
  59814. }, {
  59815. key: "delShape",
  59816. value: function delShape(shapeId) {
  59817. this.storage.delRoot(shapeId);
  59818. return this;
  59819. }
  59820. /**
  59821. * @function SuperMap.LevelRenderer.Render.prototype.delGroup
  59822. * @description 从根节点删除组。
  59823. *
  59824. * @param {string} groupId - 组对象唯一标识。
  59825. * @return {SuperMap.LevelRenderer.Render} this。
  59826. */
  59827. }, {
  59828. key: "delGroup",
  59829. value: function delGroup(groupId) {
  59830. this.storage.delRoot(groupId);
  59831. return this;
  59832. }
  59833. /**
  59834. * @function SuperMap.LevelRenderer.Render.prototype.modShape
  59835. * @description 修改图形形状。
  59836. *
  59837. * @param {string} shapeId - 图形对象唯一标识。
  59838. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  59839. * @return {SuperMap.LevelRenderer.Render} this。
  59840. */
  59841. }, {
  59842. key: "modShape",
  59843. value: function modShape(shapeId, shape) {
  59844. this.storage.mod(shapeId, shape);
  59845. return this;
  59846. }
  59847. /**
  59848. * @function SuperMap.LevelRenderer.Render.prototype.modGroup
  59849. * @description 修改组。
  59850. *
  59851. * @param {string} groupId - 组对象唯一标识。
  59852. * @param {SuperMap.LevelRenderer.Group} group - 组对象。
  59853. * @return {SuperMap.LevelRenderer.Render} this。
  59854. */
  59855. }, {
  59856. key: "modGroup",
  59857. value: function modGroup(groupId, group) {
  59858. this.storage.mod(groupId, group);
  59859. return this;
  59860. }
  59861. /**
  59862. * @function SuperMap.LevelRenderer.Render.prototype.modLayer
  59863. * @description 修改指定 zlevel 的绘制配置项。
  59864. *
  59865. * @param {string} zLevel - 组对象唯一标识。
  59866. * @param {Object} config - 配置对象。
  59867. * @param {string} clearColor - 每次清空画布的颜色。默认值:0。
  59868. * @param {noolean} motionBlur - 是否开启动态模糊。默认值:false。
  59869. * @param {number} lastFrameAlpha - 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显。默认值:0.7。
  59870. * @param {Array.<number>} position - 层的平移。
  59871. * @param {Array.<number>} rotation - 层的旋转。
  59872. * @param {Array.<number>} scale - 层的缩放。
  59873. * @param {boolean} zoomable - 层是否支持鼠标缩放操作。默认值:false。
  59874. * @param {boolean} panable - 层是否支持鼠标平移操作。默认值:false。
  59875. * @return {SuperMap.LevelRenderer.Render} this。
  59876. */
  59877. }, {
  59878. key: "modLayer",
  59879. value: function modLayer(zLevel, config) {
  59880. this.painter.modLayer(zLevel, config);
  59881. return this;
  59882. }
  59883. /**
  59884. * @function SuperMap.LevelRenderer.Render.prototype.addHoverShape
  59885. * @description 添加额外高亮层显示,仅提供添加方法,每次刷新后高亮层图形均被清空。
  59886. *
  59887. * @param {SuperMap.LevelRenderer.Shape} shape - 图形对象。
  59888. * @return {SuperMap.LevelRenderer.Render} this。
  59889. */
  59890. }, {
  59891. key: "addHoverShape",
  59892. value: function addHoverShape(shape) {
  59893. this.storage.addHover(shape);
  59894. return this;
  59895. }
  59896. /**
  59897. * @function SuperMap.LevelRenderer.Render.prototype.render
  59898. * @description 渲染。
  59899. *
  59900. * @callback {Function} callback - 渲染结束后回调函数。
  59901. * @return {SuperMap.LevelRenderer.Render} this。
  59902. */
  59903. }, {
  59904. key: "render",
  59905. value: function render(callback) {
  59906. this.painter.render(callback);
  59907. this._needsRefreshNextFrame = false;
  59908. return this;
  59909. }
  59910. /**
  59911. * @function SuperMap.LevelRenderer.Render.prototype.refresh
  59912. * @description 视图更新。
  59913. *
  59914. * @callback {Function} callback - 视图更新后回调函数。
  59915. * @return {SuperMap.LevelRenderer.Render} this。
  59916. */
  59917. }, {
  59918. key: "refresh",
  59919. value: function refresh(callback) {
  59920. this.painter.refresh(callback);
  59921. this._needsRefreshNextFrame = false;
  59922. return this;
  59923. }
  59924. /**
  59925. * @function SuperMap.LevelRenderer.Render.prototype.refreshNextFrame
  59926. * @description 标记视图在浏览器下一帧需要绘制。
  59927. * @return {SuperMap.LevelRenderer.Render} this。
  59928. */
  59929. }, {
  59930. key: "refreshNextFrame",
  59931. value: function refreshNextFrame() {
  59932. this._needsRefreshNextFrame = true;
  59933. return this;
  59934. }
  59935. /**
  59936. * @function SuperMap.LevelRenderer.Render.prototype.refreshHover
  59937. * @description 绘制(视图更新)高亮层。
  59938. * @callback {Function} callback - 视图更新后回调函数。
  59939. * @return {SuperMap.LevelRenderer.Render} this。
  59940. */
  59941. }, {
  59942. key: "refreshHover",
  59943. value: function refreshHover(callback) {
  59944. this.painter.refreshHover(callback);
  59945. return this;
  59946. }
  59947. /**
  59948. * @function SuperMap.LevelRenderer.Render.prototype.refreshShapes
  59949. * @description 视图更新。
  59950. *
  59951. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapeList - 需要更新的图形列表。
  59952. * @callback {Function} callback - 视图更新后回调函数。
  59953. * @return {SuperMap.LevelRenderer.Render} this。
  59954. */
  59955. }, {
  59956. key: "refreshShapes",
  59957. value: function refreshShapes(shapeList, callback) {
  59958. this.painter.refreshShapes(shapeList, callback);
  59959. return this;
  59960. }
  59961. /**
  59962. * @function SuperMap.LevelRenderer.Render.prototype.resize
  59963. * @description 调整视图大小。
  59964. * @return {SuperMap.LevelRenderer.Render} this。
  59965. */
  59966. }, {
  59967. key: "resize",
  59968. value: function resize() {
  59969. this.painter.resize();
  59970. return this;
  59971. }
  59972. /**
  59973. * @function SuperMap.LevelRenderer.Render.prototype.animate
  59974. * @description 动画。
  59975. *
  59976. * @example
  59977. * zr.animate(circle.id, 'style', false)
  59978. * .when(1000, {x: 10} )
  59979. * .done(function(){ // Animation done })
  59980. * .start()
  59981. *
  59982. *
  59983. * @param {Array.<(SuperMap.LevelRenderer.Shape/SuperMap.LevelRenderer.Group)>} el - 动画对象。
  59984. * @param {string} path - 需要添加动画的属性获取路径,可以通过 a.b.c 来获取深层的属性。若传入对象为<SuperMap.LevelRenderer.Group>,path需为空字符串。
  59985. * @param {Function} loop - 动画是否循环。
  59986. * @return {SuperMap.LevelRenderer.animation.Animator} Animator。
  59987. */
  59988. }, {
  59989. key: "animate",
  59990. value: function animate(el, path, loop) {
  59991. if (typeof el === 'string') {
  59992. el = this.storage.get(el);
  59993. }
  59994. if (el) {
  59995. var target;
  59996. if (path) {
  59997. var pathSplitted = path.split('.');
  59998. var prop = el;
  59999. for (var i = 0, l = pathSplitted.length; i < l; i++) {
  60000. if (!prop) {
  60001. continue;
  60002. }
  60003. prop = prop[pathSplitted[i]];
  60004. }
  60005. if (prop) {
  60006. target = prop;
  60007. }
  60008. } else {
  60009. target = el;
  60010. }
  60011. if (!target) {
  60012. SUtil_SUtil.Util_log('Property "' + path + '" is not existed in element ' + el.id);
  60013. return;
  60014. }
  60015. var animatingElements = this.animatingElements;
  60016. if (typeof el.__aniCount === 'undefined') {
  60017. // 正在进行的动画记数
  60018. el.__aniCount = 0;
  60019. }
  60020. if (el.__aniCount === 0) {
  60021. animatingElements.push(el);
  60022. }
  60023. el.__aniCount++;
  60024. return this.animation.animate(target, {
  60025. loop: loop
  60026. }).done(function () {
  60027. el.__aniCount--;
  60028. if (el.__aniCount === 0) {
  60029. // 从animatingElements里移除
  60030. var idx = new Util_Util().indexOf(animatingElements, el);
  60031. animatingElements.splice(idx, 1);
  60032. }
  60033. });
  60034. } else {
  60035. SUtil_SUtil.Util_log('Element not existed');
  60036. }
  60037. }
  60038. /**
  60039. * @function SuperMap.LevelRenderer.Render.prototype.clearAnimation
  60040. * @description 停止所有动画。
  60041. *
  60042. */
  60043. }, {
  60044. key: "clearAnimation",
  60045. value: function clearAnimation() {
  60046. this.animation.clear();
  60047. }
  60048. /**
  60049. * @function SuperMap.LevelRenderer.Render.prototype.getWidth
  60050. * @description 获取视图宽度。
  60051. * @return {number} 视图宽度。
  60052. */
  60053. }, {
  60054. key: "getWidth",
  60055. value: function getWidth() {
  60056. return this.painter.getWidth();
  60057. }
  60058. /**
  60059. * @function SuperMap.LevelRenderer.Render.prototype.getHeight
  60060. * @description 获取视图高度。
  60061. * @return {number} 视图高度。
  60062. */
  60063. }, {
  60064. key: "getHeight",
  60065. value: function getHeight() {
  60066. return this.painter.getHeight();
  60067. }
  60068. /**
  60069. * @function SuperMap.LevelRenderer.Render.prototype.toDataURL
  60070. * @description 图像导出。
  60071. *
  60072. * @param {string} type - 类型。
  60073. * @param {string} backgroundColor - 背景色,默认值:"#FFFFFF"。
  60074. * @param {string} args - 参数。
  60075. * @return {string} 图片的 Base64 url。
  60076. */
  60077. }, {
  60078. key: "toDataURL",
  60079. value: function toDataURL(type, backgroundColor, args) {
  60080. return this.painter.toDataURL(type, backgroundColor, args);
  60081. }
  60082. /**
  60083. * @function SuperMap.LevelRenderer.Render.prototype.shapeToImage
  60084. * @description 将常规 shape 转成 image shape。
  60085. *
  60086. * @param {SuperMap.LevelRenderer.Shape} e - 图形。
  60087. * @param {number} width - 宽度。
  60088. * @param {number} height - 高度。
  60089. * @return {Object} image shape。
  60090. */
  60091. }, {
  60092. key: "shapeToImage",
  60093. value: function shapeToImage(e, width, height) {
  60094. var id = Util.createUniqueID("SuperMap.LevelRenderer.ToImage_");
  60095. return this.painter.shapeToImage(id, e, width, height);
  60096. }
  60097. /**
  60098. * @function SuperMap.LevelRenderer.Render.prototype.on
  60099. * @description 事件绑定。
  60100. *
  60101. * @param {string} eventName - 事件名称。
  60102. * @param {Function} eventHandler - 响应函数。
  60103. * @return {SuperMap.LevelRenderer.Render} this。
  60104. */
  60105. }, {
  60106. key: "on",
  60107. value: function on(eventName, eventHandler) {
  60108. this.handler.on(eventName, eventHandler);
  60109. return this;
  60110. }
  60111. /**
  60112. * @function SuperMap.LevelRenderer.Render.prototype.un
  60113. * @description 事件解绑定,参数为空则解绑所有自定义事件。
  60114. *
  60115. * @param {string} eventName - 事件名称。
  60116. * @param {Function} eventHandler - 响应函数。
  60117. * @return {SuperMap.LevelRenderer.Render} this。
  60118. */
  60119. }, {
  60120. key: "un",
  60121. value: function un(eventName, eventHandler) {
  60122. this.handler.un(eventName, eventHandler);
  60123. return this;
  60124. }
  60125. /**
  60126. * @function SuperMap.LevelRenderer.Render.prototype.trigger
  60127. * @description 事件触发。
  60128. *
  60129. * @param {string} eventName - 事件名称,resize,hover,drag,etc。
  60130. * @param {event} event - event dom事件对象。
  60131. * @return {SuperMap.LevelRenderer.Render} this。
  60132. */
  60133. }, {
  60134. key: "trigger",
  60135. value: function trigger(eventName, event) {
  60136. this.handler.trigger(eventName, event);
  60137. this.handler.dispatch(eventName, event);
  60138. return this;
  60139. }
  60140. /**
  60141. * @function SuperMap.LevelRenderer.Render.prototype.clear
  60142. * @description 清除当前 Render 下所有类图的数据和显示,clear 后 MVC 和已绑定事件均还存在在,Render 可用。
  60143. * @return {SuperMap.LevelRenderer.Render} this。
  60144. */
  60145. }, {
  60146. key: "clear",
  60147. value: function clear() {
  60148. this.storage.delRoot();
  60149. this.painter.clear();
  60150. return this;
  60151. }
  60152. /**
  60153. * @function SuperMap.LevelRenderer.Render.prototype.dispose
  60154. * @description 释放当前 Render 实例(删除包括 dom,数据、显示和事件绑定),dispose后 Render 不可用。
  60155. */
  60156. }, {
  60157. key: "dispose",
  60158. value: function dispose() {
  60159. this.animation.stop();
  60160. this.clear();
  60161. this.storage.dispose();
  60162. this.painter.dispose();
  60163. this.handler.dispose();
  60164. this.animation = null;
  60165. this.animatingElements = null;
  60166. this.storage = null;
  60167. this.painter = null;
  60168. this.handler = null; // 释放后告诉全局删除对自己的索引,没想到啥好方法
  60169. // zrender.delInstance(this.id);
  60170. } // SMIC-方法扩展 - start
  60171. /**
  60172. * @function SuperMap.LevelRenderer.Render.prototype.updateHoverShapes
  60173. * @description 更新设置显示高亮图层。
  60174. *
  60175. * @param {Array.<SuperMap.LevelRenderer.Shape>} shapes - 图形数组。
  60176. * @return {SuperMap.LevelRenderer.Render} this。
  60177. */
  60178. }, {
  60179. key: "updateHoverShapes",
  60180. value: function updateHoverShapes(shapes) {
  60181. this.painter.updateHoverLayer(shapes);
  60182. return this;
  60183. }
  60184. /**
  60185. * @function SuperMap.LevelRenderer.Render.prototype.getAllShapes
  60186. * @description 获取所有图形。
  60187. * @return {Array.<SuperMap.LevelRenderer.Shape>} 图形数组。
  60188. */
  60189. }, {
  60190. key: "getAllShapes",
  60191. value: function getAllShapes() {
  60192. return this.storage._shapeList;
  60193. }
  60194. /**
  60195. * @function SuperMap.LevelRenderer.Render.prototype.clearAll
  60196. * @description 清除高亮和图形图层。
  60197. * @return {SuperMap.LevelRenderer.Render} this。
  60198. */
  60199. }, {
  60200. key: "clearAll",
  60201. value: function clearAll() {
  60202. this.clear();
  60203. this.painter.clearHover();
  60204. return this;
  60205. }
  60206. /**
  60207. * @function SuperMap.LevelRenderer.Render.prototype.getHoverOne
  60208. * @description 获取单个高亮图形,当前鼠标对应。
  60209. * @return {SuperMap.LevelRenderer.Shape} 高亮图形。
  60210. */
  60211. }, {
  60212. key: "getHoverOne",
  60213. value: function getHoverOne() {
  60214. return this.handler.getLastHoverOne();
  60215. }
  60216. }], [{
  60217. key: "getFrameCallback",
  60218. value: function getFrameCallback(renderInstance) {
  60219. return function () {
  60220. var animatingElements = renderInstance.animatingElements; //animatingElements instanceof Array 临时解决 destory 报错
  60221. if (animatingElements instanceof Array) {
  60222. for (var i = 0, l = animatingElements.length; i < l; i++) {
  60223. renderInstance.storage.mod(animatingElements[i].id);
  60224. }
  60225. if (animatingElements.length || renderInstance._needsRefreshNextFrame) {
  60226. renderInstance.refresh();
  60227. }
  60228. }
  60229. };
  60230. } // SMIC-方法扩展 - end
  60231. }]);
  60232. return Render;
  60233. }();
  60234. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/LevelRenderer.js
  60235. function LevelRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60236. 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); } }
  60237. function LevelRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LevelRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LevelRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  60238. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60239. * This program are made available under the terms of the Apache License, Version 2.0
  60240. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60241. /**
  60242. * @class SuperMap.LevelRenderer
  60243. * @category Visualization Theme
  60244. * @classdesc LevelRenderer 渲染器
  60245. * @private
  60246. */
  60247. var LevelRenderer = /*#__PURE__*/function () {
  60248. /**
  60249. * @function SuperMap.LevelRenderer.constructor
  60250. * @description 构造函数。
  60251. * @example
  60252. * //在渲染器上加上图形
  60253. * var levelRenderer = new SuperMap.LevelRenderer();
  60254. * var zr = levelRenderer.init(document.getElementById('lRendertest'));
  60255. * zr.clear();
  60256. * zr.addShape(new SuperMap.LevelRenderer.Shape.Circle({
  60257. * style:{
  60258. * x : 100,
  60259. * y : 100,
  60260. * r : 50,
  60261. * brushType: 'fill'
  60262. * }
  60263. * }));
  60264. * zr.render();
  60265. */
  60266. function LevelRenderer() {
  60267. LevelRenderer_classCallCheck(this, LevelRenderer);
  60268. /**
  60269. * @member {Object} SuperMap.LevelRenderer.prototype._instances
  60270. * @description LevelRenderer 实例 map 索引
  60271. */
  60272. LevelRenderer._instances = {}; // 工具
  60273. LevelRenderer.Tool = {};
  60274. /**
  60275. * @member {string} SuperMap.LevelRenderer.prototype.version
  60276. * @description 版本。zRender(Baidu)的版本号
  60277. * 记录当前 LevelRenderer 是在 zRender 的那个版本上构建而来。
  60278. * 在每次完整评判和实施由 zRender(Baidu)升级带来的 LevelRenderer 升级后修改。
  60279. */
  60280. this.version = '2.0.4';
  60281. this.CLASS_NAME = "SuperMap.LevelRenderer";
  60282. }
  60283. /**
  60284. * @function SuperMap.LevelRenderer.prototype.destroy
  60285. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为null。
  60286. */
  60287. LevelRenderer_createClass(LevelRenderer, [{
  60288. key: "destroy",
  60289. value: function destroy() {
  60290. this.dispose();
  60291. this.version = null;
  60292. }
  60293. /**
  60294. * @function SuperMap.LevelRenderer.prototype.init
  60295. * @description 创建 LevelRenderer 实例。
  60296. * @param {HTMLElement} dom - 绘图容器。
  60297. * @returns {SuperMap.LevelRenderer} LevelRenderer 实例。
  60298. */
  60299. }, {
  60300. key: "init",
  60301. value: function init(dom) {
  60302. var zr = new Render(Util.createUniqueID("LRenderer_"), dom);
  60303. LevelRenderer._instances[zr.id] = zr;
  60304. return zr;
  60305. }
  60306. /**
  60307. * @function SuperMap.LevelRenderer.prototype.dispose
  60308. * @description LevelRenderer 实例销毁。
  60309. * 可以通过 zrender.dispose(zr) 销毁指定 SuperMap.LevelRenderer.Render 实例。
  60310. * 也可以通过 zr.dispose() 直接销毁
  60311. * @param {SuperMap.LevelRenderer.Render} zr - ZRender对象,不传此参数则销毁全部。
  60312. * @returns {SuperMap.LevelRenderer} this。
  60313. */
  60314. }, {
  60315. key: "dispose",
  60316. value: function dispose(zr) {
  60317. if (zr) {
  60318. zr.dispose();
  60319. this.delInstance(zr.id);
  60320. } else {
  60321. for (var key in LevelRenderer._instances) {
  60322. LevelRenderer._instances[key].dispose();
  60323. }
  60324. LevelRenderer._instances = {};
  60325. }
  60326. return this;
  60327. }
  60328. /**
  60329. * @function SuperMap.LevelRenderer.prototype.getInstance
  60330. * @description 获取 SuperMap.LevelRenderer.Render 实例。
  60331. * @param {string} id - ZRender对象索引。
  60332. * @returns {SuperMap.LevelRenderer.Render} SuperMap.LevelRenderer.Render 实例。
  60333. */
  60334. }, {
  60335. key: "getInstance",
  60336. value: function getInstance(id) {
  60337. return LevelRenderer._instances[id];
  60338. }
  60339. /**
  60340. * @function SuperMap.LevelRenderer.prototype.delInstance
  60341. * @description 删除 zrender 实例,SuperMap.LevelRenderer.Render 实例 dispose 时会调用,删除后 getInstance 则返回 undefined
  60342. * @param {string} id - ZRender对象索引。
  60343. * @param {string} id - SuperMap.LevelRenderer.Render 对象索引。
  60344. * @returns {SuperMap.LevelRenderer} this。
  60345. */
  60346. }, {
  60347. key: "delInstance",
  60348. value: function delInstance(id) {
  60349. delete LevelRenderer._instances[id];
  60350. return this;
  60351. }
  60352. }]);
  60353. return LevelRenderer;
  60354. }();
  60355. SuperMap.LevelRenderer = LevelRenderer;
  60356. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicEllipse.js
  60357. function SmicEllipse_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicEllipse_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicEllipse_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicEllipse_typeof(obj); }
  60358. function SmicEllipse_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60359. 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); } }
  60360. function SmicEllipse_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicEllipse_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicEllipse_defineProperties(Constructor, staticProps); return Constructor; }
  60361. function SmicEllipse_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicEllipse_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicEllipse_get(target, property, receiver || target); }
  60362. function SmicEllipse_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicEllipse_getPrototypeOf(object); if (object === null) break; } return object; }
  60363. 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 } }); if (superClass) SmicEllipse_setPrototypeOf(subClass, superClass); }
  60364. function SmicEllipse_setPrototypeOf(o, p) { SmicEllipse_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicEllipse_setPrototypeOf(o, p); }
  60365. 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); }; }
  60366. function SmicEllipse_possibleConstructorReturn(self, call) { if (call && (SmicEllipse_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicEllipse_assertThisInitialized(self); }
  60367. function SmicEllipse_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60368. function SmicEllipse_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  60369. function SmicEllipse_getPrototypeOf(o) { SmicEllipse_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicEllipse_getPrototypeOf(o); }
  60370. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60371. * This program are made available under the terms of the Apache License, Version 2.0
  60372. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60373. /**
  60374. * @private
  60375. * @class SuperMap.LevelRenderer.Shape.SmicEllipse
  60376. * @category Visualization Theme
  60377. * @classdesc 椭圆。
  60378. * @extends SuperMap.LevelRenderer.Shape
  60379. * @example
  60380. * var shape = new SuperMap.LevelRenderer.Shape.SmicEllipse({
  60381. * style: {
  60382. * x: 100,
  60383. * y: 100,
  60384. * a: 40,
  60385. * b: 20,
  60386. * brushType: 'both',
  60387. * color: 'blue',
  60388. * strokeColor: 'red',
  60389. * lineWidth: 3,
  60390. * text: 'SmicEllipse'
  60391. * }
  60392. * });
  60393. * levelRenderer.addShape(shape);
  60394. *
  60395. *
  60396. */
  60397. var SmicEllipse = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  60398. SmicEllipse_inherits(SmicEllipse, _Shape);
  60399. var _super = SmicEllipse_createSuper(SmicEllipse);
  60400. /**
  60401. * @member {Object} SuperMap.LevelRenderer.Shape.SmicEllipse.style
  60402. * @description 绘制样式。
  60403. *
  60404. * @param {number} style.x - 圆心 x 坐标,必设参数。
  60405. * @param {number} style.y - 圆心 y 坐标,必设参数。
  60406. * @param {number} style.a - 横轴半径,必设参数。
  60407. * @param {number} style.b - 纵轴半径,必设参数。
  60408. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  60409. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  60410. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  60411. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  60412. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  60413. * @param {number} style.opacity - 绘制透明度。默认值:1。
  60414. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  60415. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  60416. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  60417. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  60418. * @param {string} style.text - 图形中的附加文本。默认值:""。
  60419. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  60420. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  60421. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  60422. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  60423. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  60424. */
  60425. //打开接口 style
  60426. /**
  60427. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.constructor
  60428. * @description 构造函数。
  60429. *
  60430. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  60431. *
  60432. */
  60433. function SmicEllipse(options) {
  60434. var _this;
  60435. SmicEllipse_classCallCheck(this, SmicEllipse);
  60436. _this = _super.call(this, options);
  60437. /**
  60438. * @member {string} SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.type
  60439. * @description 图形类型。
  60440. */
  60441. _this.type = 'smicellipse';
  60442. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  60443. _this.refOriginalPosition = [0, 0];
  60444. }
  60445. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicEllipse";
  60446. return _this;
  60447. }
  60448. /**
  60449. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.destroy
  60450. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60451. */
  60452. SmicEllipse_createClass(SmicEllipse, [{
  60453. key: "destroy",
  60454. value: function destroy() {
  60455. this.type = null;
  60456. SmicEllipse_get(SmicEllipse_getPrototypeOf(SmicEllipse.prototype), "destroy", this).call(this);
  60457. }
  60458. /**
  60459. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.buildPath
  60460. * @description 构建椭圆的 Path。
  60461. *
  60462. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  60463. * @param {Object} style - style。
  60464. *
  60465. */
  60466. }, {
  60467. key: "buildPath",
  60468. value: function buildPath(ctx, style) {
  60469. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60470. this.refOriginalPosition = [0, 0];
  60471. }
  60472. var __OP = this.refOriginalPosition;
  60473. var k = 0.5522848;
  60474. var x = style.x + __OP[0];
  60475. var y = style.y + __OP[1];
  60476. var a = style.a;
  60477. var b = style.b;
  60478. var ox = a * k; // 水平控制点偏移量
  60479. var oy = b * k; // 垂直控制点偏移量
  60480. // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线
  60481. ctx.moveTo(x - a, y);
  60482. ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b);
  60483. ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y);
  60484. ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b);
  60485. ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y);
  60486. ctx.closePath();
  60487. }
  60488. /**
  60489. * @function SuperMap.LevelRenderer.Shape.SmicEllipse.prototype.getRect
  60490. * @description 计算返回椭圆包围盒矩形
  60491. *
  60492. * @param {Object} style - style
  60493. * @return {Object} 边框对象。包含属性:x,y,width,height。
  60494. *
  60495. */
  60496. }, {
  60497. key: "getRect",
  60498. value: function getRect(style) {
  60499. if (style.__rect) {
  60500. return style.__rect;
  60501. }
  60502. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60503. this.refOriginalPosition = [0, 0];
  60504. }
  60505. var __OP = this.refOriginalPosition;
  60506. var lineWidth;
  60507. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  60508. lineWidth = style.lineWidth || 1;
  60509. } else {
  60510. lineWidth = 0;
  60511. }
  60512. style.__rect = {
  60513. x: Math.round(style.x + __OP[0] - style.a - lineWidth / 2),
  60514. y: Math.round(style.x + __OP[1] - style.b - lineWidth / 2),
  60515. width: style.a * 2 + lineWidth,
  60516. height: style.b * 2 + lineWidth
  60517. };
  60518. return style.__rect;
  60519. }
  60520. }]);
  60521. return SmicEllipse;
  60522. }(Shape)));
  60523. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicIsogon.js
  60524. function SmicIsogon_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicIsogon_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicIsogon_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicIsogon_typeof(obj); }
  60525. function SmicIsogon_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60526. 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); } }
  60527. function SmicIsogon_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicIsogon_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicIsogon_defineProperties(Constructor, staticProps); return Constructor; }
  60528. function SmicIsogon_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicIsogon_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicIsogon_get(target, property, receiver || target); }
  60529. function SmicIsogon_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicIsogon_getPrototypeOf(object); if (object === null) break; } return object; }
  60530. 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 } }); if (superClass) SmicIsogon_setPrototypeOf(subClass, superClass); }
  60531. function SmicIsogon_setPrototypeOf(o, p) { SmicIsogon_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicIsogon_setPrototypeOf(o, p); }
  60532. 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); }; }
  60533. function SmicIsogon_possibleConstructorReturn(self, call) { if (call && (SmicIsogon_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicIsogon_assertThisInitialized(self); }
  60534. function SmicIsogon_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60535. function SmicIsogon_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  60536. function SmicIsogon_getPrototypeOf(o) { SmicIsogon_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicIsogon_getPrototypeOf(o); }
  60537. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60538. * This program are made available under the terms of the Apache License, Version 2.0
  60539. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60540. /**
  60541. * @private
  60542. * @class SuperMap.LevelRenderer.Shape.SmicIsogon
  60543. * @category Visualization Theme
  60544. * @classdesc 正多边形。
  60545. * @extends SuperMap.LevelRenderer.Shape
  60546. */
  60547. var SmicIsogon = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  60548. SmicIsogon_inherits(SmicIsogon, _Shape);
  60549. var _super = SmicIsogon_createSuper(SmicIsogon);
  60550. /**
  60551. * @member {Object} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.style
  60552. * @description 绘制样式。
  60553. *
  60554. * @param {number} x - 正 n 边形外接圆心 x 坐标,必设参数。
  60555. * @param {number} y - 正 n 边形外接圆心 y 坐标,必设参数。
  60556. * @param {number} r - 正n边形外接圆半径,必设参数。
  60557. * @param {number} n - 指明正几边形,必设参数(n>=3)。
  60558. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  60559. * @param {string} color - 填充颜色。默认值:"#000000'"。
  60560. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  60561. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  60562. * @param {number} lineWidth - 描边宽度。默认值:1。
  60563. * @param {number} opacity - 绘制透明度。默认值:1。
  60564. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  60565. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  60566. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  60567. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  60568. * @param {string} text - 图形中的附加文本。默认值:""。
  60569. * @param {string} textColor -文本颜色。默认值:"#000000'"。
  60570. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  60571. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  60572. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  60573. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  60574. */
  60575. //打开接口 style
  60576. /**
  60577. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.constructor
  60578. * @description 构造函数。
  60579. *
  60580. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  60581. *
  60582. */
  60583. function SmicIsogon(options) {
  60584. var _this;
  60585. SmicIsogon_classCallCheck(this, SmicIsogon);
  60586. _this = _super.call(this, options);
  60587. /**
  60588. * @member {string} SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.type
  60589. * @description 图形类型。
  60590. */
  60591. _this.type = 'smicisogon';
  60592. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  60593. _this.refOriginalPosition = [0, 0];
  60594. }
  60595. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicIsogon";
  60596. return _this;
  60597. }
  60598. /**
  60599. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.destroy
  60600. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60601. */
  60602. SmicIsogon_createClass(SmicIsogon, [{
  60603. key: "destroy",
  60604. value: function destroy() {
  60605. this.type = null;
  60606. SmicIsogon_get(SmicIsogon_getPrototypeOf(SmicIsogon.prototype), "destroy", this).call(this);
  60607. }
  60608. /**
  60609. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.buildPath
  60610. * @description 创建n角星(n>=3)路径。
  60611. *
  60612. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  60613. * @param {Object} style - style。
  60614. *
  60615. */
  60616. }, {
  60617. key: "buildPath",
  60618. value: function buildPath(ctx, style) {
  60619. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60620. this.refOriginalPosition = [0, 0];
  60621. }
  60622. var __OP = this.refOriginalPosition;
  60623. var sin = SUtil.Util_math.sin;
  60624. var cos = SUtil.Util_math.cos;
  60625. var PI = Math.PI;
  60626. var n = style.n;
  60627. if (!n || n < 2) {
  60628. return;
  60629. }
  60630. var x = style.x + __OP[0];
  60631. var y = style.y + __OP[1];
  60632. var r = style.r;
  60633. var dStep = 2 * PI / n;
  60634. var deg = -PI / 2;
  60635. var xStart = x + r * cos(deg);
  60636. var yStart = y + r * sin(deg);
  60637. deg += dStep; // 记录边界点,用于判断insight
  60638. var pointList = style.pointList = [];
  60639. pointList.push([xStart, yStart]);
  60640. for (var i = 0, end = n - 1; i < end; i++) {
  60641. pointList.push([x + r * cos(deg), y + r * sin(deg)]);
  60642. deg += dStep;
  60643. }
  60644. pointList.push([xStart, yStart]); // 绘制
  60645. ctx.moveTo(pointList[0][0], pointList[0][1]);
  60646. for (var _i = 0; _i < pointList.length; _i++) {
  60647. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  60648. }
  60649. ctx.closePath();
  60650. return;
  60651. }
  60652. /**
  60653. * @function SuperMap.LevelRenderer.Shape.SmicIsogon.prototype.getRect
  60654. * @description 计算返回正多边形的包围盒矩形。
  60655. *
  60656. * @param {Object} style - style
  60657. * @return {Object} 边框对象。包含属性:x,y,width,height。
  60658. */
  60659. }, {
  60660. key: "getRect",
  60661. value: function getRect(style) {
  60662. if (style.__rect) {
  60663. return style.__rect;
  60664. }
  60665. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60666. this.refOriginalPosition = [0, 0];
  60667. }
  60668. var __OP = this.refOriginalPosition;
  60669. var lineWidth;
  60670. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  60671. lineWidth = style.lineWidth || 1;
  60672. } else {
  60673. lineWidth = 0;
  60674. }
  60675. style.__rect = {
  60676. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  60677. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  60678. width: style.r * 2 + lineWidth,
  60679. height: style.r * 2 + lineWidth
  60680. };
  60681. return style.__rect;
  60682. }
  60683. }]);
  60684. return SmicIsogon;
  60685. }(Shape)));
  60686. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicRing.js
  60687. function SmicRing_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicRing_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicRing_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicRing_typeof(obj); }
  60688. function SmicRing_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60689. 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); } }
  60690. function SmicRing_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicRing_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicRing_defineProperties(Constructor, staticProps); return Constructor; }
  60691. function SmicRing_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicRing_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicRing_get(target, property, receiver || target); }
  60692. function SmicRing_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicRing_getPrototypeOf(object); if (object === null) break; } return object; }
  60693. 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 } }); if (superClass) SmicRing_setPrototypeOf(subClass, superClass); }
  60694. function SmicRing_setPrototypeOf(o, p) { SmicRing_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicRing_setPrototypeOf(o, p); }
  60695. 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); }; }
  60696. function SmicRing_possibleConstructorReturn(self, call) { if (call && (SmicRing_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicRing_assertThisInitialized(self); }
  60697. function SmicRing_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60698. function SmicRing_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  60699. function SmicRing_getPrototypeOf(o) { SmicRing_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicRing_getPrototypeOf(o); }
  60700. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60701. * This program are made available under the terms of the Apache License, Version 2.0
  60702. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60703. /**
  60704. * @private
  60705. * @class SuperMap.LevelRenderer.Shape.SmicRing
  60706. * @category Visualization Theme
  60707. * @classdesc 圆环。
  60708. * @extends SuperMap.LevelRenderer.Shape
  60709. * @example
  60710. * var shape = new SuperMap.LevelRenderer.Shape.SmicRing({
  60711. * style: {
  60712. * x: 100,
  60713. * y: 100,
  60714. * r0: 30,
  60715. * r: 50
  60716. * }
  60717. * });
  60718. * levelRenderer.addShape(shape);
  60719. *
  60720. */
  60721. var SmicRing = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  60722. SmicRing_inherits(SmicRing, _Shape);
  60723. var _super = SmicRing_createSuper(SmicRing);
  60724. /**
  60725. * @member {Object} SuperMap.LevelRenderer.Shape.SmicRing.prototype.style
  60726. * @description 绘制样式。
  60727. *
  60728. * @param {number} x - 圆心 x 坐标,必设参数。
  60729. * @param {number} y - 圆心 y 坐标,必设参数。
  60730. * @param {number} r - 外圆半径,必设参数。
  60731. * @param {number} r0 - 内圆半径,必设参数。
  60732. * @param {string} brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  60733. * @param {string} color - 填充颜色。默认值:"#000000'"。
  60734. * @param {string} strokeColor - 描边颜色。默认值:"#000000'"。
  60735. * @param {string} lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  60736. * @param {number} lineWidth -描边宽度。默认值:1。
  60737. * @param {number} opacity - 绘制透明度。默认值:1。
  60738. * @param {number} shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  60739. * @param {number} shadowColor - 阴影颜色。默认值:"#000000'"。
  60740. * @param {number} shadowOffsetX - 阴影横向偏移。默认值:0。
  60741. * @param {number} shadowOffsetY - 阴影纵向偏移。默认值:0。
  60742. * @param {string} text -图形中的附加文本。默认值:""。
  60743. * @param {string} textColor - 文本颜色。默认值:"#000000'"。
  60744. * @param {string} textFont - 附加文本样式。示例:'bold 18px verdana'。
  60745. * @param {string} textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  60746. * @param {string} textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  60747. * @param {string} textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  60748. */
  60749. //打开接口 style
  60750. /**
  60751. * @function SuperMap.LevelRenderer.Shape.SmicRing.constructor
  60752. * @description 构造函数。
  60753. *
  60754. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  60755. */
  60756. function SmicRing(options) {
  60757. var _this;
  60758. SmicRing_classCallCheck(this, SmicRing);
  60759. _this = _super.call(this, options);
  60760. /**
  60761. * @member {string} SuperMap.LevelRenderer.Shape.SmicRing.prototype.type
  60762. * @description 图形类型。
  60763. */
  60764. _this.type = 'smicring';
  60765. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  60766. _this.refOriginalPosition = [0, 0];
  60767. }
  60768. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicRing";
  60769. return _this;
  60770. }
  60771. /**
  60772. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.destroy
  60773. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60774. */
  60775. SmicRing_createClass(SmicRing, [{
  60776. key: "destroy",
  60777. value: function destroy() {
  60778. this.type = null;
  60779. SmicRing_get(SmicRing_getPrototypeOf(SmicRing.prototype), "destroy", this).call(this);
  60780. }
  60781. /**
  60782. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.buildPath
  60783. * @description 创建圆环路径。
  60784. *
  60785. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  60786. * @param {Object} style - style。
  60787. *
  60788. */
  60789. }, {
  60790. key: "buildPath",
  60791. value: function buildPath(ctx, style) {
  60792. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60793. this.refOriginalPosition = [0, 0];
  60794. }
  60795. var __OP = this.refOriginalPosition; // 非零环绕填充优化
  60796. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r, 0, Math.PI * 2, false);
  60797. ctx.moveTo(style.x + __OP[0] + style.r0, style.y + __OP[1]);
  60798. ctx.arc(style.x + __OP[0], style.y + __OP[1], style.r0, 0, Math.PI * 2, true);
  60799. return;
  60800. }
  60801. /**
  60802. * @function SuperMap.LevelRenderer.Shape.SmicRing.prototype.getRect
  60803. * @description 计算返回圆环包围盒矩阵
  60804. *
  60805. * @param {Object} style - style
  60806. * @return {Object} 边框对象。包含属性:x,y,width,height。
  60807. */
  60808. }, {
  60809. key: "getRect",
  60810. value: function getRect(style) {
  60811. if (style.__rect) {
  60812. return style.__rect;
  60813. }
  60814. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60815. this.refOriginalPosition = [0, 0];
  60816. }
  60817. var __OP = this.refOriginalPosition;
  60818. var lineWidth;
  60819. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  60820. lineWidth = style.lineWidth || 1;
  60821. } else {
  60822. lineWidth = 0;
  60823. }
  60824. style.__rect = {
  60825. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  60826. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  60827. width: style.r * 2 + lineWidth,
  60828. height: style.r * 2 + lineWidth
  60829. };
  60830. return style.__rect;
  60831. }
  60832. }]);
  60833. return SmicRing;
  60834. }(Shape)));
  60835. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/SmicStar.js
  60836. function SmicStar_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SmicStar_typeof = function _typeof(obj) { return typeof obj; }; } else { SmicStar_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SmicStar_typeof(obj); }
  60837. function SmicStar_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  60838. 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); } }
  60839. function SmicStar_createClass(Constructor, protoProps, staticProps) { if (protoProps) SmicStar_defineProperties(Constructor.prototype, protoProps); if (staticProps) SmicStar_defineProperties(Constructor, staticProps); return Constructor; }
  60840. function SmicStar_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { SmicStar_get = Reflect.get; } 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(receiver); } return desc.value; }; } return SmicStar_get(target, property, receiver || target); }
  60841. function SmicStar_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = SmicStar_getPrototypeOf(object); if (object === null) break; } return object; }
  60842. 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 } }); if (superClass) SmicStar_setPrototypeOf(subClass, superClass); }
  60843. function SmicStar_setPrototypeOf(o, p) { SmicStar_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SmicStar_setPrototypeOf(o, p); }
  60844. 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); }; }
  60845. function SmicStar_possibleConstructorReturn(self, call) { if (call && (SmicStar_typeof(call) === "object" || typeof call === "function")) { return call; } return SmicStar_assertThisInitialized(self); }
  60846. function SmicStar_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  60847. function SmicStar_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  60848. function SmicStar_getPrototypeOf(o) { SmicStar_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SmicStar_getPrototypeOf(o); }
  60849. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  60850. * This program are made available under the terms of the Apache License, Version 2.0
  60851. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  60852. /**
  60853. * @private
  60854. * @class SuperMap.LevelRenderer.Shape.SmicStar
  60855. * @category Visualization Theme
  60856. * @classdesc n 角星(n>3)。
  60857. * @extends SuperMap.LevelRenderer.Shape
  60858. * @example
  60859. * var shape = new SuperMap.LevelRenderer.Shape.SmicStar({
  60860. * style: {
  60861. * x: 200,
  60862. * y: 100,
  60863. * r: 150,
  60864. * n: 5,
  60865. * text: '五角星'
  60866. * }
  60867. * });
  60868. * levelRenderer.addShape(shape);
  60869. *
  60870. *
  60871. */
  60872. var SmicStar = /*#__PURE__*/(/* unused pure expression or super */ null && (function (_Shape) {
  60873. SmicStar_inherits(SmicStar, _Shape);
  60874. var _super = SmicStar_createSuper(SmicStar);
  60875. /**
  60876. * @member {Object} SuperMap.LevelRenderer.Shape.SmicStar.prototype.style
  60877. * @description 绘制样式。
  60878. *
  60879. * @param {number} style.x - n 角星外接圆心 x 坐标,必设参数。
  60880. * @param {number} style.y - n 角星外接圆心 y 坐标,必设参数。
  60881. * @param {number} style.r - n 角星外接圆半径,必设参数。
  60882. * @param {number} style.r0 - n 角星内部顶点(凹点)的外接圆半径。如果不指定此参数,则自动计算:取相隔外部顶点连线的交点作内部顶点。
  60883. * @param {number} style.n -指明几角星,必设参数。
  60884. * @param {string} style.brushType - 画笔类型。可设值:"fill", "stroke", "both"。默认值:"fill"。
  60885. * @param {string} style.color - 填充颜色。默认值:"#000000'"。
  60886. * @param {string} style.strokeColor - 描边颜色。默认值:"#000000'"。
  60887. * @param {string} style.lineCape - 线帽样式。可设值:"butt", "round", "square"。默认值:"butt"。
  60888. * @param {number} style.lineWidth - 描边宽度。默认值:1。
  60889. * @param {number} style.opacity - 绘制透明度。默认值:1。
  60890. * @param {number} style.shadowBlur - 阴影模糊度,大于0有效。默认值:0。
  60891. * @param {number} style.shadowColor - 阴影颜色。默认值:"#000000'"。
  60892. * @param {number} style.shadowOffsetX - 阴影横向偏移。默认值:0。
  60893. * @param {number} style.shadowOffsetY - 阴影纵向偏移。默认值:0。
  60894. * @param {string} style.text - 图形中的附加文本。默认值:""。
  60895. * @param {string} style.textColor - 文本颜色。默认值:"#000000'"。
  60896. * @param {string} style.textFont - 附加文本样式。示例:'bold 18px verdana'。
  60897. * @param {string} style.textPosition - 附加文本位置。可设值:"inside", "left", "right", top", "bottom", "end"。默认值:"end"。
  60898. * @param {string} style.textAlign - 附加文本水平对齐。可设值:"start", "end", "left", "right", "center"。默认根据 textPosition 自动设置。
  60899. * @param {string} style.textBaseline - 附加文本垂直对齐。可设值:"top", "bottom", "middle", "alphabetic", "hanging", "ideographic"。默认根据 textPosition 自动设置。
  60900. */
  60901. //打开接口 style
  60902. /**
  60903. * @function SuperMap.LevelRenderer.Shape.SmicStar.constructor
  60904. * @description 构造函数。
  60905. *
  60906. * @param {Array} options - shape 的配置(options)项,可以是 shape 的自有属性,也可以是自定义的属性。
  60907. *
  60908. */
  60909. function SmicStar(options) {
  60910. var _this;
  60911. SmicStar_classCallCheck(this, SmicStar);
  60912. _this = _super.call(this, options);
  60913. /**
  60914. * @member {string} SuperMap.LevelRenderer.Shape.SmicStar.prototype.type
  60915. * @description 图形类型。
  60916. */
  60917. _this.type = 'smicstar';
  60918. if (!_this.refOriginalPosition || _this.refOriginalPosition.length !== 2) {
  60919. _this.refOriginalPosition = [0, 0];
  60920. }
  60921. _this.CLASS_NAME = "SuperMap.LevelRenderer.Shape.SmicStar";
  60922. return _this;
  60923. }
  60924. /**
  60925. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.destroy
  60926. * @description 销毁对象,释放资源。调用此函数后所有属性将被置为 null。
  60927. */
  60928. SmicStar_createClass(SmicStar, [{
  60929. key: "destroy",
  60930. value: function destroy() {
  60931. this.type = null;
  60932. SmicStar_get(SmicStar_getPrototypeOf(SmicStar.prototype), "destroy", this).call(this);
  60933. }
  60934. /**
  60935. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.buildPath
  60936. * @description 创建n 角星(n>3)路径。
  60937. *
  60938. * @param {CanvasRenderingContext2D} ctx - Context2D 上下文。
  60939. * @param {Object} style - style。
  60940. *
  60941. */
  60942. }, {
  60943. key: "buildPath",
  60944. value: function buildPath(ctx, style) {
  60945. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  60946. this.refOriginalPosition = [0, 0];
  60947. }
  60948. var __OP = this.refOriginalPosition;
  60949. var n = style.n;
  60950. if (!n || n < 2) {
  60951. return;
  60952. }
  60953. var sin = SUtil.Util_math.sin;
  60954. var cos = SUtil.Util_math.cos;
  60955. var PI = Math.PI;
  60956. var x = style.x + __OP[0];
  60957. var y = style.y + __OP[1];
  60958. var r = style.r;
  60959. var r0 = style.r0; // 如果未指定内部顶点外接圆半径,则自动计算
  60960. if (r0 == null) {
  60961. r0 = n > 4 // 相隔的外部顶点的连线的交点,
  60962. // 被取为内部交点,以此计算r0
  60963. ? r * cos(2 * PI / n) / cos(PI / n) // 二三四角星的特殊处理
  60964. : r / 3;
  60965. }
  60966. var dStep = PI / n;
  60967. var deg = -PI / 2;
  60968. var xStart = x + r * cos(deg);
  60969. var yStart = y + r * sin(deg);
  60970. deg += dStep; // 记录边界点,用于判断inside
  60971. var pointList = style.pointList = [];
  60972. pointList.push([xStart, yStart]);
  60973. for (var i = 0, end = n * 2 - 1, ri; i < end; i++) {
  60974. ri = i % 2 === 0 ? r0 : r;
  60975. pointList.push([x + ri * cos(deg), y + ri * sin(deg)]);
  60976. deg += dStep;
  60977. }
  60978. pointList.push([xStart, yStart]); // 绘制
  60979. ctx.moveTo(pointList[0][0], pointList[0][1]);
  60980. for (var _i = 0; _i < pointList.length; _i++) {
  60981. ctx.lineTo(pointList[_i][0], pointList[_i][1]);
  60982. }
  60983. ctx.closePath();
  60984. return;
  60985. }
  60986. /**
  60987. * @function SuperMap.LevelRenderer.Shape.SmicStar.prototype.getRect
  60988. * @description 返回 n 角星包围盒矩形。
  60989. *
  60990. * @param {Object} style - style
  60991. * @return {Object} 边框对象。包含属性:x,y,width,height。
  60992. */
  60993. }, {
  60994. key: "getRect",
  60995. value: function getRect(style) {
  60996. if (style.__rect) {
  60997. return style.__rect;
  60998. }
  60999. if (!this.refOriginalPosition || this.refOriginalPosition.length !== 2) {
  61000. this.refOriginalPosition = [0, 0];
  61001. }
  61002. var __OP = this.refOriginalPosition;
  61003. var lineWidth;
  61004. if (style.brushType == 'stroke' || style.brushType == 'fill') {
  61005. lineWidth = style.lineWidth || 1;
  61006. } else {
  61007. lineWidth = 0;
  61008. }
  61009. style.__rect = {
  61010. x: Math.round(style.x + __OP[0] - style.r - lineWidth / 2),
  61011. y: Math.round(style.y + __OP[1] - style.r - lineWidth / 2),
  61012. width: style.r * 2 + lineWidth,
  61013. height: style.r * 2 + lineWidth
  61014. };
  61015. return style.__rect;
  61016. }
  61017. }]);
  61018. return SmicStar;
  61019. }(Shape)));
  61020. ;// CONCATENATED MODULE: ./src/common/overlay/levelRenderer/index.js
  61021. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61022. * This program are made available under the terms of the Apache License, Version 2.0
  61023. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61024. ;// CONCATENATED MODULE: ./src/common/overlay/index.js
  61025. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61026. * This program are made available under the terms of the Apache License, Version 2.0
  61027. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61028. ;// CONCATENATED MODULE: ./src/common/components/CommonTypes.js
  61029. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61030. * This program are made available under the terms of the Apache License, Version 2.0
  61031. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61032. /**
  61033. * 该文件用于存储一些公用常量
  61034. *
  61035. */
  61036. var CommonTypes_FileTypes = {
  61037. EXCEL: "EXCEL",
  61038. CSV: "CSV",
  61039. ISERVER: "ISERVER",
  61040. GEOJSON: "GEOJSON",
  61041. JSON: 'JSON'
  61042. };
  61043. var CommonTypes_FileConfig = {
  61044. fileMaxSize: 10 * 1024 * 1024
  61045. };
  61046. ;// CONCATENATED MODULE: ./src/common/components/openfile/FileModel.js
  61047. function FileModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61048. 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); } }
  61049. function FileModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileModel_defineProperties(Constructor, staticProps); return Constructor; }
  61050. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61051. * This program are made available under the terms of the Apache License, Version 2.0
  61052. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61053. /**
  61054. * @class SuperMap.FileModel
  61055. * @description 文件数据组件数据模型,用于存储一些文件数据或状态,todo 结构待完善
  61056. * @category Components OpenFile
  61057. * @private
  61058. */
  61059. var FileModel = /*#__PURE__*/(/* unused pure expression or super */ null && (function () {
  61060. function FileModel(options) {
  61061. FileModel_classCallCheck(this, FileModel);
  61062. this.FileTypes = FileTypes;
  61063. this.FileConfig = FileConfig;
  61064. this.loadFileObject = options && options.loadFileObject ? options.loadFileObject : [];
  61065. }
  61066. /**
  61067. * @function SuperMap.FileModel.prototype.set
  61068. * @description 设置属性值
  61069. * @param {string} key - 属性名称
  61070. * @param {string|Object} value - 属性值
  61071. */
  61072. FileModel_createClass(FileModel, [{
  61073. key: "set",
  61074. value: function set(key, value) {
  61075. this[key] = value;
  61076. }
  61077. /**
  61078. * @function SuperMap.FileModel.prototype.get
  61079. * @description 获取数据值
  61080. * @param {string} key - 属性名称
  61081. * @returns {string|Object} value - 返回属性值
  61082. */
  61083. }, {
  61084. key: "get",
  61085. value: function get(key) {
  61086. return this[key];
  61087. }
  61088. }]);
  61089. return FileModel;
  61090. }()));
  61091. ;// CONCATENATED MODULE: ./src/common/components/messagebox/MessageBox.js
  61092. function MessageBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61093. 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); } }
  61094. function MessageBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) MessageBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) MessageBox_defineProperties(Constructor, staticProps); return Constructor; }
  61095. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61096. * This program are made available under the terms of the Apache License, Version 2.0
  61097. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61098. /**
  61099. * @class SuperMap.Components.MessageBox
  61100. * @version 9.1.1
  61101. * @classdesc 组件信息提示框。
  61102. * @category Components Common
  61103. */
  61104. var MessageBox = /*#__PURE__*/function () {
  61105. function MessageBox() {
  61106. MessageBox_classCallCheck(this, MessageBox);
  61107. this._initView();
  61108. }
  61109. MessageBox_createClass(MessageBox, [{
  61110. key: "_initView",
  61111. value: function _initView() {
  61112. //原生js形式
  61113. var messageBoxContainer = document.createElement("div");
  61114. messageBoxContainer.hidden = true;
  61115. messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange"); //图标
  61116. var iconContainer = document.createElement("div");
  61117. iconContainer.setAttribute("class", "icon");
  61118. this.icon = document.createElement("span");
  61119. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  61120. iconContainer.appendChild(this.icon);
  61121. messageBoxContainer.appendChild(iconContainer); //内容:
  61122. var messageBox = document.createElement("div");
  61123. messageBox.setAttribute("class", "component-messagebox");
  61124. messageBox.innerHTML = "";
  61125. messageBoxContainer.appendChild(messageBox);
  61126. this.messageBox = messageBox; //关闭按钮
  61127. var cancelContainer = document.createElement("div");
  61128. cancelContainer.setAttribute("class", "component-messagebox__cancelbtncontainer");
  61129. var cancelBtn = document.createElement("button");
  61130. cancelBtn.setAttribute("class", "component-messagebox__cancelBtn");
  61131. cancelBtn.innerHTML = "x";
  61132. cancelBtn.onclick = this.closeView.bind(this);
  61133. cancelContainer.appendChild(cancelBtn);
  61134. messageBoxContainer.appendChild(cancelContainer);
  61135. this.messageBoxContainer = messageBoxContainer;
  61136. document.body.appendChild(this.messageBoxContainer);
  61137. }
  61138. /**
  61139. * @function SuperMap.Components.MessageBox.prototype.closeView
  61140. * @description 关闭提示框。
  61141. */
  61142. }, {
  61143. key: "closeView",
  61144. value: function closeView() {
  61145. this.messageBoxContainer.hidden = true;
  61146. }
  61147. /**
  61148. * @function SuperMap.Components.MessageBox.prototype.showView
  61149. * @description 显示提示框。
  61150. * @param {string} message - 提示框显示内容。
  61151. * @param {string}[type="warring"] 提示框类型,如 "warring", "failure", "success"。
  61152. */
  61153. }, {
  61154. key: "showView",
  61155. value: function showView(message) {
  61156. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'warring';
  61157. //设置提示框的样式:
  61158. if (type === "success") {
  61159. this.icon.setAttribute("class", "supermapol-icons-message-success");
  61160. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-green");
  61161. } else if (type === "failure") {
  61162. this.icon.setAttribute("class", "supermapol-icons-message-failure");
  61163. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-red");
  61164. } else if (type === "warring") {
  61165. this.icon.setAttribute("class", "supermapol-icons-message-warning");
  61166. this.messageBoxContainer.setAttribute("class", "component-messageboxcontainer component-border-bottom-orange");
  61167. }
  61168. this.messageBox.innerHTML = message;
  61169. this.messageBoxContainer.hidden = false;
  61170. }
  61171. }]);
  61172. return MessageBox;
  61173. }();
  61174. SuperMap.Components.MessageBox = MessageBox;
  61175. ;// CONCATENATED MODULE: external "function(){try{return echarts}catch(e){return {}}}()"
  61176. var external_function_try_return_echarts_catch_e_return_namespaceObject = function(){try{return echarts}catch(e){return {}}}();
  61177. var external_function_try_return_echarts_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_echarts_catch_e_return_namespaceObject);
  61178. ;// CONCATENATED MODULE: ./src/common/lang/Lang.js
  61179. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61180. * This program are made available under the terms of the Apache License, Version 2.0
  61181. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61182. /**
  61183. * @name Lang
  61184. * @memberOf SuperMap
  61185. * @namespace
  61186. * @category BaseTypes
  61187. * @description 国际化的命名空间,包含多种语言和方法库来设置和获取当前的语言。
  61188. */
  61189. var Lang = {
  61190. /**
  61191. * @member {string} SuperMap.Lang.code
  61192. * @description 当前所使用的语言类型。
  61193. */
  61194. code: null,
  61195. /**
  61196. * @member {string} [SuperMap.Lang.defaultCode='en-US']
  61197. * @description 默认使用的语言类型。
  61198. */
  61199. defaultCode: "en-US",
  61200. /**
  61201. * @function SuperMap.Lang.getCode
  61202. * @description 获取当前的语言代码。
  61203. * @returns {string} 当前的语言代码。
  61204. */
  61205. getCode: function getCode() {
  61206. if (!SuperMap.Lang.code) {
  61207. SuperMap.Lang.setCode();
  61208. }
  61209. return SuperMap.Lang.code;
  61210. },
  61211. /**
  61212. * @function SuperMap.Lang.setCode
  61213. * @description 设置语言代码。
  61214. * @param {string} code - 此参数遵循IETF规范。
  61215. */
  61216. setCode: function setCode() {
  61217. var lang = this.getLanguageFromCookie();
  61218. if (lang) {
  61219. SuperMap.Lang.code = lang;
  61220. return;
  61221. }
  61222. lang = SuperMap.Lang.defaultCode;
  61223. if (navigator.appName === 'Netscape') {
  61224. lang = navigator.language;
  61225. } else {
  61226. lang = navigator.browserLanguage;
  61227. }
  61228. if (lang.indexOf('zh') === 0) {
  61229. lang = 'zh-CN';
  61230. }
  61231. if (lang.indexOf('en') === 0) {
  61232. lang = 'en-US';
  61233. }
  61234. SuperMap.Lang.code = lang;
  61235. },
  61236. /**
  61237. * @function SuperMap.Lang.getLanguageFromCookie
  61238. * @description 从 cookie 中获取语言类型。
  61239. */
  61240. getLanguageFromCookie: function getLanguageFromCookie() {
  61241. var name = 'language=';
  61242. var ca = document.cookie.split(';');
  61243. for (var i = 0; i < ca.length; i++) {
  61244. var c = ca[i];
  61245. while (c.charAt(0) === ' ') {
  61246. c = c.substring(1);
  61247. }
  61248. if (c.indexOf(name) !== -1) {
  61249. return c.substring(name.length, c.length);
  61250. }
  61251. }
  61252. return "";
  61253. },
  61254. /**
  61255. * @function SuperMap.Lang.i18n
  61256. * @description 从当前语言字符串的字典查找 key。
  61257. * @param {string} key - 字典中 i18n 字符串值的关键字。
  61258. * @returns {string} 国际化的字符串。
  61259. */
  61260. i18n: function i18n(key) {
  61261. var dictionary = SuperMap.Lang[SuperMap.Lang.getCode()];
  61262. var message = dictionary && dictionary[key];
  61263. if (!message) {
  61264. // Message not found, fall back to message key
  61265. message = key;
  61266. }
  61267. return message;
  61268. }
  61269. };
  61270. SuperMap.Lang = Lang;
  61271. SuperMap.i18n = SuperMap.Lang.i18n;
  61272. ;// CONCATENATED MODULE: external "function(){try{return XLSX}catch(e){return {}}}()"
  61273. var external_function_try_return_XLSX_catch_e_return_namespaceObject = function(){try{return XLSX}catch(e){return {}}}();
  61274. var external_function_try_return_XLSX_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_XLSX_catch_e_return_namespaceObject);
  61275. ;// CONCATENATED MODULE: ./src/common/components/util/FileReaderUtil.js
  61276. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61277. * This program are made available under the terms of the Apache License, Version 2.0
  61278. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61279. /**
  61280. * @class SuperMap.Components.FileReaderUtil
  61281. * @classdesc 组件读取文件工具类。
  61282. * @version 9.1.1
  61283. * @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(*, *=))}}
  61284. */
  61285. var FileReaderUtil = {
  61286. rABS: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsBinaryString,
  61287. rABF: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsArrayBuffer,
  61288. rAT: typeof FileReader !== 'undefined' && FileReader.prototype && FileReader.prototype.readAsText,
  61289. /**
  61290. * @function SuperMap.Components.FileReaderUtil.prototype.readFile
  61291. * @description 读取文件
  61292. * @param {string} fileType - 当前读取的文件类型
  61293. *
  61294. * @param {Object} file - 读取回来的文件内容对象
  61295. * @param {function} success - 读取文件成功回调函数
  61296. * @param {function} failed - 读取文件失败回调函数
  61297. * @param {Object} context - 回调重定向对象
  61298. */
  61299. readFile: function readFile(fileType, file, success, failed, context) {
  61300. if (CommonTypes_FileTypes.JSON === fileType || CommonTypes_FileTypes.GEOJSON === fileType) {
  61301. this.readTextFile(file, success, failed, context);
  61302. } else if (CommonTypes_FileTypes.EXCEL === fileType || CommonTypes_FileTypes.CSV === fileType) {
  61303. this.readXLSXFile(file, success, failed, context);
  61304. }
  61305. },
  61306. /**
  61307. * 读取文本文件
  61308. * @param file
  61309. * @param success
  61310. * @param failed
  61311. * @param {Object} context - 回调重定向对象
  61312. */
  61313. readTextFile: function readTextFile(file, success, failed, context) {
  61314. var reader = new FileReader();
  61315. reader.onloadend = function (evt) {
  61316. success && success.call(context, evt.target.result);
  61317. };
  61318. reader.onerror = function (error) {
  61319. failed && failed.call(context, error);
  61320. };
  61321. this.rAT ? reader.readAsText(file.file, 'utf-8') : reader.readAsBinaryString(file.file);
  61322. },
  61323. /**
  61324. * 读取excel或csv文件
  61325. * @param file
  61326. * @param success
  61327. * @param failed
  61328. * @param {Object} context - 回调重定向对象
  61329. */
  61330. readXLSXFile: function readXLSXFile(file, success, failed, context) {
  61331. var reader = new FileReader();
  61332. reader.onloadend = function (evt) {
  61333. var xLSXData = new Uint8Array(evt.target.result);
  61334. var workbook = external_function_try_return_XLSX_catch_e_return_default().read(xLSXData, {
  61335. type: "array"
  61336. });
  61337. try {
  61338. if (workbook && workbook.SheetNames && workbook.SheetNames.length > 0) {
  61339. //暂时只读取第一个sheets的内容
  61340. var sheetName = workbook.SheetNames[0];
  61341. var xLSXCSVString = external_function_try_return_XLSX_catch_e_return_default().utils.sheet_to_csv(workbook.Sheets[sheetName]);
  61342. success && success.call(context, xLSXCSVString);
  61343. }
  61344. } catch (error) {
  61345. failed && failed.call(context, error);
  61346. }
  61347. };
  61348. reader.onerror = function (error) {
  61349. failed && failed.call(context, error);
  61350. };
  61351. this.rABF && reader.readAsArrayBuffer(file.file);
  61352. },
  61353. /**
  61354. * @function SuperMap.Components.FileReaderUtil.prototype.processDataToGeoJson
  61355. * @description 将读取回来得数据统一处理为 GeoJSON 格式
  61356. * @param {string} type - 文件类型
  61357. * @param {Object} data - 读取返回的数据对象
  61358. * @param {function} success - 数据处理成功的回调
  61359. * @param {function} failed - 数据处理失败的回调
  61360. * @param {Object} context - 回调重定向对象
  61361. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  61362. * @private
  61363. */
  61364. processDataToGeoJson: function processDataToGeoJson(type, data, success, failed, context) {
  61365. var geojson = null;
  61366. if (type === "EXCEL" || type === "CSV") {
  61367. geojson = this.processExcelDataToGeoJson(data);
  61368. success && success.call(context, geojson);
  61369. } else if (type === 'JSON' || type === 'GEOJSON') {
  61370. var result = data; //geojson、json未知,通过类容来判断
  61371. if (typeof result === "string") {
  61372. result = JSON.parse(result);
  61373. }
  61374. if (result.type === 'ISERVER') {
  61375. geojson = result.data.recordsets[0].features;
  61376. } else if (result.type === 'FeatureCollection') {
  61377. //geojson
  61378. geojson = result;
  61379. } else {
  61380. //不支持数据
  61381. failed && failed.call(context, Lang.i18n('msg_dataInWrongGeoJSONFormat'));
  61382. }
  61383. success && success.call(context, geojson);
  61384. } else {
  61385. failed && failed.call(context, Lang.i18n('msg_dataInWrongFormat'));
  61386. }
  61387. },
  61388. /**
  61389. * @function SuperMap.Components.FileReaderUtil.prototype.processExcelDataToGeoJson
  61390. * @description 表格文件数据处理
  61391. * @param {Object} data - 读取的表格文件数据
  61392. * @returns {GeoJSONObject} 返回标准 GeoJSON 规范格式数据
  61393. * @private
  61394. */
  61395. processExcelDataToGeoJson: function processExcelDataToGeoJson(data) {
  61396. //处理为对象格式转化
  61397. var dataContent = this.string2Csv(data);
  61398. var fieldCaptions = dataContent.colTitles; //位置属性处理
  61399. var xfieldIndex = -1,
  61400. yfieldIndex = -1;
  61401. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  61402. if (this.isXField(fieldCaptions[i])) {
  61403. xfieldIndex = i;
  61404. }
  61405. if (this.isYField(fieldCaptions[i])) {
  61406. yfieldIndex = i;
  61407. }
  61408. } // feature 构建后期支持坐标系 4326/3857
  61409. var features = [];
  61410. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  61411. var row = dataContent.rows[_i]; //if (featureFrom === "LonLat") {
  61412. var x = Number(row[xfieldIndex]),
  61413. y = Number(row[yfieldIndex]); //属性信息
  61414. var attributes = {};
  61415. for (var index in dataContent.colTitles) {
  61416. var key = dataContent.colTitles[index];
  61417. attributes[key] = dataContent.rows[_i][index];
  61418. } //目前csv 只支持处理点,所以先生成点类型的 geojson
  61419. var feature = {
  61420. "type": "Feature",
  61421. "geometry": {
  61422. "type": "Point",
  61423. "coordinates": [x, y]
  61424. },
  61425. "properties": attributes
  61426. };
  61427. features.push(feature);
  61428. }
  61429. return features;
  61430. },
  61431. /**
  61432. * 判断是否地理X坐标
  61433. * @param data
  61434. */
  61435. isXField: function isXField(data) {
  61436. var lowerdata = data.toLowerCase();
  61437. return lowerdata === "x" || lowerdata === "smx" || lowerdata === "jd" || lowerdata === "经度" || lowerdata === "东经" || lowerdata === "longitude" || lowerdata === "lot" || lowerdata === "lon" || lowerdata === "lng" || lowerdata === "x坐标";
  61438. },
  61439. /**
  61440. * 判断是否地理Y坐标
  61441. * @param data
  61442. */
  61443. isYField: function isYField(data) {
  61444. var lowerdata = data.toLowerCase();
  61445. return lowerdata === "y" || lowerdata === "smy" || lowerdata === "wd" || lowerdata === "纬度" || lowerdata === "北纬" || lowerdata === "latitude" || lowerdata === "lat" || lowerdata === "y坐标";
  61446. },
  61447. /**
  61448. * 字符串转为dataEditor 支持的csv格式数据
  61449. * @param string
  61450. * @param withoutTitle
  61451. */
  61452. string2Csv: function string2Csv(string, withoutTitle) {
  61453. // let rows = string.split('\r\n');
  61454. var rows = string.split('\n');
  61455. var result = {};
  61456. if (!withoutTitle) {
  61457. result["colTitles"] = rows[0].split(',');
  61458. } else {
  61459. result["colTitles"] = [];
  61460. }
  61461. result['rows'] = [];
  61462. for (var i = withoutTitle ? 0 : 1; i < rows.length; i++) {
  61463. rows[i] && result['rows'].push(rows[i].split(','));
  61464. }
  61465. return result;
  61466. }
  61467. };
  61468. SuperMap.Components.FileReaderUtil = FileReaderUtil;
  61469. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartModel.js
  61470. function ChartModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61471. 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); } }
  61472. function ChartModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartModel_defineProperties(Constructor, staticProps); return Constructor; }
  61473. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  61474. * This program are made available under the terms of the Apache License, Version 2.0
  61475. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  61476. /**
  61477. * @class SuperMap.Components.ChartModel
  61478. * @classdesc 图表组件数据模型
  61479. * @private
  61480. * @param {Object} datasets - 数据来源。
  61481. * @category Components Chart
  61482. * @fires SuperMap.Components.ChartModel#getdatafailed
  61483. */
  61484. var ChartModel = /*#__PURE__*/function () {
  61485. function ChartModel(datasets) {
  61486. ChartModel_classCallCheck(this, ChartModel);
  61487. this.datasets = datasets;
  61488. this.EVENT_TYPES = ['getdatafailed'];
  61489. this.events = new Events(this, null, this.EVENT_TYPES);
  61490. }
  61491. /**
  61492. * @private
  61493. * @function SuperMap.Components.ChartModel.prototype.getDatasetInfo
  61494. * @description 获得数据集数据。
  61495. * @param {string} datasetUrl - 数据集资源地址。
  61496. */
  61497. ChartModel_createClass(ChartModel, [{
  61498. key: "getDatasetInfo",
  61499. value: function getDatasetInfo(success) {
  61500. var datasetUrl = this.datasets.url;
  61501. var me = this;
  61502. FetchRequest.get(datasetUrl).then(function (response) {
  61503. return response.json();
  61504. }).then(function (results) {
  61505. if (results.datasetInfo) {
  61506. var datasetInfo = results.datasetInfo;
  61507. me.datasetsInfo = {
  61508. dataSourceName: datasetInfo.dataSourceName,
  61509. datasetName: datasetInfo.name,
  61510. mapName: results.name
  61511. };
  61512. success({
  61513. result: me.datasetsInfo
  61514. });
  61515. }
  61516. })["catch"](function (error) {
  61517. console.log(error);
  61518. me._fireFailedEvent(error);
  61519. });
  61520. }
  61521. /**
  61522. * @private
  61523. * @function SuperMap.Components.ChartModel.prototype.getDataFeatures
  61524. * @description 请求数据集的数据信息
  61525. * @param {Object} results - 数据集信息。
  61526. * @param {function} success - 成功回调函数。
  61527. */
  61528. }, {
  61529. key: "getDataFeatures",
  61530. value: function getDataFeatures(results, success) {
  61531. var datasetsInfo = results.result;
  61532. var getFeatureParam, getFeatureBySQLParams, getFeatureBySQLService;
  61533. var params = {
  61534. name: datasetsInfo.datasetName + '@' + datasetsInfo.dataSourceName
  61535. };
  61536. Object.assign(params, this.datasets.queryInfo);
  61537. getFeatureParam = new SuperMap.FilterParameter(params);
  61538. getFeatureBySQLParams = new SuperMap.GetFeaturesBySQLParameters({
  61539. queryParameter: getFeatureParam,
  61540. datasetNames: [datasetsInfo.dataSourceName + ':' + datasetsInfo.datasetName],
  61541. fromIndex: 0,
  61542. toIndex: 100000
  61543. });
  61544. getFeatureBySQLService = new SuperMap.GetFeaturesBySQLService(datasetsInfo.dataUrl, {
  61545. eventListeners: {
  61546. processCompleted: success,
  61547. processFailed: function processFailed() {}
  61548. }
  61549. });
  61550. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  61551. }
  61552. /**
  61553. * @private
  61554. * @function SuperMap.Components.ChartModel.prototype.getLayerFeatures
  61555. * @description 请求图层要素的数据信息
  61556. * @param {Object} results - 数据集信息。
  61557. * @param {Callbacks} success - 成功回调函数。
  61558. */
  61559. }, {
  61560. key: "getLayerFeatures",
  61561. value: function getLayerFeatures(results, success) {
  61562. var datasetsInfo = results.result;
  61563. var queryParam, queryBySQLParams, queryBySQLService;
  61564. var params = {
  61565. name: datasetsInfo.mapName
  61566. };
  61567. Object.assign(params, this.datasets.queryInfo);
  61568. queryParam = new SuperMap.FilterParameter(params);
  61569. queryBySQLParams = new SuperMap.QueryBySQLParameters({
  61570. queryParams: [queryParam],
  61571. expectCount: 100000
  61572. });
  61573. queryBySQLService = new SuperMap.QueryBySQLService(datasetsInfo.dataUrl, {
  61574. eventListeners: {
  61575. processCompleted: success,
  61576. processFailed: function processFailed() {}
  61577. }
  61578. });
  61579. queryBySQLService.processAsync(queryBySQLParams);
  61580. }
  61581. /**
  61582. * @private
  61583. * @function SuperMap.Components.ChartModel.prototype.getDataInfoByIptl
  61584. * @description 用dataId获取iportal的数据。
  61585. * @param {Callbacks} success - getdatachart。
  61586. *
  61587. */
  61588. }, {
  61589. key: "getDataInfoByIptl",
  61590. value: function getDataInfoByIptl(success) {
  61591. // success是chart的回调
  61592. this.getServiceInfo(this.datasets.url, success);
  61593. }
  61594. /**
  61595. * @private
  61596. * @function SuperMap.Components.ChartModel.prototype.getServiceInfo
  61597. * @description 用iportal获取dataItemServices。
  61598. * @param {String} url
  61599. * @param {Callbacks} success - getdatachart。
  61600. * */
  61601. }, {
  61602. key: "getServiceInfo",
  61603. value: function getServiceInfo(url, success) {
  61604. var me = this;
  61605. FetchRequest.get(url, null, {
  61606. withCredentials: this.datasets.withCredentials
  61607. }).then(function (response) {
  61608. return response.json();
  61609. }).then(function (data) {
  61610. if (data.succeed === false) {
  61611. //请求失败
  61612. me._fireFailedEvent(data);
  61613. return;
  61614. } // 是否有rest服务
  61615. if (data.dataItemServices && data.dataItemServices.length > 0) {
  61616. var dataItemServices = data.dataItemServices,
  61617. resultData;
  61618. dataItemServices.forEach(function (item) {
  61619. // 如果有restdata并且发布成功,就请求restdata服务
  61620. // 如果有restmap并且发布成功,就请求restmap服务
  61621. // 其他情况就请求iportal/content.json
  61622. if (item.serviceType === 'RESTDATA' && item.serviceStatus === 'PUBLISHED') {
  61623. resultData = item;
  61624. } else if (item.serviceType === 'RESTMAP' && item.serviceStatus === 'PUBLISHED') {
  61625. resultData = item;
  61626. } else {
  61627. me.getDatafromContent(url, success);
  61628. return;
  61629. }
  61630. }); // 如果有服务,获取数据源和数据集, 然后请求rest服务
  61631. resultData && me.getDatafromRest(resultData.serviceType, resultData.address, success);
  61632. } else {
  61633. me.getDatafromContent(url, success);
  61634. return;
  61635. }
  61636. })["catch"](function (error) {
  61637. console.log(error);
  61638. me._fireFailedEvent(error);
  61639. });
  61640. }
  61641. /**
  61642. * @private
  61643. * @function SuperMap.Components.ChartModel.prototype.getDatafromURL
  61644. * @description 用iportal获取数据。(通过固定的url来请求,但是不能请求工作空间的数据)
  61645. * @param {String} url
  61646. * @param {Callbacks} success - getdatachart。
  61647. */
  61648. }, {
  61649. key: "getDatafromContent",
  61650. value: function getDatafromContent(url, success) {
  61651. var _this = this;
  61652. // 成功回调传入的results
  61653. var results = {
  61654. result: {}
  61655. },
  61656. me = this;
  61657. url += '/content.json?pageSize=9999999&currentPage=1'; // 获取图层数据
  61658. FetchRequest.get(url, null, {
  61659. withCredentials: this.datasets.withCredentials
  61660. }).then(function (response) {
  61661. return response.json();
  61662. }).then(function (data) {
  61663. if (data.succeed === false) {
  61664. //请求失败
  61665. me._fireFailedEvent(data);
  61666. return;
  61667. }
  61668. if (data.type) {
  61669. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  61670. // 将字符串转换成json
  61671. data.content = JSON.parse(data.content.trim()); // 如果是json文件 data.content = {type:'fco', features},格式不固定
  61672. if (!data.content.features) {
  61673. //json格式解析失败
  61674. console.log(Lang.i18n('msg_jsonResolveFiled'));
  61675. return;
  61676. }
  61677. var features = _this._formatGeoJSON(data.content);
  61678. results.result.features = {
  61679. type: data.content.type,
  61680. features: features
  61681. };
  61682. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  61683. var _features = _this._excelData2Feature(data.content);
  61684. results.result.features = {
  61685. type: 'FeatureCollection',
  61686. features: _features
  61687. };
  61688. }
  61689. success(results, 'content');
  61690. }
  61691. }, this)["catch"](function (error) {
  61692. console.log(error);
  61693. me._fireFailedEvent(error);
  61694. });
  61695. }
  61696. /**
  61697. * @private
  61698. * @function SuperMap.Components.ChartModel.prototype._getDataSource
  61699. * @description 获取数据源名和数据集名。
  61700. * @param {string} serviceType 服务类型
  61701. * @param {string} address 地址
  61702. * @param {Callbacks} success - getdatachart。
  61703. * @return{array} [数据源名:数据集名]
  61704. * @return{string} 图层名
  61705. */
  61706. }, {
  61707. key: "getDatafromRest",
  61708. value: function getDatafromRest(serviceType, address, success) {
  61709. var me = this,
  61710. withCredentials = this.datasets.withCredentials;
  61711. if (serviceType === 'RESTDATA') {
  61712. var url = "".concat(address, "/data/datasources"),
  61713. sourceName,
  61714. datasetName; // 请求获取数据源名
  61715. FetchRequest.get(url, null, {
  61716. withCredentials: withCredentials
  61717. }).then(function (response) {
  61718. return response.json();
  61719. }).then(function (data) {
  61720. sourceName = data.datasourceNames[0];
  61721. url = "".concat(address, "/data/datasources/").concat(sourceName, "/datasets"); // 请求获取数据集名
  61722. FetchRequest.get(url, null, {
  61723. withCredentials: withCredentials
  61724. }).then(function (response) {
  61725. return response.json();
  61726. }).then(function (data) {
  61727. datasetName = data.datasetNames[0]; // 请求restdata服务
  61728. me.getDatafromRestData("".concat(address, "/data"), [sourceName + ':' + datasetName], success);
  61729. return [sourceName + ':' + datasetName];
  61730. })["catch"](function (error) {
  61731. me._fireFailedEvent(error);
  61732. });
  61733. })["catch"](function (error) {
  61734. me._fireFailedEvent(error);
  61735. });
  61736. } else {
  61737. // 如果是地图服务
  61738. var _url = "".concat(address, "/maps"),
  61739. mapName,
  61740. layerName,
  61741. path; // 请求获取地图名
  61742. FetchRequest.get(_url, null, {
  61743. withCredentials: withCredentials
  61744. }).then(function (response) {
  61745. return response.json();
  61746. }).then(function (data) {
  61747. mapName = data[0].name;
  61748. path = data[0].path;
  61749. _url = _url = "".concat(address, "/maps/").concat(mapName, "/layers"); // 请求获取图层名
  61750. FetchRequest.get(_url, null, {
  61751. withCredentials: withCredentials
  61752. }).then(function (response) {
  61753. return response.json();
  61754. }).then(function (data) {
  61755. layerName = data[0].subLayers.layers[0].caption; // 请求restmap服务
  61756. me.getDatafromRestMap(layerName, path, success);
  61757. return layerName;
  61758. })["catch"](function (error) {
  61759. me._fireFailedEvent(error);
  61760. });
  61761. })["catch"](function (error) {
  61762. me._fireFailedEvent(error);
  61763. });
  61764. }
  61765. }
  61766. /**
  61767. * @private
  61768. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestData
  61769. * @description 请求restdata服务
  61770. * @param {String} url
  61771. * @param {Array<string>} dataSource [数据源名:数据集名]
  61772. * @param {Callbacks} success - getdatachart。
  61773. */
  61774. }, {
  61775. key: "getDatafromRestData",
  61776. value: function getDatafromRestData(url, dataSource, success) {
  61777. var me = this;
  61778. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'SmID>0';
  61779. this._getFeatureBySQL(url, dataSource, this.datasets.queryInfo, function (results) {
  61780. // 此时的features已经处理成geojson了
  61781. success(results, 'RESTDATA');
  61782. }, function (error) {
  61783. console.log(error);
  61784. me._fireFailedEvent(error);
  61785. });
  61786. }
  61787. /**
  61788. * @private
  61789. * @function SuperMap.Components.ChartModel.prototype.getDatafromRestMap
  61790. * @description 请求restmap服务
  61791. * @param {String} dataSource layerName
  61792. * @param {String} path - map服务地址。
  61793. * @param {Callbacks} success - getdatachart。
  61794. */
  61795. }, {
  61796. key: "getDatafromRestMap",
  61797. value: function getDatafromRestMap(dataSource, path, success) {
  61798. var me = this;
  61799. this.datasets.queryInfo.attributeFilter = this.datasets.queryInfo.attributeFilter || 'smid=1';
  61800. this._queryFeatureBySQL(path, dataSource, this.datasets.queryInfo, null, null, function (results) {
  61801. // let features = result.result.recordsets[0].features;
  61802. success(results, 'RESTMAP');
  61803. }, function (error) {
  61804. console.log(error);
  61805. me._fireFailedEvent(error);
  61806. });
  61807. }
  61808. /**
  61809. * @private
  61810. * @function SuperMap.Components.ChartModel.prototype._getFeatureBySQL
  61811. * @description 通过 sql 方式查询数据。
  61812. */
  61813. }, {
  61814. key: "_getFeatureBySQL",
  61815. value: function _getFeatureBySQL(url, datasetNames, queryInfo, _processCompleted, processFaild) {
  61816. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  61817. var params = {
  61818. name: datasetNames.join().replace(':', '@')
  61819. };
  61820. Object.assign(params, queryInfo);
  61821. getFeatureParam = new FilterParameter(params);
  61822. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  61823. queryParameter: getFeatureParam,
  61824. datasetNames: datasetNames,
  61825. fromIndex: 0,
  61826. toIndex: 100000,
  61827. returnContent: true
  61828. });
  61829. var options = {
  61830. eventListeners: {
  61831. processCompleted: function processCompleted(getFeaturesEventArgs) {
  61832. _processCompleted && _processCompleted(getFeaturesEventArgs);
  61833. },
  61834. processFailed: function processFailed(e) {
  61835. processFaild && processFaild(e);
  61836. }
  61837. }
  61838. };
  61839. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  61840. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  61841. }
  61842. /**
  61843. * @private
  61844. * @function SuperMap.Components.ChartModel.prototype._queryFeatureBySQL
  61845. * @description 通过 sql 方式查询数据。
  61846. */
  61847. }, {
  61848. key: "_queryFeatureBySQL",
  61849. value: function _queryFeatureBySQL(url, layerName, queryInfo, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  61850. var queryParam, queryBySQLParams;
  61851. var filterParams = {
  61852. name: layerName
  61853. };
  61854. Object.assign(filterParams, queryInfo);
  61855. queryParam = new FilterParameter(filterParams);
  61856. if (fields) {
  61857. queryParam.fields = fields;
  61858. }
  61859. var params = {
  61860. queryParams: [queryParam]
  61861. };
  61862. if (onlyAttribute) {
  61863. params.queryOption = QueryOption.ATTRIBUTE;
  61864. }
  61865. startRecord && (params.startRecord = startRecord);
  61866. recordLength && (params.expectCount = recordLength);
  61867. if (epsgCode) {
  61868. params.prjCoordSys = {
  61869. epsgCode: epsgCode
  61870. };
  61871. }
  61872. queryBySQLParams = new QueryBySQLParameters(params);
  61873. this._queryBySQL(url, queryBySQLParams, function (data) {
  61874. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  61875. });
  61876. }
  61877. /**
  61878. * @function SuperMap.Components.ChartModel.prototype._queryBySQL
  61879. * @description SQL 查询服务。
  61880. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  61881. * @param {RequestCallback} callback - 回调函数。
  61882. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  61883. */
  61884. }, {
  61885. key: "_queryBySQL",
  61886. value: function _queryBySQL(url, params, callback, resultFormat) {
  61887. var me = this;
  61888. var queryBySQLService = new QueryBySQLService(url, {
  61889. eventListeners: {
  61890. scope: me,
  61891. processCompleted: callback,
  61892. processFailed: callback
  61893. },
  61894. format: me._processFormat(resultFormat)
  61895. });
  61896. queryBySQLService.processAsync(params);
  61897. }
  61898. /**
  61899. * @function SuperMap.Components.ChartModel.prototype._processFormat
  61900. * @description 将数据转换成geojson。
  61901. * @param {object} resultFormat - 返回结果集。
  61902. * @return {object} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  61903. */
  61904. }, {
  61905. key: "_processFormat",
  61906. value: function _processFormat(resultFormat) {
  61907. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  61908. }
  61909. /**
  61910. * @private
  61911. * @function SuperMap.Components.ChartModel.prototype._formatGeoJSON
  61912. * @description 格式 GeoJSON。
  61913. * @param {GeoJSON} data - GeoJSON 数据。
  61914. */
  61915. }, {
  61916. key: "_formatGeoJSON",
  61917. value: function _formatGeoJSON(data) {
  61918. var features = data.features;
  61919. features.forEach(function (row, index) {
  61920. row.properties['index'] = index;
  61921. });
  61922. return features;
  61923. }
  61924. /**
  61925. * @private
  61926. * @description 将 csv 和 xls 文件内容转换成 geojson
  61927. * @function SuperMap.Components.ChartModel.prototype._excelData2Feature
  61928. * @param content 文件内容
  61929. * @param layerInfo 图层信息
  61930. * @returns {Array} feature的数组集合
  61931. */
  61932. }, {
  61933. key: "_excelData2Feature",
  61934. value: function _excelData2Feature(dataContent) {
  61935. var fieldCaptions = dataContent.colTitles; //位置属性处理
  61936. var xfieldIndex = -1,
  61937. yfieldIndex = -1;
  61938. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  61939. if (FileReaderUtil.isXField(fieldCaptions[i])) {
  61940. xfieldIndex = i;
  61941. }
  61942. if (FileReaderUtil.isYField(fieldCaptions[i])) {
  61943. yfieldIndex = i;
  61944. }
  61945. } // feature 构建后期支持坐标系 4326/3857
  61946. var features = [];
  61947. for (var _i = 0, _len = dataContent.rows.length; _i < _len; _i++) {
  61948. var row = dataContent.rows[_i];
  61949. var x = Number(row[xfieldIndex]),
  61950. y = Number(row[yfieldIndex]); //属性信息
  61951. var attributes = {};
  61952. for (var index in dataContent.colTitles) {
  61953. var key = dataContent.colTitles[index];
  61954. attributes[key] = dataContent.rows[_i][index];
  61955. }
  61956. attributes['index'] = _i + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
  61957. var feature = {
  61958. type: 'Feature',
  61959. geometry: {
  61960. type: 'Point',
  61961. coordinates: [x, y]
  61962. },
  61963. properties: attributes
  61964. };
  61965. features.push(feature);
  61966. }
  61967. return features;
  61968. }
  61969. /**
  61970. * @private
  61971. * @description 请求数据失败的事件
  61972. * @function SuperMap.Components.ChartModel.prototype._fireFailedEvent
  61973. * @param {object} error 错误信息
  61974. */
  61975. }, {
  61976. key: "_fireFailedEvent",
  61977. value: function _fireFailedEvent(error) {
  61978. var errorData = error ? {
  61979. error: error,
  61980. message: Lang.i18n('msg_getdatafailed')
  61981. } : {
  61982. message: Lang.i18n('msg_getdatafailed')
  61983. };
  61984. /**
  61985. * @event SuperMap.Components.Chart#getdatafailed
  61986. * @description 监听到获取数据失败事件后触发
  61987. * @property {Object} error - 事件对象。
  61988. */
  61989. this.events.triggerEvent('getdatafailed', errorData);
  61990. }
  61991. }]);
  61992. return ChartModel;
  61993. }();
  61994. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartViewModel.js
  61995. function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _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 = o[Symbol.iterator](); }, 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; } } }; }
  61996. 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); }
  61997. 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; }
  61998. function ChartViewModel_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  61999. 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); } }
  62000. function ChartViewModel_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartViewModel_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartViewModel_defineProperties(Constructor, staticProps); return Constructor; }
  62001. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62002. * This program are made available under the terms of the Apache License, Version 2.0
  62003. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62004. /**
  62005. * @class SuperMap.Components.ChartViewModel
  62006. * @classdesc 图表组件功能类
  62007. * @category Components Chart
  62008. * @version 10.0.0
  62009. * @param {Object} options - 可选参数。
  62010. * @param {string} options.type - 图表类型。
  62011. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源。
  62012. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  62013. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  62014. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  62015. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  62016. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  62017. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  62018. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  62019. * @fires SuperMap.Components.ChartViewModel#getdatafailed
  62020. */
  62021. var ChartViewModel = /*#__PURE__*/function () {
  62022. function ChartViewModel(options) {
  62023. ChartViewModel_classCallCheck(this, ChartViewModel);
  62024. this.datasets = options.datasets;
  62025. this.xField = [];
  62026. this.yField = [];
  62027. this.grid = {
  62028. top: "50px",
  62029. bottom: "50px",
  62030. left: "50px",
  62031. right: "60px"
  62032. };
  62033. this.chartType = options.type || "bar";
  62034. this._initXYField(options.chartOptions);
  62035. this.EVENT_TYPES = ["getdatafailed"];
  62036. this.events = new Events(this, null, this.EVENT_TYPES);
  62037. }
  62038. /**
  62039. * @function SuperMap.Components.ChartViewModel.prototype._initXYField
  62040. * @description 初始化XY字段。
  62041. * @private
  62042. * @param {Object} chartOptions - options里的图表参数
  62043. */
  62044. ChartViewModel_createClass(ChartViewModel, [{
  62045. key: "_initXYField",
  62046. value: function _initXYField(chartOptions) {
  62047. var me = this;
  62048. if (chartOptions && chartOptions.length > 0) {
  62049. chartOptions.forEach(function (option) {
  62050. if (option.xAxis) {
  62051. me.xField.push({
  62052. field: option.xAxis.field,
  62053. name: option.xAxis.name
  62054. });
  62055. }
  62056. if (option.yAxis) {
  62057. me.yField.push({
  62058. field: option.yAxis.field,
  62059. name: option.yAxis.name
  62060. });
  62061. }
  62062. });
  62063. }
  62064. }
  62065. /**
  62066. * @function SuperMap.Components.ChartViewModel.prototype.getDatasetInfo
  62067. * @description 获得数据集数据。
  62068. * @param {function} success - 成功回调函数
  62069. */
  62070. }, {
  62071. key: "getDatasetInfo",
  62072. value: function getDatasetInfo(success) {
  62073. var _this = this;
  62074. this.createChart = success;
  62075. if (this.datasets && this._checkUrl(this.datasets.url)) {
  62076. this.chartModel = new ChartModel(this.datasets);
  62077. if (this.datasets.type === 'iServer') {
  62078. this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this));
  62079. } else if (this.datasets.type === 'iPortal') {
  62080. this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this));
  62081. }
  62082. /**
  62083. * @event SuperMap.Components.ChartViewModel#getdatafailed
  62084. * @description 监听到获取数据失败事件后触发
  62085. * @property {Object} error - 事件对象。
  62086. */
  62087. this.chartModel.events.on({
  62088. "getdatafailed": function getdatafailed(error) {
  62089. _this.events.triggerEvent("getdatafailed", error);
  62090. }
  62091. });
  62092. }
  62093. }
  62094. /**
  62095. * @function SuperMap.Components.ChartViewModel.prototype._getDatasetInfoSuccess
  62096. * @description 成功回调函数。
  62097. * @private
  62098. * @param {Object} results - 数据集信息
  62099. */
  62100. }, {
  62101. key: "_getDatasetInfoSuccess",
  62102. value: function _getDatasetInfoSuccess(results) {
  62103. var datasetUrl = this.datasets.url; //判断服务为地图服务 或者 数据服务
  62104. var restIndex = datasetUrl.indexOf("rest");
  62105. if (restIndex > 0) {
  62106. var index = datasetUrl.indexOf("/", restIndex + 5);
  62107. var type = datasetUrl.substring(restIndex + 5, index);
  62108. var dataUrl = datasetUrl.substring(0, restIndex + 4) + "/data";
  62109. if (type === "maps") {
  62110. var mapIndex = datasetUrl.indexOf("/", index + 1);
  62111. var mapName = datasetUrl.substring(index + 1, mapIndex);
  62112. dataUrl = datasetUrl.substring(0, restIndex + 4) + "/maps/" + mapName;
  62113. results.result.dataUrl = dataUrl;
  62114. this._getLayerFeatures(results);
  62115. } else if (type === "data") {
  62116. results.result.dataUrl = dataUrl;
  62117. this._getDataFeatures(results);
  62118. }
  62119. }
  62120. }
  62121. /**
  62122. * @function SuperMap.Components.ChartViewModel.prototype._getDataInfoSuccess
  62123. * @description 请求iportal数据成功之后的回调
  62124. * @private
  62125. */
  62126. }, {
  62127. key: "_getDataInfoSuccess",
  62128. value: function _getDataInfoSuccess(results, type) {
  62129. var me = this;
  62130. if (type === 'RESTMAP') {
  62131. me._getChartDatasFromLayer(results);
  62132. } else {
  62133. me._getChartDatas(results);
  62134. }
  62135. }
  62136. /**
  62137. * @function SuperMap.Components.ChartViewModel.prototype._getDataFeatures
  62138. * @description 请求数据集的数据信息
  62139. * @private
  62140. * @param {Object} results - 数据集信息
  62141. */
  62142. }, {
  62143. key: "_getDataFeatures",
  62144. value: function _getDataFeatures(results) {
  62145. this.chartModel.getDataFeatures(results, this._getChartDatas.bind(this));
  62146. }
  62147. /**
  62148. * @function SuperMap.Components.ChartViewModel.prototype._getLayerFeatures
  62149. * @description 请求图层的数据信息
  62150. * @private
  62151. * @param {Object} results - 数据集信息
  62152. */
  62153. }, {
  62154. key: "_getLayerFeatures",
  62155. value: function _getLayerFeatures(results) {
  62156. this.chartModel.getLayerFeatures(results, this._getChartDatasFromLayer.bind(this));
  62157. }
  62158. /**
  62159. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatas
  62160. * @description 将请求回来的数据转换为图表所需的数据格式
  62161. * @private
  62162. * @param {Object} results - 数据要素信息
  62163. */
  62164. }, {
  62165. key: "_getChartDatas",
  62166. value: function _getChartDatas(results) {
  62167. if (results) {
  62168. // 数据来自restdata---results.result.features
  62169. this.features = results.result.features;
  62170. var features = this.features.features;
  62171. var data = {};
  62172. if (features.length) {
  62173. var feature = features[0];
  62174. var attrFields = [],
  62175. itemTypes = [];
  62176. for (var attr in feature.properties) {
  62177. attrFields.push(attr);
  62178. itemTypes.push(this._getDataType(feature.properties[attr]));
  62179. }
  62180. data = {
  62181. features: features,
  62182. fieldCaptions: attrFields,
  62183. fieldTypes: itemTypes,
  62184. fieldValues: []
  62185. };
  62186. for (var m in itemTypes) {
  62187. var fieldValue = [];
  62188. for (var j in features) {
  62189. var _feature = features[j];
  62190. var caption = data.fieldCaptions[m];
  62191. var value = _feature.properties[caption];
  62192. fieldValue.push(value);
  62193. }
  62194. data.fieldValues.push(fieldValue);
  62195. }
  62196. this.createChart(data);
  62197. }
  62198. }
  62199. }
  62200. /**
  62201. * @function SuperMap.Components.ChartViewModel.prototype._getChartDatasFromLayer
  62202. * @description 将请求回来的数据转换为图表所需的数据格式
  62203. * @private
  62204. * @param {Object} results - 图层数据要素信息
  62205. */
  62206. }, {
  62207. key: "_getChartDatasFromLayer",
  62208. value: function _getChartDatasFromLayer(results) {
  62209. if (results.result.recordsets) {
  62210. var recordsets = results.result.recordsets[0];
  62211. var features = recordsets.features.features;
  62212. this.features = recordsets.features;
  62213. var data = {};
  62214. if (features.length) {
  62215. data = {
  62216. features: recordsets.features,
  62217. fieldCaptions: recordsets.fieldCaptions,
  62218. fieldTypes: recordsets.fieldTypes,
  62219. fieldValues: []
  62220. };
  62221. for (var m in data.fieldCaptions) {
  62222. var fieldValue = [];
  62223. for (var j in features) {
  62224. var feature = features[j];
  62225. var caption = data.fieldCaptions[m];
  62226. var value = feature.properties[caption];
  62227. fieldValue.push(value);
  62228. }
  62229. data.fieldValues.push(fieldValue);
  62230. }
  62231. this.createChart(data);
  62232. }
  62233. }
  62234. }
  62235. /**
  62236. * @function SuperMap.Components.ChartViewModel.prototype._createChartOptions
  62237. * @description 创建图表所需参数
  62238. * @private
  62239. * @param {Object} data - 图表数据
  62240. */
  62241. }, {
  62242. key: "_createChartOptions",
  62243. value: function _createChartOptions(data) {
  62244. this.calculatedData = this._createChartDatas(data);
  62245. return this.updateChartOptions(this.chartType);
  62246. }
  62247. /**
  62248. * @function SuperMap.Components.ChartViewModel.prototype.changeType
  62249. * @description 改变图表类型
  62250. * @param {string} type - 图表类型
  62251. */
  62252. }, {
  62253. key: "changeType",
  62254. value: function changeType(type) {
  62255. if (type !== this.chartType) {
  62256. this.chartType = type;
  62257. return this.updateChartOptions(this.chartType);
  62258. }
  62259. }
  62260. /**
  62261. * @function SuperMap.Components.ChartViewModel.prototype.updateData
  62262. * @description 改变图表类型
  62263. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  62264. * @param {function} success 成功回调函数
  62265. */
  62266. }, {
  62267. key: "updateData",
  62268. value: function updateData(datasets, chartOption, success) {
  62269. this.updateChart = success;
  62270. this.xField = [];
  62271. this.yField = [];
  62272. this._initXYField(chartOption); // type的设置默认值
  62273. datasets.type = datasets.type || 'iServer'; // withCredentials的设置默认值
  62274. datasets.withCredentials = datasets.withCredentials || false;
  62275. this.datasets = datasets;
  62276. this.getDatasetInfo(this._updateDataSuccess.bind(this));
  62277. }
  62278. /**
  62279. * @function SuperMap.Components.ChartViewModel.prototype._updateDataSuccess
  62280. * @description 改变图表类型
  62281. * @private
  62282. * @param {Object} data - 图表数据
  62283. */
  62284. }, {
  62285. key: "_updateDataSuccess",
  62286. value: function _updateDataSuccess(data) {
  62287. var options = this._createChartOptions(data);
  62288. this.updateChart(options);
  62289. }
  62290. /**
  62291. * @function SuperMap.Components.ChartViewModel.prototype.updateChartOptions
  62292. * @description 更新图表所需参数
  62293. * @param {string} type - 图表类型
  62294. * @param {Object} style - 图表样式
  62295. */
  62296. }, {
  62297. key: "updateChartOptions",
  62298. value: function updateChartOptions(type, style) {
  62299. if (this.calculatedData) {
  62300. var grid = this.grid;
  62301. var series = this._createChartSeries(this.calculatedData, type);
  62302. var datas = [];
  62303. for (var i in this.calculatedData.XData) {
  62304. datas.push({
  62305. value: this.calculatedData.XData[i].fieldsData
  62306. });
  62307. }
  62308. var xAxis = {
  62309. type: "category",
  62310. name: this.xField[0].name || "X",
  62311. data: datas,
  62312. nameTextStyle: {
  62313. color: '#fff',
  62314. fontSize: 14
  62315. },
  62316. splitLine: {
  62317. show: false
  62318. },
  62319. axisLine: {
  62320. lineStyle: {
  62321. color: '#eee'
  62322. }
  62323. }
  62324. };
  62325. var yAxis = {
  62326. type: "value",
  62327. name: this.yFieldName || "Y",
  62328. data: {},
  62329. nameTextStyle: {
  62330. color: '#fff',
  62331. fontSize: 14
  62332. },
  62333. splitLine: {
  62334. show: false
  62335. },
  62336. axisLine: {
  62337. lineStyle: {
  62338. color: '#eee'
  62339. }
  62340. }
  62341. };
  62342. var tooltip = {
  62343. formatter: '{b0}: {c0}'
  62344. };
  62345. var backgroundColor = '#404a59';
  62346. if (style) {
  62347. if (style.grid) {
  62348. grid = style.grid;
  62349. }
  62350. if (style.tooltip) {
  62351. tooltip = style.tooltip;
  62352. }
  62353. if (style.backgroundColor) {
  62354. backgroundColor = style.backgroundColor;
  62355. }
  62356. }
  62357. return {
  62358. backgroundColor: backgroundColor,
  62359. grid: grid,
  62360. series: series,
  62361. xAxis: xAxis,
  62362. yAxis: yAxis,
  62363. tooltip: tooltip
  62364. };
  62365. }
  62366. }
  62367. /**
  62368. * @function SuperMap.Components.ChartViewModel.prototype._createChartDatas
  62369. * @description 构建图表数据
  62370. * @private
  62371. * @param {Object} data - 源数据
  62372. */
  62373. }, {
  62374. key: "_createChartDatas",
  62375. value: function _createChartDatas(data) {
  62376. var fieldIndex = 0,
  62377. yfieldIndexs = [];
  62378. var fieldCaptions = data.fieldCaptions;
  62379. var me = this; //X
  62380. fieldCaptions.forEach(function (field, index) {
  62381. if (me.xField[0] && field === me.xField[0].field) {
  62382. fieldIndex = index;
  62383. }
  62384. }); //Y
  62385. this.yFieldName = "";
  62386. this.yField.forEach(function (value, index) {
  62387. if (index !== 0) {
  62388. me.yFieldName = me.yFieldName + ",";
  62389. }
  62390. me.yFieldName = me.yFieldName + value.name;
  62391. fieldCaptions.forEach(function (field, index) {
  62392. if (field === value.field) {
  62393. yfieldIndexs.push(index);
  62394. }
  62395. });
  62396. });
  62397. var datas = this._getAttrData(data, fieldIndex);
  62398. var yDatas = [];
  62399. if (yfieldIndexs.length > 0) {
  62400. yfieldIndexs.forEach(function (yfieldIndex) {
  62401. var yData = [];
  62402. for (var i in data.fieldValues[yfieldIndex]) {
  62403. yData.push({
  62404. value: data.fieldValues[yfieldIndex][i]
  62405. });
  62406. }
  62407. yDatas.push(yData);
  62408. });
  62409. } else {
  62410. //未指定Y字段时,y轴计数
  62411. var YData = [],
  62412. XData = [],
  62413. len = datas.length; //计算X轴,Y轴数据,并去重
  62414. for (var i = 0; i < len; i++) {
  62415. var isSame = false;
  62416. for (var j = 0, leng = XData.length; j < leng; j++) {
  62417. if (datas[i].fieldsData === XData[j].fieldsData) {
  62418. YData[j].value++;
  62419. XData[j].recordIndexs.push(i);
  62420. isSame = true;
  62421. break;
  62422. }
  62423. }
  62424. if (!isSame) {
  62425. if (datas[i].fieldsData) {
  62426. XData.push({
  62427. fieldsData: datas[i].fieldsData,
  62428. recordIndexs: [i]
  62429. });
  62430. YData.push({
  62431. value: 1
  62432. });
  62433. }
  62434. }
  62435. }
  62436. datas = XData;
  62437. yDatas = [YData];
  62438. }
  62439. return {
  62440. XData: datas,
  62441. YData: yDatas
  62442. };
  62443. }
  62444. /**
  62445. * @function SuperMap.Components.ChartViewModel.prototype._getAttrData
  62446. * @description 选中字段数据
  62447. * @private
  62448. * @param {Object} datacontent - 图表数据
  62449. * @param {number} index - 字段索引
  62450. */
  62451. }, {
  62452. key: "_getAttrData",
  62453. value: function _getAttrData(datacontent, index) {
  62454. if (index === 0) {
  62455. this.xField = [{
  62456. field: datacontent.fieldCaptions[index],
  62457. name: datacontent.fieldCaptions[index]
  62458. }];
  62459. }
  62460. var fieldsDatas = [];
  62461. for (var i = 0, len = datacontent.fieldValues[index].length; i < len; i++) {
  62462. var value = datacontent.fieldValues[index][i];
  62463. fieldsDatas.push({
  62464. recordIndexs: i,
  62465. fieldsData: value
  62466. });
  62467. }
  62468. return fieldsDatas;
  62469. }
  62470. /**
  62471. * @function SuperMap.Components.ChartViewModel.prototype._createChartSeries
  62472. * @description 图表数据
  62473. * @private
  62474. * @param {Object} calculatedData - 图表数据
  62475. * @param {string} chartType - 图表类型
  62476. */
  62477. }, {
  62478. key: "_createChartSeries",
  62479. value: function _createChartSeries(calculatedData, chartType) {
  62480. var series = [];
  62481. var yDatas = calculatedData.YData;
  62482. yDatas.forEach(function (yData) {
  62483. var value = 0;
  62484. var serieData = [];
  62485. var _iterator = _createForOfIteratorHelper(yData),
  62486. _step;
  62487. try {
  62488. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  62489. var data = _step.value;
  62490. value = data.value;
  62491. serieData.push({
  62492. value: value
  62493. });
  62494. }
  62495. } catch (err) {
  62496. _iterator.e(err);
  62497. } finally {
  62498. _iterator.f();
  62499. }
  62500. var serie = {
  62501. type: chartType,
  62502. data: serieData,
  62503. name: "y"
  62504. };
  62505. series.push(serie);
  62506. });
  62507. return series;
  62508. }
  62509. /**
  62510. * @function SuperMap.Components.ChartViewModel.prototype._isDate
  62511. * @description 判断是否为日期
  62512. * @private
  62513. * @param {string} data - 字符串
  62514. */
  62515. }, {
  62516. key: "_isDate",
  62517. value: function _isDate(data) {
  62518. 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;
  62519. return reg.test(data);
  62520. }
  62521. /**
  62522. * @function SuperMap.Components.ChartViewModel.prototype._isNumber
  62523. * @description 判断是否为数值
  62524. * @private
  62525. * @param {string} data - 字符串
  62526. */
  62527. }, {
  62528. key: "_isNumber",
  62529. value: function _isNumber(data) {
  62530. var mdata = Number(data);
  62531. if (mdata === 0) {
  62532. return true;
  62533. }
  62534. return !isNaN(mdata);
  62535. }
  62536. /**
  62537. * @function SuperMap.Components.ChartViewModel.prototype._getDataType
  62538. * @description 判断数据的类型
  62539. * @private
  62540. * @param {string} data - 字符串
  62541. */
  62542. }, {
  62543. key: "_getDataType",
  62544. value: function _getDataType(data) {
  62545. if (data !== null && data !== undefined && data !== '') {
  62546. if (this._isDate(data)) {
  62547. return "DATE";
  62548. }
  62549. if (this._isNumber(data)) {
  62550. return "NUMBER";
  62551. }
  62552. }
  62553. return "STRING";
  62554. }
  62555. /**
  62556. * @function SuperMap.Components.ChartViewModel.prototype._checkUrl
  62557. * @description 检查url是否符合要求
  62558. * @private
  62559. * @param {string} url
  62560. */
  62561. }, {
  62562. key: "_checkUrl",
  62563. value: function _checkUrl(url) {
  62564. var match;
  62565. if (url === '' || !this._isMatchUrl(url)) {
  62566. match = false;
  62567. } else if (/^http[s]?:\/\/localhost/.test(url) || /^http[s]?:\/\/127.0.0.1/.test(url)) {
  62568. //不是实际域名
  62569. match = false;
  62570. } else {
  62571. match = true;
  62572. }
  62573. return match;
  62574. }
  62575. /**
  62576. * @function SuperMap.Components.ChartViewModel.prototype._isMatchUrl
  62577. * @description 判断输入的地址是否符合地址格式
  62578. * @private
  62579. * @param {string} str - url
  62580. */
  62581. }, {
  62582. key: "_isMatchUrl",
  62583. value: function _isMatchUrl(str) {
  62584. var reg = new RegExp('(https?|http|file|ftp)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]');
  62585. return reg.test(str);
  62586. }
  62587. /**
  62588. * @function SuperMap.Components.ChartViewModel.prototype.getStyle
  62589. * @description 获取图表样式。
  62590. */
  62591. }, {
  62592. key: "getStyle",
  62593. value: function getStyle() {
  62594. var style = {
  62595. grid: this.grid,
  62596. tooltip: this.tooltip,
  62597. backgroundColor: this.backgroundColor
  62598. };
  62599. return style;
  62600. }
  62601. /**
  62602. * @function SuperMap.Components.ChartViewModel.prototype.getFeatures
  62603. * @description 获取地图服务,数据服务请求返回的数据。
  62604. */
  62605. }, {
  62606. key: "getFeatures",
  62607. value: function getFeatures() {
  62608. return this.features;
  62609. }
  62610. /**
  62611. * @function SuperMap.Components.ChartViewModel.prototype.setStyle
  62612. * @description 设置图表样式。
  62613. * @param {Object} style - 图表样式
  62614. */
  62615. }, {
  62616. key: "setStyle",
  62617. value: function setStyle(style) {
  62618. return this.updateChartOptions(this.chartType, style);
  62619. }
  62620. }]);
  62621. return ChartViewModel;
  62622. }();
  62623. SuperMap.Components.ChartViewModel = ChartViewModel;
  62624. ;// CONCATENATED MODULE: ./src/common/components/chart/ChartView.js
  62625. function ChartView_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62626. 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); } }
  62627. function ChartView_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartView_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartView_defineProperties(Constructor, staticProps); return Constructor; }
  62628. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62629. * This program are made available under the terms of the Apache License, Version 2.0
  62630. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62631. /**
  62632. * @class SuperMap.Components.Chart
  62633. * @classdesc 图表组件
  62634. * @version 9.1.2
  62635. * @param {string} domID - 图表dom元素ID。
  62636. * @param {Object} options - 可选参数。
  62637. * @param {string} options.type - 图表类型。
  62638. * @param {SuperMap.Components.Chart.Datasets} options.datasets - 数据来源
  62639. * @param {Array.<Object>} options.chartOptions - 图表可选参数。
  62640. * @param {Array.<Object>} options.chartOptions.xAxis - 图表X轴。
  62641. * @param {string} options.chartOptions.xAxis.field - 图表X轴字段名。
  62642. * @param {string} options.chartOptions.xAxis.name - 图表X轴名称。
  62643. * @param {Array.<Object>} options.chartOptions.yAxis - 图表Y轴。
  62644. * @param {string} options.chartOptions.yAxis.field - 图表Y轴字段名。
  62645. * @param {string} options.chartOptions.yAxis.name - 图表Y轴名称。
  62646. * @category Components Chart
  62647. */
  62648. /**
  62649. * @typedef {Object} SuperMap.Components.Chart.Datasets - 数据来源
  62650. * @property {string} [type = 'iServer'] - 服务类型 iServer, iPortal。
  62651. * @property {string} url - 服务url地址。
  62652. * @property {boolean} [withCredentials = false] - 设置请求是否带cookie
  62653. * @property {SuperMap.FilterParameter} queryInfo - 查询条件
  62654. */
  62655. var ChartView = /*#__PURE__*/function () {
  62656. function ChartView(domID, options) {
  62657. ChartView_classCallCheck(this, ChartView);
  62658. this.domID = domID;
  62659. this.chartType = options.type || "bar"; // 设置options.datasets.type的默认值是iServer
  62660. options.datasets.type = options.datasets.type || 'iServer'; // 设置withCredentials的默认值为false
  62661. options.datasets.withCredentials = options.datasets.withCredentials || false;
  62662. this.viewModel = new ChartViewModel(options); //添加控件。
  62663. this._fillDataToView();
  62664. }
  62665. /**
  62666. * @function SuperMap.Components.Chart.prototype.onAdd
  62667. * @description 创建图表之后成功回调
  62668. * @param {function} addChart - 回调函数
  62669. */
  62670. ChartView_createClass(ChartView, [{
  62671. key: "onAdd",
  62672. value: function onAdd(addChart) {
  62673. this.addChart = addChart;
  62674. }
  62675. /**
  62676. * @function SuperMap.Components.Chart.prototype._fillDataToView
  62677. * @description 填充数据到 view。
  62678. * @private
  62679. */
  62680. }, {
  62681. key: "_fillDataToView",
  62682. value: function _fillDataToView() {
  62683. var messageboxs = new MessageBox(); //iclient 绑定createChart事件成功回调
  62684. this.viewModel.getDatasetInfo(this._createChart.bind(this));
  62685. this.viewModel.events.on({
  62686. "getdatafailed": function getdatafailed(error) {
  62687. messageboxs.showView(error.message);
  62688. }
  62689. });
  62690. }
  62691. /**
  62692. * @function SuperMap.Components.Chart.prototype.getStyle
  62693. * @description 获取图表样式。
  62694. */
  62695. }, {
  62696. key: "getStyle",
  62697. value: function getStyle() {
  62698. return this.viewModel.getStyle();
  62699. }
  62700. /**
  62701. * @function SuperMap.Components.Chart.prototype.getFeatures
  62702. * @description 获取地图服务,数据服务请求返回的数据。
  62703. */
  62704. }, {
  62705. key: "getFeatures",
  62706. value: function getFeatures() {
  62707. return this.viewModel.getFeatures();
  62708. }
  62709. /**
  62710. * @function SuperMap.Components.Chart.prototype.setStyle
  62711. * @description 设置图表样式。
  62712. * @param {Object} style - 图表样式 参考Echarts-options样式设置
  62713. */
  62714. }, {
  62715. key: "setStyle",
  62716. value: function setStyle(style) {
  62717. var newOptions = this.viewModel.setStyle(style);
  62718. this._updateChart(newOptions);
  62719. }
  62720. /**
  62721. * @function SuperMap.Components.Chart.prototype.changeType
  62722. * @description 改变图表类型
  62723. * @param {string} type - 图表类型
  62724. */
  62725. }, {
  62726. key: "changeType",
  62727. value: function changeType(type) {
  62728. if (this.chartType !== type) {
  62729. this.chartType = type;
  62730. var newOptions = this.viewModel.changeType(type);
  62731. this._updateChart(newOptions);
  62732. }
  62733. }
  62734. /**
  62735. * @function SuperMap.Components.Chart.prototype.updateData
  62736. * @description 更新图表数据
  62737. * @param {SuperMap.Components.Chart.Datasets} datasets - 数据来源
  62738. * @param {Object} chartOption - X,Y轴信息
  62739. */
  62740. }, {
  62741. key: "updateData",
  62742. value: function updateData(datasets, chartOption) {
  62743. var me = this;
  62744. this.viewModel.updateData(datasets, chartOption, function (options) {
  62745. me._updateChart(options);
  62746. if (me.addChart) {
  62747. me.addChart();
  62748. }
  62749. });
  62750. }
  62751. /**
  62752. * @function SuperMap.Components.Chart.prototype._createChart
  62753. * @description 创建图表
  62754. * @private
  62755. * @param {Object} data - 图表数据
  62756. */
  62757. }, {
  62758. key: "_createChart",
  62759. value: function _createChart(data) {
  62760. this.echart = external_function_try_return_echarts_catch_e_return_default().init(document.getElementById(this.domID), null, {
  62761. renderer: "canvas"
  62762. });
  62763. var options = this.viewModel._createChartOptions(data);
  62764. this.echart.setOption(options);
  62765. if (this.addChart) {
  62766. this.addChart();
  62767. }
  62768. }
  62769. /**
  62770. * @function SuperMap.Components.Chart.prototype._updateChart
  62771. * @description 更新图表
  62772. * @private
  62773. * @param {Object} options - 图表参数
  62774. */
  62775. }, {
  62776. key: "_updateChart",
  62777. value: function _updateChart(options) {
  62778. if (this.echart) {
  62779. this.echart.clear();
  62780. this.echart.setOption(options);
  62781. }
  62782. }
  62783. }]);
  62784. return ChartView;
  62785. }();
  62786. SuperMap.Components.Chart = ChartView;
  62787. ;// CONCATENATED MODULE: ./src/common/components/templates/TemplateBase.js
  62788. function TemplateBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62789. 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); } }
  62790. function TemplateBase_createClass(Constructor, protoProps, staticProps) { if (protoProps) TemplateBase_defineProperties(Constructor.prototype, protoProps); if (staticProps) TemplateBase_defineProperties(Constructor, staticProps); return Constructor; }
  62791. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62792. * This program are made available under the terms of the Apache License, Version 2.0
  62793. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62794. /**
  62795. * @class SuperMap.Components.TemplateBase
  62796. * @classdesc 组件公用组件父类,用于约束统一封装的公用组件结构。
  62797. * @version 9.1.1
  62798. * @param {Object} options - 组件配置参数。
  62799. * @param {string} options.id - 组件 dom 元素 id。
  62800. * @category Components Common
  62801. */
  62802. var TemplateBase = /*#__PURE__*/function () {
  62803. function TemplateBase(options) {
  62804. TemplateBase_classCallCheck(this, TemplateBase);
  62805. options = options ? options : {};
  62806. /**
  62807. * @member {string} [SuperMap.Components.TemplateBase.prototype.id=null]
  62808. * @description 组件 dom 元素 id。
  62809. */
  62810. this.id = options.id ? options.id : null;
  62811. /**
  62812. * @member {Element} [SuperMap.Components.TemplateBase.prototype.rootContainer=null]
  62813. * @description 组件 dom 元素对象。
  62814. */
  62815. this.rootContainer = null;
  62816. }
  62817. /**
  62818. * @function SuperMap.Components.TemplateBase.prototype.getElement
  62819. * @description 获取当前组件元素对象。
  62820. * @return {Element}
  62821. */
  62822. TemplateBase_createClass(TemplateBase, [{
  62823. key: "getElement",
  62824. value: function getElement() {
  62825. //todo 其实感觉再这里给组件设置不太合理
  62826. if (this.id) {
  62827. this.rootContainer.id = this.id;
  62828. }
  62829. return this.rootContainer;
  62830. }
  62831. /**
  62832. * @function SuperMap.Components.TemplateBase.prototype._initView
  62833. * @private
  62834. * @description 初始化模板。
  62835. */
  62836. }, {
  62837. key: "_initView",
  62838. value: function _initView() {//子类实现此方法
  62839. }
  62840. /**
  62841. * @function SuperMap.Components.TemplateBase.prototype.showView
  62842. * @description 显示组件。
  62843. */
  62844. }, {
  62845. key: "showView",
  62846. value: function showView() {
  62847. this.rootContainer.hidden = false;
  62848. }
  62849. /**
  62850. * @function SuperMap.Components.TemplateBase.prototype.closeView
  62851. * @description 隐藏组件。
  62852. */
  62853. }, {
  62854. key: "closeView",
  62855. value: function closeView() {
  62856. this.rootContainer.hidden = true;
  62857. }
  62858. }]);
  62859. return TemplateBase;
  62860. }();
  62861. SuperMap.Components.TemplateBase = TemplateBase;
  62862. ;// CONCATENATED MODULE: ./src/common/components/templates/CommonContainer.js
  62863. function CommonContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CommonContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { CommonContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CommonContainer_typeof(obj); }
  62864. function CommonContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62865. 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); } }
  62866. function CommonContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) CommonContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) CommonContainer_defineProperties(Constructor, staticProps); return Constructor; }
  62867. 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 } }); if (superClass) CommonContainer_setPrototypeOf(subClass, superClass); }
  62868. function CommonContainer_setPrototypeOf(o, p) { CommonContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CommonContainer_setPrototypeOf(o, p); }
  62869. 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); }; }
  62870. function CommonContainer_possibleConstructorReturn(self, call) { if (call && (CommonContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return CommonContainer_assertThisInitialized(self); }
  62871. function CommonContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  62872. function CommonContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  62873. function CommonContainer_getPrototypeOf(o) { CommonContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CommonContainer_getPrototypeOf(o); }
  62874. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62875. * This program are made available under the terms of the Apache License, Version 2.0
  62876. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62877. /**
  62878. * @class SuperMap.Components.CommonContainer
  62879. * @classdesc 组件统一外框。
  62880. * @version 9.1.1
  62881. * @param {Object} options - 组件可选参数。
  62882. * @param {string} options.id - 组件 dom 元素 id。
  62883. * @param {string} options.title - 标题。
  62884. * @category Components Common
  62885. * @extends {SuperMap.Components.TemplateBase}
  62886. */
  62887. var CommonContainer = /*#__PURE__*/function (_TemplateBase) {
  62888. CommonContainer_inherits(CommonContainer, _TemplateBase);
  62889. var _super = CommonContainer_createSuper(CommonContainer);
  62890. function CommonContainer(options) {
  62891. var _this;
  62892. CommonContainer_classCallCheck(this, CommonContainer);
  62893. _this = _super.call(this, options);
  62894. var title = options.title ? options.title : "";
  62895. _this._initView(title);
  62896. return _this;
  62897. }
  62898. /**
  62899. * @private
  62900. * @override
  62901. */
  62902. CommonContainer_createClass(CommonContainer, [{
  62903. key: "_initView",
  62904. value: function _initView(title) {
  62905. var container = document.createElement("div");
  62906. container.setAttribute("class", "component-container"); //title
  62907. var titleContainer = document.createElement("div");
  62908. titleContainer.setAttribute("class", "component-title");
  62909. var titleContent = document.createElement("div");
  62910. titleContent.innerHTML = title;
  62911. titleContainer.appendChild(titleContent);
  62912. container.appendChild(titleContainer); //container
  62913. var componentContent = document.createElement("div");
  62914. componentContent.setAttribute("class", "component-content");
  62915. container.appendChild(componentContent);
  62916. this.content = componentContent;
  62917. this.rootContainer = container;
  62918. return container;
  62919. }
  62920. /**
  62921. * @function SuperMap.Components.CommonContainer.prototype.getContentElement
  62922. * @description 获取内容元素容器
  62923. */
  62924. }, {
  62925. key: "getContentElement",
  62926. value: function getContentElement() {
  62927. return this.content;
  62928. }
  62929. /**
  62930. * @function SuperMap.Components.CommonContainer.prototype.appendContent
  62931. * @description 填充内容元素
  62932. */
  62933. }, {
  62934. key: "appendContent",
  62935. value: function appendContent(element) {
  62936. this.content.appendChild(element);
  62937. }
  62938. }]);
  62939. return CommonContainer;
  62940. }(TemplateBase);
  62941. SuperMap.Components.CommonContainer = CommonContainer;
  62942. ;// CONCATENATED MODULE: ./src/common/components/templates/Select.js
  62943. function Select_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Select_typeof = function _typeof(obj) { return typeof obj; }; } else { Select_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Select_typeof(obj); }
  62944. function Select_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  62945. 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); } }
  62946. function Select_createClass(Constructor, protoProps, staticProps) { if (protoProps) Select_defineProperties(Constructor.prototype, protoProps); if (staticProps) Select_defineProperties(Constructor, staticProps); return Constructor; }
  62947. 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 } }); if (superClass) Select_setPrototypeOf(subClass, superClass); }
  62948. function Select_setPrototypeOf(o, p) { Select_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return Select_setPrototypeOf(o, p); }
  62949. 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); }; }
  62950. function Select_possibleConstructorReturn(self, call) { if (call && (Select_typeof(call) === "object" || typeof call === "function")) { return call; } return Select_assertThisInitialized(self); }
  62951. function Select_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  62952. function Select_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  62953. function Select_getPrototypeOf(o) { Select_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return Select_getPrototypeOf(o); }
  62954. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  62955. * This program are made available under the terms of the Apache License, Version 2.0
  62956. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  62957. /**
  62958. * @class SuperMap.Components.Select
  62959. * @classdesc 组件统一的文字下拉框。
  62960. * @version 9.1.1
  62961. * @param {Array.<string|Array>} options - 需要创建的 Select 数据数组。
  62962. * @param {string} options.id - 组件 dom 元素 id。
  62963. * @param {string} [options.labelName] - label 名称。
  62964. * @param {Array.<string>} options.optionsArr - 需要创建的 option 数据数组。
  62965. * @param {Function} [options.optionsClickCb] - option 点击事件回调函数。
  62966. * @extends {SuperMap.Components.TemplateBase}
  62967. * @category Components Common
  62968. */
  62969. var Select = /*#__PURE__*/function (_TemplateBase) {
  62970. Select_inherits(Select, _TemplateBase);
  62971. var _super = Select_createSuper(Select);
  62972. function Select(options) {
  62973. var _this;
  62974. Select_classCallCheck(this, Select);
  62975. _this = _super.call(this, options);
  62976. _this._initView(options);
  62977. return _this;
  62978. }
  62979. Select_createClass(Select, [{
  62980. key: "_initView",
  62981. value: function _initView(options) {
  62982. var selectTool = this._createElement('div', "component-selecttool");
  62983. if (options.labelName) {
  62984. var label = this._createElement('label', 'component-selecttool__lable--describe', selectTool);
  62985. label.innerHTML = options.labelName;
  62986. }
  62987. var chartSelect = this._createElement('div', 'component-selecttool--chart', selectTool);
  62988. chartSelect.setAttribute('tabindex', '1');
  62989. var selectName = this._createElement('div', "component-selecttool__name", chartSelect);
  62990. selectName.title = options.optionsArr[0];
  62991. selectName.innerHTML = options.optionsArr[0];
  62992. var chartTriangleBtn = this._createElement('div', 'component-selecttool__trianglebtn--chart', chartSelect);
  62993. var triangleBtn = this._createElement('div', 'component-triangle-down-img', chartTriangleBtn);
  62994. var selectContent = this._createElement('div', 'component-selecttool__content', chartSelect);
  62995. var scrollarea = this._createElement('div', 'component-selecttool__content--chart', selectContent);
  62996. var scrollareaContent = this._createElement('div', 'component-selecttool__scrollarea__content', scrollarea);
  62997. scrollareaContent.setAttribute('tabindex', '1');
  62998. this.createOptions(scrollareaContent, options.optionsArr);
  62999. this.optionClickEvent(scrollareaContent, selectName, options.optionsClickCb); // 下拉框显示 & 隐藏事件
  63000. this._selectClickEvent(chartSelect, selectContent, triangleBtn);
  63001. this.rootContainer = selectTool;
  63002. }
  63003. /**
  63004. * @function SuperMap.Components.Select.prototype.createOptions
  63005. * @description 创建所属下拉框选项。
  63006. */
  63007. }, {
  63008. key: "createOptions",
  63009. value: function createOptions(container, optionsArr) {
  63010. for (var i in optionsArr) {
  63011. var option = this._createElement('div', 'component-selecttool__option', container);
  63012. option.title = optionsArr[i];
  63013. option.innerHTML = optionsArr[i];
  63014. }
  63015. }
  63016. /**
  63017. * @function SuperMap.Components.Select.prototype._selectClickEvent
  63018. * @description select 点击显示&隐藏事件。
  63019. * @private
  63020. */
  63021. }, {
  63022. key: "_selectClickEvent",
  63023. value: function _selectClickEvent(eventElement, contentElement, triangleBtn) {
  63024. eventElement.onclick = function (e) {
  63025. if (contentElement.style.display === "block") {
  63026. contentElement.style.display = "none";
  63027. triangleBtn.className = "component-triangle-down-img";
  63028. } else {
  63029. contentElement.style.display = "block";
  63030. triangleBtn.className = "triangle-up-img";
  63031. }
  63032. e.preventDefault();
  63033. e.stopPropagation();
  63034. };
  63035. eventElement.onmousedown = function (evt) {
  63036. //console.log('dropdownbox onmousedown '+evt.target.className);
  63037. if (evt.target !== this) {
  63038. this.focus();
  63039. evt.preventDefault();
  63040. evt.stopPropagation();
  63041. }
  63042. };
  63043. eventElement.onblur = function () {
  63044. contentElement.style.display = "none";
  63045. triangleBtn.className = "component-triangle-down-img";
  63046. };
  63047. }
  63048. /**
  63049. * @function Select.prototype._createElement
  63050. * @description 通用创建元素。
  63051. * @private
  63052. */
  63053. }, {
  63054. key: "_createElement",
  63055. value: function _createElement(tagName, className, parentEle) {
  63056. var ele = document.createElement(tagName || 'div');
  63057. className && (ele.className = className);
  63058. parentEle && parentEle.appendChild(ele);
  63059. return ele;
  63060. }
  63061. /**
  63062. * @function SuperMap.Components.Select.prototype.optionClickEvent
  63063. * @description 下拉框的 option 的点击事件。
  63064. */
  63065. }, {
  63066. key: "optionClickEvent",
  63067. value: function optionClickEvent(optionEleArr, selectNameEle, optionsClickCb) {
  63068. var _loop = function _loop(i) {
  63069. var childEle = optionEleArr.children[i];
  63070. childEle.onclick = function () {
  63071. selectNameEle.innerHTML = childEle.innerHTML;
  63072. selectNameEle.title = childEle.title;
  63073. if (childEle.getAttribute('data-value')) {
  63074. selectNameEle.setAttribute('data-value', childEle.getAttribute('data-value'));
  63075. }
  63076. optionsClickCb && optionsClickCb(childEle);
  63077. };
  63078. };
  63079. for (var i = 0; i < optionEleArr.children.length; i++) {
  63080. _loop(i);
  63081. }
  63082. }
  63083. }]);
  63084. return Select;
  63085. }(TemplateBase);
  63086. SuperMap.Components.Select = Select;
  63087. ;// CONCATENATED MODULE: ./src/common/components/templates/DropDownBox.js
  63088. function DropDownBox_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { DropDownBox_typeof = function _typeof(obj) { return typeof obj; }; } else { DropDownBox_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return DropDownBox_typeof(obj); }
  63089. function DropDownBox_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63090. 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); } }
  63091. function DropDownBox_createClass(Constructor, protoProps, staticProps) { if (protoProps) DropDownBox_defineProperties(Constructor.prototype, protoProps); if (staticProps) DropDownBox_defineProperties(Constructor, staticProps); return Constructor; }
  63092. 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 } }); if (superClass) DropDownBox_setPrototypeOf(subClass, superClass); }
  63093. function DropDownBox_setPrototypeOf(o, p) { DropDownBox_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return DropDownBox_setPrototypeOf(o, p); }
  63094. 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); }; }
  63095. function DropDownBox_possibleConstructorReturn(self, call) { if (call && (DropDownBox_typeof(call) === "object" || typeof call === "function")) { return call; } return DropDownBox_assertThisInitialized(self); }
  63096. function DropDownBox_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63097. function DropDownBox_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63098. function DropDownBox_getPrototypeOf(o) { DropDownBox_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return DropDownBox_getPrototypeOf(o); }
  63099. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63100. * This program are made available under the terms of the Apache License, Version 2.0
  63101. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63102. /**
  63103. * @class SuperMap.Components.DropDownBox
  63104. * @classdesc 组件统一的图片下拉框。
  63105. * @version 9.1.1
  63106. * @param {Array.<Object>} optionsArr - 需要创建的 option 数据数组。
  63107. * @param {string} optionsArr.id - 组件 dom 元素 id。
  63108. * @param {string} optionsArr.title - 下拉框 title。
  63109. * @param {string} optionsArr.remark - 下拉框解释标记文本。
  63110. * @param {string} optionsArr.icon - 下拉框图标。
  63111. * @param {string} [optionsArr.dataValue] - 下拉框 attribute 名为 data-value 的值 。
  63112. * @param {string} [optionsArr.icon.className] - 下拉框图标类名。
  63113. * @param {string} [optionsArr.icon.background] - 下拉框图标背景 url。
  63114. * @category Components Common
  63115. * @extends {SuperMap.Components.TemplateBase}
  63116. */
  63117. var DropDownBox = /*#__PURE__*/function (_TemplateBase) {
  63118. DropDownBox_inherits(DropDownBox, _TemplateBase);
  63119. var _super = DropDownBox_createSuper(DropDownBox);
  63120. function DropDownBox(optionsArr) {
  63121. var _this;
  63122. DropDownBox_classCallCheck(this, DropDownBox);
  63123. _this = _super.call(this, optionsArr);
  63124. _this._initView(optionsArr);
  63125. return _this;
  63126. }
  63127. /**
  63128. * @function SuperMap.Components.DropDownBox.prototype._initView
  63129. * @description 初始化下拉框。
  63130. * @private
  63131. * @override
  63132. */
  63133. DropDownBox_createClass(DropDownBox, [{
  63134. key: "_initView",
  63135. value: function _initView(optionsArr) {
  63136. var dropDownContainer = document.createElement('div');
  63137. dropDownContainer.className = 'component-dropdownbox--container';
  63138. var dropDownBox = document.createElement('div');
  63139. dropDownBox.setAttribute('tabindex', '1');
  63140. dropDownBox.className = "component-dropdownbox";
  63141. dropDownContainer.appendChild(dropDownBox);
  63142. var dropDownTopContainer = document.createElement('div');
  63143. dropDownBox.appendChild(dropDownTopContainer);
  63144. this._createDropDownOption(optionsArr[0], dropDownTopContainer);
  63145. var triangleBtnContainer = document.createElement('div');
  63146. triangleBtnContainer.className = 'component-dropdownbox__triangle-btn';
  63147. dropDownBox.appendChild(triangleBtnContainer);
  63148. var triangleBtn = document.createElement('div');
  63149. triangleBtn.className = 'component-triangle-down-img';
  63150. triangleBtnContainer.appendChild(triangleBtn);
  63151. var createDropDownBoxParam = {
  63152. "parentEle": dropDownBox,
  63153. "dropDownContent": ['component-dropdownbox__content component-dropdownbox__content--chart', 'dropDownContent'],
  63154. "scrollareaContent": 'component-selecttool__scrollarea__content',
  63155. "optionsArr": optionsArr,
  63156. "triangleBtn": triangleBtn,
  63157. "dropDownTopContainer": dropDownTopContainer
  63158. };
  63159. this._createDropDownBox(createDropDownBoxParam);
  63160. this.rootContainer = dropDownContainer;
  63161. }
  63162. /**
  63163. * @function SuperMap.Components.DropDownBox.prototype._createDropDownBox
  63164. * @description 创建下拉框。
  63165. * @private
  63166. */
  63167. }, {
  63168. key: "_createDropDownBox",
  63169. value: function _createDropDownBox(createDropDownBoxParam) {
  63170. var dropDownBox = createDropDownBoxParam.parentEle;
  63171. var dropDownTopContainer = createDropDownBoxParam.dropDownTopContainer;
  63172. var dropDownContent = document.createElement('div');
  63173. dropDownContent.className = createDropDownBoxParam.dropDownContent[0];
  63174. dropDownBox.appendChild(dropDownContent);
  63175. var scrollareaContent = document.createElement('div');
  63176. scrollareaContent.className = createDropDownBoxParam.scrollareaContent;
  63177. dropDownContent.appendChild(scrollareaContent);
  63178. var optionsArr = createDropDownBoxParam.optionsArr;
  63179. for (var i = 0; i < optionsArr.length; i++) {
  63180. this._createDropDownOption(optionsArr[i], scrollareaContent);
  63181. } // 下拉框显示 & 隐藏事件
  63182. var triangleBtn = createDropDownBoxParam.triangleBtn;
  63183. this._dropDownClickEvent(dropDownBox, dropDownContent, triangleBtn);
  63184. this._eleOnblur(dropDownBox, dropDownContent, triangleBtn); // 下拉框 options 点击事件
  63185. var scrollareaOptions = scrollareaContent.children;
  63186. var _loop = function _loop(_i) {
  63187. scrollareaOptions[_i].onclick = function () {
  63188. dropDownTopContainer.innerHTML = scrollareaOptions[_i].outerHTML; //evt.stopPropagation();
  63189. };
  63190. };
  63191. for (var _i = 0; _i < scrollareaOptions.length; _i++) {
  63192. _loop(_i);
  63193. }
  63194. }
  63195. /**
  63196. * @function SuperMap.Components.DropDownBox.prototype._createDropDownOption
  63197. * @description 创建下拉框子元素。
  63198. * @private
  63199. */
  63200. }, {
  63201. key: "_createDropDownOption",
  63202. value: function _createDropDownOption(data, parentElement) {
  63203. var ele = document.createElement('div');
  63204. ele.className = 'component-dropdownbox__item';
  63205. var dataItem = data;
  63206. if (dataItem['dataValue']) {
  63207. ele.setAttribute('data-value', dataItem['dataValue']);
  63208. }
  63209. parentElement.appendChild(ele);
  63210. var imgContainer = document.createElement('div');
  63211. imgContainer.className = 'component-dropdownbox__item__img';
  63212. ele.appendChild(imgContainer);
  63213. var img = document.createElement('div');
  63214. if (dataItem.icon.className) {
  63215. img.className = dataItem.icon.className;
  63216. }
  63217. if (dataItem.icon.background) {
  63218. img.style.background = dataItem.icon.background;
  63219. }
  63220. imgContainer.appendChild(img);
  63221. var title = document.createElement('div');
  63222. title.className = 'component-dropdownbox__item__title';
  63223. title.title = dataItem.title;
  63224. title.innerHTML = dataItem.title;
  63225. ele.appendChild(title);
  63226. var remark = document.createElement('div');
  63227. remark.className = 'component-dropdownbox__item__remark';
  63228. remark.title = dataItem.remark;
  63229. remark.innerHTML = dataItem.remark;
  63230. ele.appendChild(remark);
  63231. }
  63232. /**
  63233. * @function SuperMap.Components.DropDownBox.prototype._dropDownClickEvent
  63234. * @description 下拉框点击事件。
  63235. * @private
  63236. */
  63237. }, {
  63238. key: "_dropDownClickEvent",
  63239. value: function _dropDownClickEvent(eventElement, contentElement, triangleBtn) {
  63240. eventElement.onclick = function (e) {
  63241. if (contentElement.style.display === "block") {
  63242. contentElement.style.display = "none";
  63243. triangleBtn.className = "component-triangle-down-img";
  63244. } else {
  63245. contentElement.style.display = "block";
  63246. triangleBtn.className = "triangle-up-img";
  63247. }
  63248. e.preventDefault();
  63249. e.stopPropagation();
  63250. };
  63251. eventElement.onmousedown = function (evt) {
  63252. //console.log('dropdownbox onmousedown '+evt.target.className);
  63253. if (evt.target !== this) {
  63254. this.focus();
  63255. evt.preventDefault();
  63256. evt.stopPropagation();
  63257. }
  63258. };
  63259. }
  63260. /**
  63261. * @function SuperMap.Components.DropDownBox.prototype._eleOnblur
  63262. * @description 下拉框失焦事件。
  63263. * @private
  63264. */
  63265. }, {
  63266. key: "_eleOnblur",
  63267. value: function _eleOnblur(eventElement, contentElement, triangleBtn) {
  63268. eventElement.onblur = function () {
  63269. contentElement.style.display = "none";
  63270. triangleBtn.className = "component-triangle-down-img";
  63271. };
  63272. }
  63273. /**
  63274. * @function SuperMap.Components.DropDownBox.prototype._createElement
  63275. * @description 通用创建元素。
  63276. * @private
  63277. */
  63278. }, {
  63279. key: "_createElement",
  63280. value: function _createElement(tagName, className, parentEle) {
  63281. var ele = document.createElement(tagName || 'div');
  63282. className && (ele.className = className);
  63283. parentEle && parentEle.appendChild(ele);
  63284. return ele;
  63285. }
  63286. }]);
  63287. return DropDownBox;
  63288. }(TemplateBase);
  63289. SuperMap.Components.DropDownBox = DropDownBox;
  63290. ;// CONCATENATED MODULE: ./src/common/components/templates/PopContainer.js
  63291. function PopContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PopContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { PopContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PopContainer_typeof(obj); }
  63292. function PopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63293. 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); } }
  63294. function PopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  63295. 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 } }); if (superClass) PopContainer_setPrototypeOf(subClass, superClass); }
  63296. function PopContainer_setPrototypeOf(o, p) { PopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PopContainer_setPrototypeOf(o, p); }
  63297. 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); }; }
  63298. function PopContainer_possibleConstructorReturn(self, call) { if (call && (PopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PopContainer_assertThisInitialized(self); }
  63299. function PopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63300. function PopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63301. function PopContainer_getPrototypeOf(o) { PopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PopContainer_getPrototypeOf(o); }
  63302. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63303. * This program are made available under the terms of the Apache License, Version 2.0
  63304. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63305. /**
  63306. * @class SuperMap.Components.PopContainer
  63307. * @classdesc 弹框组件。
  63308. * @version 9.1.1
  63309. * @param {Object} options - 组件配置参数。
  63310. * @param {string} options.id - 组件 dom 元素 id。
  63311. * @param {string} options.title - 弹框组件名称。
  63312. * @extends {SuperMap.Components.TemplateBase}
  63313. * @category Components Common
  63314. */
  63315. var PopContainer = /*#__PURE__*/function (_TemplateBase) {
  63316. PopContainer_inherits(PopContainer, _TemplateBase);
  63317. var _super = PopContainer_createSuper(PopContainer);
  63318. function PopContainer(options) {
  63319. var _this;
  63320. PopContainer_classCallCheck(this, PopContainer);
  63321. options = options ? options : {};
  63322. _this = _super.call(this, options);
  63323. options.title = options.title ? options.title : "";
  63324. _this._initView(options.title);
  63325. return _this;
  63326. }
  63327. /**
  63328. * @private
  63329. * @override
  63330. */
  63331. PopContainer_createClass(PopContainer, [{
  63332. key: "_initView",
  63333. value: function _initView(titile) {
  63334. var container = document.createElement("div");
  63335. container.setAttribute("class", "component-popcontainer"); //header
  63336. var header = document.createElement("div");
  63337. header.setAttribute("class", "component-popcontainer__header");
  63338. var title = document.createElement("label");
  63339. title.setAttribute("class", "component-popcontainer__header__title");
  63340. title.innerHTML = titile;
  63341. header.appendChild(title);
  63342. var closeBtn = document.createElement("span");
  63343. closeBtn.setAttribute("class", "supermapol-icons-clear component-popcontainer__header__close");
  63344. closeBtn.onclick = this.closeView.bind(this);
  63345. container.appendChild(closeBtn);
  63346. container.appendChild(header); //content
  63347. var content = document.createElement("div");
  63348. content.setAttribute("class", "component-popcontainer__content");
  63349. this.content = content;
  63350. container.appendChild(content);
  63351. this.rootContainer = container;
  63352. }
  63353. /**
  63354. * @function SuperMap.Components.PopContainer.prototype.appendContent
  63355. * @description 追加内容。
  63356. * @param {Element} dom - 内容元素。
  63357. */
  63358. }, {
  63359. key: "appendContent",
  63360. value: function appendContent(dom) {
  63361. this.content.appendChild(dom);
  63362. }
  63363. }]);
  63364. return PopContainer;
  63365. }(TemplateBase);
  63366. SuperMap.Components.PopContainer = PopContainer;
  63367. ;// CONCATENATED MODULE: ./src/common/components/templates/AttributesPopContainer.js
  63368. function AttributesPopContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { AttributesPopContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { AttributesPopContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return AttributesPopContainer_typeof(obj); }
  63369. function AttributesPopContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63370. 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); } }
  63371. function AttributesPopContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) AttributesPopContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) AttributesPopContainer_defineProperties(Constructor, staticProps); return Constructor; }
  63372. 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 } }); if (superClass) AttributesPopContainer_setPrototypeOf(subClass, superClass); }
  63373. function AttributesPopContainer_setPrototypeOf(o, p) { AttributesPopContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return AttributesPopContainer_setPrototypeOf(o, p); }
  63374. 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); }; }
  63375. function AttributesPopContainer_possibleConstructorReturn(self, call) { if (call && (AttributesPopContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return AttributesPopContainer_assertThisInitialized(self); }
  63376. function AttributesPopContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63377. function AttributesPopContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63378. function AttributesPopContainer_getPrototypeOf(o) { AttributesPopContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return AttributesPopContainer_getPrototypeOf(o); }
  63379. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63380. * This program are made available under the terms of the Apache License, Version 2.0
  63381. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63382. /**
  63383. * @class SuperMap.Components.AttributesPopContainer
  63384. * @classdesc 属性弹框组件
  63385. * @version 9.1.1
  63386. * @param {Object} options - 组件配置参数。
  63387. * @param {string} options.id - 组件 dom 元素 id。
  63388. * @param {Object} options.title - 属性弹框组件名称。
  63389. * @param {Object} options.attributes - 组件需要显示的属性内容。
  63390. * @extends {SuperMap.Components.PopContainer}
  63391. * @category Components Common
  63392. */
  63393. var AttributesPopContainer = /*#__PURE__*/function (_PopContainer) {
  63394. AttributesPopContainer_inherits(AttributesPopContainer, _PopContainer);
  63395. var _super = AttributesPopContainer_createSuper(AttributesPopContainer);
  63396. function AttributesPopContainer(options) {
  63397. var _this;
  63398. AttributesPopContainer_classCallCheck(this, AttributesPopContainer);
  63399. //默认为属性:
  63400. options.title = options.title ? options.title : "属性";
  63401. _this = _super.call(this, options);
  63402. _this.rootContainer.firstChild.hidden = true;
  63403. options.attributes = options.attributes ? options.attributes : [];
  63404. _this._createAttributesTable(options.attributes);
  63405. return _this;
  63406. }
  63407. AttributesPopContainer_createClass(AttributesPopContainer, [{
  63408. key: "_createAttributesTable",
  63409. value: function _createAttributesTable(attributes) {
  63410. var table = document.createElement("table");
  63411. table.setAttribute("class", "component-popcontainer__content__table");
  63412. var tbody = document.createElement("tbody");
  63413. var single = true;
  63414. for (var name in attributes) {
  63415. var tr = document.createElement("tr");
  63416. if (single) {
  63417. tr.setAttribute("class", "component-popcontainer__content__td--color");
  63418. }
  63419. var title = document.createElement("td");
  63420. var titleSpan = document.createElement("Span");
  63421. titleSpan.innerHTML = name;
  63422. title.appendChild(titleSpan);
  63423. var value = document.createElement("td");
  63424. value.innerHTML = attributes[name];
  63425. tr.appendChild(title);
  63426. tr.appendChild(value);
  63427. tbody.appendChild(tr);
  63428. single = !single;
  63429. }
  63430. table.appendChild(tbody);
  63431. this.appendContent(table);
  63432. }
  63433. }]);
  63434. return AttributesPopContainer;
  63435. }(PopContainer);
  63436. SuperMap.Components.AttributesPopContainer = AttributesPopContainer;
  63437. ;// CONCATENATED MODULE: ./src/common/components/templates/IndexTabsPageContainer.js
  63438. function IndexTabsPageContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { IndexTabsPageContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { IndexTabsPageContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return IndexTabsPageContainer_typeof(obj); }
  63439. function IndexTabsPageContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63440. 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); } }
  63441. function IndexTabsPageContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) IndexTabsPageContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) IndexTabsPageContainer_defineProperties(Constructor, staticProps); return Constructor; }
  63442. 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 } }); if (superClass) IndexTabsPageContainer_setPrototypeOf(subClass, superClass); }
  63443. function IndexTabsPageContainer_setPrototypeOf(o, p) { IndexTabsPageContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return IndexTabsPageContainer_setPrototypeOf(o, p); }
  63444. 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); }; }
  63445. function IndexTabsPageContainer_possibleConstructorReturn(self, call) { if (call && (IndexTabsPageContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return IndexTabsPageContainer_assertThisInitialized(self); }
  63446. function IndexTabsPageContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63447. function IndexTabsPageContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63448. function IndexTabsPageContainer_getPrototypeOf(o) { IndexTabsPageContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return IndexTabsPageContainer_getPrototypeOf(o); }
  63449. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63450. * This program are made available under the terms of the Apache License, Version 2.0
  63451. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63452. /**
  63453. * @class SuperMap.Components.IndexTabsPageContainer
  63454. * @description 标签索引组件。
  63455. * @version 9.1.1
  63456. * @param {Object} options - 可选参数。
  63457. * @param {string} options.id - 组件 dom 元素 id。
  63458. * @category Components Common
  63459. * @extends {SuperMap.Components.TemplateBase}
  63460. */
  63461. var IndexTabsPageContainer = /*#__PURE__*/function (_TemplateBase) {
  63462. IndexTabsPageContainer_inherits(IndexTabsPageContainer, _TemplateBase);
  63463. var _super = IndexTabsPageContainer_createSuper(IndexTabsPageContainer);
  63464. function IndexTabsPageContainer(options) {
  63465. var _this;
  63466. IndexTabsPageContainer_classCallCheck(this, IndexTabsPageContainer);
  63467. _this = _super.call(this, options);
  63468. _this._initView();
  63469. return _this;
  63470. }
  63471. /**
  63472. * @private
  63473. * @override
  63474. */
  63475. IndexTabsPageContainer_createClass(IndexTabsPageContainer, [{
  63476. key: "_initView",
  63477. value: function _initView() {
  63478. var container = document.createElement("div");
  63479. container.setAttribute("class", "component-tabpage");
  63480. var header = document.createElement("ul");
  63481. this.header = header;
  63482. var content = document.createElement("div");
  63483. content.setAttribute("class", "component-tabpage__content");
  63484. this.content = content;
  63485. container.appendChild(header);
  63486. container.appendChild(content);
  63487. this.rootContainer = container;
  63488. }
  63489. /**
  63490. * @function SuperMap.Components.IndexTabsPageContainer.prototype.setTabs
  63491. * @description 设置标签元素。
  63492. * @param {Array.<Element>} tabs
  63493. */
  63494. }, {
  63495. key: "setTabs",
  63496. value: function setTabs(tabs) {
  63497. this.removeAllTabs();
  63498. this.appendTabs(tabs);
  63499. }
  63500. /**
  63501. * @function SuperMap.Components.IndexTabsPageContainer.prototype.appendTabs
  63502. * @description 追加标签元素。
  63503. * @param {Array.<Element>} tabs
  63504. */
  63505. }, {
  63506. key: "appendTabs",
  63507. value: function appendTabs(tabs) {
  63508. for (var i = 0; i < tabs.length; i++) {
  63509. var title = document.createElement("span");
  63510. title.index = i;
  63511. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  63512. title.onclick = this._changeTabsPage.bind(this);
  63513. var content = tabs[i].content;
  63514. content.index = i;
  63515. content.hidden = true;
  63516. this.header.appendChild(title);
  63517. this.content.appendChild(content);
  63518. } //todo 确认是否两个子元素的 index 相互对应
  63519. //默认显示第一个标签对象
  63520. this.header.firstChild.setAttribute("class", "on");
  63521. this.content.firstChild.hidden = false;
  63522. }
  63523. /**
  63524. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeTab
  63525. * @description 删除某个标签页面。
  63526. * @param {number} index - 标签索引号。
  63527. */
  63528. }, {
  63529. key: "removeTab",
  63530. value: function removeTab(index) {
  63531. this.header.removeChild(this.header.children[index]);
  63532. this.content.removeChild(this.content.children[index]);
  63533. }
  63534. /**
  63535. * @function SuperMap.Components.IndexTabsPageContainer.prototype.removeAllTabs
  63536. * @description 删除所有标签。
  63537. */
  63538. }, {
  63539. key: "removeAllTabs",
  63540. value: function removeAllTabs() {
  63541. for (var i = this.header.children.length; i > 0; i--) {
  63542. this.header.removeChild(this.header.children[i]);
  63543. this.content.removeChild(this.content.children[i]);
  63544. }
  63545. }
  63546. }, {
  63547. key: "_changeTabsPage",
  63548. value: function _changeTabsPage(e) {
  63549. var index = e.target.index;
  63550. for (var i = 0; i < this.header.children.length; i++) {
  63551. this.header.children[i].setAttribute("class", "");
  63552. this.content.children[i].hidden = true;
  63553. if (i === index) {
  63554. this.header.children[i].setAttribute("class", "on");
  63555. this.content.children[i].hidden = false;
  63556. }
  63557. }
  63558. }
  63559. }]);
  63560. return IndexTabsPageContainer;
  63561. }(TemplateBase);
  63562. SuperMap.Components.IndexTabsPageContainer = IndexTabsPageContainer;
  63563. ;// CONCATENATED MODULE: ./src/common/components/templates/CityTabsPage.js
  63564. function CityTabsPage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { CityTabsPage_typeof = function _typeof(obj) { return typeof obj; }; } else { CityTabsPage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return CityTabsPage_typeof(obj); }
  63565. function CityTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63566. 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); } }
  63567. function CityTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) CityTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) CityTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  63568. 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 } }); if (superClass) CityTabsPage_setPrototypeOf(subClass, superClass); }
  63569. function CityTabsPage_setPrototypeOf(o, p) { CityTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return CityTabsPage_setPrototypeOf(o, p); }
  63570. 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); }; }
  63571. function CityTabsPage_possibleConstructorReturn(self, call) { if (call && (CityTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return CityTabsPage_assertThisInitialized(self); }
  63572. function CityTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63573. function CityTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63574. function CityTabsPage_getPrototypeOf(o) { CityTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return CityTabsPage_getPrototypeOf(o); }
  63575. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63576. * This program are made available under the terms of the Apache License, Version 2.0
  63577. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63578. /**
  63579. * @class SuperMap.Components.CityTabsPage
  63580. * @classdesc 城市地址匹配组件模板
  63581. * @version 9.1.1
  63582. * @param {Object} options - 组件配置参数。
  63583. * @param {string} options.id - 组件 dom 元素 id。
  63584. * @param {Object|Array.<string>} options.config - 城市名称配置列表,支持两种格式:{key1:{A:[],B:[]}, key2:{C:[],D:[]}} 或
  63585. * ["成都市","北京市"],用户可根据自己的项目需求进行配置
  63586. * @extends {SuperMap.Components.IndexTabsPageContainer}
  63587. * @category Components Common
  63588. */
  63589. var CityTabsPage = /*#__PURE__*/function (_IndexTabsPageContain) {
  63590. CityTabsPage_inherits(CityTabsPage, _IndexTabsPageContain);
  63591. var _super = CityTabsPage_createSuper(CityTabsPage);
  63592. function CityTabsPage(options) {
  63593. var _this;
  63594. CityTabsPage_classCallCheck(this, CityTabsPage);
  63595. _this = _super.call(this, options); //去掉默认的边框阴影样式:
  63596. _this.rootContainer.classList.add("component-citytabpage--noneBoxShadow");
  63597. _this.config = options.config; //header,若 config为城市名称数组,则直接加载内容
  63598. if (Util.isArray(_this.config)) {
  63599. _this.header.hidden = true;
  63600. _this._createCityItem("城市", _this.config);
  63601. _this.content.style.border = "none";
  63602. } else {
  63603. _this._createTabs();
  63604. _this.header.onclick = function (e) {
  63605. //关闭所有元素 是否有更简化的写法?
  63606. for (var i = 0; i < _this.header.children.length; i++) {
  63607. _this.header.children[i].setAttribute("class", "");
  63608. } //打开点击内容元素
  63609. e.target.setAttribute("class", "on");
  63610. _this._createCityContent(e.target.innerHTML);
  63611. };
  63612. }
  63613. return _this;
  63614. }
  63615. /**
  63616. * @function SuperMap.Components.CityTabsPage.prototype._createTabs
  63617. * @description 创建 Tabs
  63618. * @private
  63619. */
  63620. CityTabsPage_createClass(CityTabsPage, [{
  63621. key: "_createTabs",
  63622. value: function _createTabs() {
  63623. //header
  63624. if (Util.isArray(this.config)) {
  63625. for (var i = 0; i < this.config.length; i++) {
  63626. var innerHTML = "";
  63627. for (var key in this.config[i]) {
  63628. innerHTML += key;
  63629. }
  63630. var li = document.createElement("li");
  63631. li.innerHTML = innerHTML;
  63632. this.header.appendChild(li);
  63633. }
  63634. } else {
  63635. for (var _key in this.config) {
  63636. var _li = document.createElement("li");
  63637. _li.innerHTML = _key;
  63638. this.header.appendChild(_li);
  63639. }
  63640. }
  63641. this.header.firstChild.setAttribute("class", "on");
  63642. this._createCityContent(this.header.firstChild.innerHTML);
  63643. }
  63644. /**
  63645. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  63646. * @description 创建列表容器
  63647. * @private
  63648. */
  63649. }, {
  63650. key: "_createCityContent",
  63651. value: function _createCityContent(keyName) {
  63652. //清除元素:
  63653. for (var i = this.content.children.length; i > 0; i--) {
  63654. this.content.removeChild(this.content.children[i - 1]);
  63655. } //创建对应元素
  63656. var cities = this.config[keyName];
  63657. for (var key in cities) {
  63658. this._createCityItem(key, cities[key]);
  63659. }
  63660. }
  63661. /**
  63662. * @function SuperMap.Components.CityTabsPage.prototype._createCityContent
  63663. * @description 创建列表容器
  63664. * @private
  63665. */
  63666. }, {
  63667. key: "_createCityItem",
  63668. value: function _createCityItem(key, cities) {
  63669. var city = document.createElement("div");
  63670. var cityClass = document.createElement("div");
  63671. cityClass.setAttribute("class", "component-citytabpag__py-key");
  63672. cityClass.innerHTML = key;
  63673. city.appendChild(cityClass);
  63674. var cityContent = document.createElement("div");
  63675. cityContent.setAttribute("class", "component-citytabpag__content");
  63676. for (var i = 0; i < cities.length; i++) {
  63677. var span = document.createElement("span");
  63678. span.innerHTML = cities[i];
  63679. cityContent.appendChild(span);
  63680. } //HOT 元素长度单独微调:
  63681. if (key === "HOT") {
  63682. cityContent.style.width = "428px";
  63683. }
  63684. city.appendChild(cityContent);
  63685. this.content.appendChild(city);
  63686. }
  63687. }]);
  63688. return CityTabsPage;
  63689. }(IndexTabsPageContainer);
  63690. SuperMap.Components.CityTabsPage = CityTabsPage;
  63691. ;// CONCATENATED MODULE: ./src/common/components/templates/NavTabsPage.js
  63692. function NavTabsPage_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NavTabsPage_typeof = function _typeof(obj) { return typeof obj; }; } else { NavTabsPage_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NavTabsPage_typeof(obj); }
  63693. function NavTabsPage_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63694. 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); } }
  63695. function NavTabsPage_createClass(Constructor, protoProps, staticProps) { if (protoProps) NavTabsPage_defineProperties(Constructor.prototype, protoProps); if (staticProps) NavTabsPage_defineProperties(Constructor, staticProps); return Constructor; }
  63696. 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 } }); if (superClass) NavTabsPage_setPrototypeOf(subClass, superClass); }
  63697. function NavTabsPage_setPrototypeOf(o, p) { NavTabsPage_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NavTabsPage_setPrototypeOf(o, p); }
  63698. 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); }; }
  63699. function NavTabsPage_possibleConstructorReturn(self, call) { if (call && (NavTabsPage_typeof(call) === "object" || typeof call === "function")) { return call; } return NavTabsPage_assertThisInitialized(self); }
  63700. function NavTabsPage_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63701. function NavTabsPage_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63702. function NavTabsPage_getPrototypeOf(o) { NavTabsPage_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NavTabsPage_getPrototypeOf(o); }
  63703. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63704. * This program are made available under the terms of the Apache License, Version 2.0
  63705. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63706. /**
  63707. * @class SuperMap.Components.NavTabsPage
  63708. * @classdesc 标签页面组件。
  63709. * @version 9.1.1
  63710. * @param {Object} options - 组件配置参数。
  63711. * @param {string} optionsArr.id - 组件 dom 元素 id。
  63712. * @param {Array.<Object>} [options.tabs=[]] - 标签对象数组,形如:[{title: "",content: HTMLElement}],初始时,传入则创建页面。
  63713. * @extends {SuperMap.Components.TemplateBase}
  63714. * @category Components Common
  63715. */
  63716. // todo 思考拆分的控件应该以哪种方式使用
  63717. var NavTabsPage = /*#__PURE__*/function (_TemplateBase) {
  63718. NavTabsPage_inherits(NavTabsPage, _TemplateBase);
  63719. var _super = NavTabsPage_createSuper(NavTabsPage);
  63720. function NavTabsPage(options) {
  63721. var _this;
  63722. NavTabsPage_classCallCheck(this, NavTabsPage);
  63723. _this = _super.call(this, options);
  63724. _this.navTabsTitle = null;
  63725. _this.navTabsContent = null;
  63726. options.tabs = options.tabs ? options.tabs : [];
  63727. _this._initView(options.tabs);
  63728. return _this;
  63729. }
  63730. /**
  63731. * @override
  63732. * @private
  63733. */
  63734. NavTabsPage_createClass(NavTabsPage, [{
  63735. key: "_initView",
  63736. value: function _initView(tabs) {
  63737. var navTabsPage = document.createElement("div");
  63738. navTabsPage.setAttribute("class", "component-navtabspage"); //关闭按钮
  63739. var closeBtn = document.createElement("span");
  63740. closeBtn.setAttribute("class", "supermapol-icons-close");
  63741. closeBtn.onclick = this.closeView.bind(this);
  63742. navTabsPage.appendChild(closeBtn); //标签
  63743. var navTabsTitle = document.createElement("div");
  63744. this.navTabsTitle = navTabsTitle;
  63745. navTabsTitle.setAttribute("class", "component-navtabspage__title");
  63746. navTabsPage.appendChild(navTabsTitle); //内容
  63747. var navTabsContent = document.createElement("div");
  63748. this.navTabsContent = navTabsContent;
  63749. navTabsContent.setAttribute("class", "component-navtabspage__content");
  63750. navTabsPage.appendChild(navTabsContent); //若 tabs 初始传入值,则
  63751. if (tabs.length > 0) {
  63752. this.appendTabs(tabs);
  63753. }
  63754. this.rootContainer = navTabsPage;
  63755. }
  63756. /**
  63757. * @function SuperMap.Components.NavTabsPage.prototype.setTabs
  63758. * @description 设置标签。
  63759. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  63760. */
  63761. }, {
  63762. key: "setTabs",
  63763. value: function setTabs(tabs) {
  63764. this.removeAllTabs();
  63765. this.appendTabs(tabs);
  63766. }
  63767. /**
  63768. * @function SuperMap.Components.NavTabsPage.prototype.appendTabs
  63769. * @description 添加标签页面。
  63770. * @param {Array.<Object>} tabs - 标签对象数组,形如:[{title: "",content: {}}]。
  63771. */
  63772. }, {
  63773. key: "appendTabs",
  63774. value: function appendTabs(tabs) {
  63775. for (var i = 0; i < tabs.length; i++) {
  63776. var title = document.createElement("span");
  63777. title.index = i;
  63778. title.appendChild(document.createTextNode(tabs[i].title)); //绑定标签切换对应页面:
  63779. title.onclick = this._changeTabsPage.bind(this);
  63780. var content = tabs[i].content;
  63781. content.index = i;
  63782. content.hidden = true;
  63783. this.navTabsTitle.appendChild(title);
  63784. this.navTabsContent.appendChild(content);
  63785. } //todo 确认是否两个子元素的 index 相互对应
  63786. //默认显示第一个标签对象
  63787. this.navTabsTitle.firstChild.setAttribute("class", "component-navtabspage__tabs--select");
  63788. this.navTabsContent.firstChild.hidden = false;
  63789. }
  63790. /**
  63791. * @function SuperMap.Components.NavTabsPage.prototype.removeTab
  63792. * @description 删除某个标签页面。
  63793. * @param {number} index - 标签索引号。
  63794. */
  63795. }, {
  63796. key: "removeTab",
  63797. value: function removeTab(index) {
  63798. this.navTabsTitle.removeChild(this.navTabsTitle.children[index]);
  63799. this.navTabsContent.removeChild(this.navTabsContent.children[index]);
  63800. }
  63801. /**
  63802. * @function SuperMap.Components.NavTabsPage.prototype.removeAllTabs
  63803. * @description 删除所有标签。
  63804. */
  63805. }, {
  63806. key: "removeAllTabs",
  63807. value: function removeAllTabs() {
  63808. for (var i = this.navTabsTitle.children.length; i > 0; i--) {
  63809. this.navTabsTitle.removeChild(this.navTabsTitle.children[i]);
  63810. this.navTabsContent.removeChild(this.navTabsContent.children[i]);
  63811. }
  63812. }
  63813. }, {
  63814. key: "_changeTabsPage",
  63815. value: function _changeTabsPage(e) {
  63816. var index = e.target.index;
  63817. for (var i = 0; i < this.navTabsTitle.children.length; i++) {
  63818. this.navTabsTitle.children[i].setAttribute("class", "");
  63819. this.navTabsContent.children[i].hidden = true;
  63820. if (i === index) {
  63821. this.navTabsTitle.children[i].setAttribute("class", "component-navtabspage__tabs--select");
  63822. this.navTabsContent.children[i].hidden = false;
  63823. }
  63824. }
  63825. }
  63826. }]);
  63827. return NavTabsPage;
  63828. }(TemplateBase);
  63829. SuperMap.Components.NavTabsPage = NavTabsPage;
  63830. ;// CONCATENATED MODULE: ./src/common/components/templates/PaginationContainer.js
  63831. function PaginationContainer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { PaginationContainer_typeof = function _typeof(obj) { return typeof obj; }; } else { PaginationContainer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return PaginationContainer_typeof(obj); }
  63832. function PaginationContainer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  63833. 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); } }
  63834. function PaginationContainer_createClass(Constructor, protoProps, staticProps) { if (protoProps) PaginationContainer_defineProperties(Constructor.prototype, protoProps); if (staticProps) PaginationContainer_defineProperties(Constructor, staticProps); return Constructor; }
  63835. 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 } }); if (superClass) PaginationContainer_setPrototypeOf(subClass, superClass); }
  63836. function PaginationContainer_setPrototypeOf(o, p) { PaginationContainer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return PaginationContainer_setPrototypeOf(o, p); }
  63837. 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); }; }
  63838. function PaginationContainer_possibleConstructorReturn(self, call) { if (call && (PaginationContainer_typeof(call) === "object" || typeof call === "function")) { return call; } return PaginationContainer_assertThisInitialized(self); }
  63839. function PaginationContainer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  63840. function PaginationContainer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  63841. function PaginationContainer_getPrototypeOf(o) { PaginationContainer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return PaginationContainer_getPrototypeOf(o); }
  63842. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  63843. * This program are made available under the terms of the Apache License, Version 2.0
  63844. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  63845. /**
  63846. * @class SuperMap.Components.PaginationContainer
  63847. * @classdesc 分页组件模板。
  63848. * @version 9.1.1
  63849. * @param {Object} options - 组件配置参数。
  63850. * @param {string} optionsArr.id - 组件 dom 元素 id。
  63851. * @param {HTMLElement} options.contents - 页面填充的 DOM 元素对象。
  63852. * @param {number} options.pageCounts - 页数。
  63853. * @extends {SuperMap.Components.TemplateBase}
  63854. * @category Components Common
  63855. */
  63856. var PaginationContainer = /*#__PURE__*/function (_TemplateBase) {
  63857. PaginationContainer_inherits(PaginationContainer, _TemplateBase);
  63858. var _super = PaginationContainer_createSuper(PaginationContainer);
  63859. function PaginationContainer(options) {
  63860. var _this;
  63861. PaginationContainer_classCallCheck(this, PaginationContainer);
  63862. options = options ? options : {};
  63863. _this = _super.call(this, options);
  63864. _this.currentPage = 0;
  63865. _this.pageNumberLis = [];
  63866. _this.currentPageNumberLis = [];
  63867. _this.linkageEvent = null;
  63868. options.contents = options.contents ? options.contents : null;
  63869. options.pageCounts = options.pageCounts ? options.pageCounts : 0;
  63870. _this._initView(options.contents, options.pageCounts);
  63871. return _this;
  63872. }
  63873. /**
  63874. * @function SuperMap.Components.PaginationContainer.prototype.setLinkageEvent
  63875. * @description 设置页面联动方法。
  63876. * @param {function} linkageEvent - 联动方法,实现指定功能。
  63877. */
  63878. PaginationContainer_createClass(PaginationContainer, [{
  63879. key: "setLinkageEvent",
  63880. value: function setLinkageEvent(linkageEvent) {
  63881. this.linkageEvent = linkageEvent;
  63882. }
  63883. /**
  63884. * @private
  63885. * @override
  63886. */
  63887. }, {
  63888. key: "_initView",
  63889. value: function _initView(contents, pageCounts) {
  63890. var container = document.createElement("div");
  63891. container.setAttribute("class", "component-pagination"); //content
  63892. var content = document.createElement("div");
  63893. content.setAttribute("class", "component-pagination__content");
  63894. container.appendChild(content);
  63895. this.content = content; //link
  63896. var link = document.createElement("ul");
  63897. link.setAttribute("class", "component-pagination__link");
  63898. link.onclick = this._changePageEvent.bind(this);
  63899. container.appendChild(link);
  63900. this._createLink(link);
  63901. this.link = link; //填充内容:
  63902. if (contents) {
  63903. this.setContent(contents);
  63904. }
  63905. if (pageCounts !== 0) {
  63906. this.setPageLink(pageCounts);
  63907. }
  63908. this.rootContainer = container;
  63909. }
  63910. /**---------以下是页面相关操作 **/
  63911. /**
  63912. * @function SuperMap.Components.PaginationContainer.prototype.setContent
  63913. * @description 设置页面内容。
  63914. * @param {Element} element - 页面内容元素。
  63915. */
  63916. }, {
  63917. key: "setContent",
  63918. value: function setContent(element) {
  63919. this.clearContent();
  63920. this.appendContent(element);
  63921. }
  63922. /**
  63923. * @function SuperMap.Components.PaginationContainer.prototype.appendContent
  63924. * @description 追加内容。
  63925. * @param {Element} element - 页面内容元素。
  63926. */
  63927. }, {
  63928. key: "appendContent",
  63929. value: function appendContent(element) {
  63930. this.content.appendChild(element);
  63931. }
  63932. /**
  63933. * @function SuperMap.Components.PaginationContainer.prototype.clearContent
  63934. * @description 清空内容元素。
  63935. */
  63936. }, {
  63937. key: "clearContent",
  63938. value: function clearContent() {
  63939. for (var i = this.content.children.length - 1; i >= 0; i--) {
  63940. this.content.removeChild(this.content.children[i]);
  63941. }
  63942. }
  63943. /** -----以下是页码相关的操作:**/
  63944. /**
  63945. * @function SuperMap.Components.PaginationContainer.prototype.setPageLink
  63946. * @description 设置页码数。
  63947. * @param {number} pageNumber - 页码数。
  63948. */
  63949. }, {
  63950. key: "setPageLink",
  63951. value: function setPageLink(pageNumber) {
  63952. //清空当前页码
  63953. this.pageNumberLis = [];
  63954. this.currentPageNumberLis = [];
  63955. this.clearPageLink(); //创建页码
  63956. this._createPageLi(pageNumber); //添加页码到页码列表
  63957. this._appendPageLink();
  63958. }
  63959. /**
  63960. * @description 创建页码。
  63961. * @param pageNumber
  63962. * @private
  63963. */
  63964. }, {
  63965. key: "_createPageLi",
  63966. value: function _createPageLi(pageNumber) {
  63967. for (var i = 0; i < pageNumber; i++) {
  63968. var pageLi = document.createElement("li");
  63969. pageLi.innerHTML = i + 1;
  63970. /*const liContent = document.createElement("span");
  63971. liContent.innerHTML = i + 1;*/
  63972. // pageLi.appendChild(liContent);
  63973. this.pageNumberLis.push(pageLi);
  63974. }
  63975. this.pageNumberLis[0].setAttribute("class", "active");
  63976. this.currentPage = 1;
  63977. if (pageNumber < 5) {
  63978. this.currentPageNumberLis = this.pageNumberLis;
  63979. } else {
  63980. for (var _i = 0; _i < 5; _i++) {
  63981. this.currentPageNumberLis.push(this.pageNumberLis[_i]);
  63982. }
  63983. }
  63984. }
  63985. /**
  63986. * @description 添加页码到页码列表。
  63987. * @private
  63988. */
  63989. }, {
  63990. key: "_appendPageLink",
  63991. value: function _appendPageLink() {
  63992. //todo 如何插入中间
  63993. for (var i = 0; i < this.currentPageNumberLis.length; i++) {
  63994. this.link.insertBefore(this.currentPageNumberLis[i], this.link.childNodes[this.link.children.length - 2]);
  63995. }
  63996. for (var _i2 = 0; _i2 < this.currentPageNumberLis.length; _i2++) {
  63997. //清空 active 状态
  63998. this.currentPageNumberLis[_i2].setAttribute("class", ""); //给当前选中的 li 赋值 active 状态
  63999. if (Number(this.currentPageNumberLis[_i2].innerHTML) === this.currentPage) {
  64000. this.currentPageNumberLis[_i2].setAttribute("class", "active");
  64001. }
  64002. } //根据 currentPage 改变按钮状态
  64003. this._changeDisableState();
  64004. if (this.linkageEvent) {
  64005. this.linkageEvent(this.currentPage);
  64006. }
  64007. }
  64008. /**
  64009. * @function SuperMap.Components.PaginationContainer.prototype.clearPageLink
  64010. * @description 清除页码列表。
  64011. */
  64012. }, {
  64013. key: "clearPageLink",
  64014. value: function clearPageLink() {
  64015. for (var i = this.link.children.length - 3; i > 1; i--) {
  64016. this.link.removeChild(this.link.children[i]);
  64017. }
  64018. }
  64019. /**
  64020. * @description 创建页码按钮。
  64021. * @param ul
  64022. * @private
  64023. */
  64024. }, {
  64025. key: "_createLink",
  64026. value: function _createLink(ul) {
  64027. for (var i = 0; i < 4; i++) {
  64028. var li = document.createElement("li");
  64029. li.setAttribute("class", "disable");
  64030. var liContent = document.createElement("span");
  64031. li.appendChild(liContent);
  64032. if (i === 0) {
  64033. liContent.id = "first";
  64034. liContent.setAttribute("class", "supermapol-icons-first");
  64035. } else if (i === 1) {
  64036. liContent.id = "prev";
  64037. liContent.setAttribute("class", "supermapol-icons-prev");
  64038. } else if (i === 2) {
  64039. liContent.id = "next";
  64040. liContent.setAttribute("class", "supermapol-icons-next");
  64041. } else if (i === 3) {
  64042. liContent.id = "last";
  64043. liContent.setAttribute("class", "supermapol-icons-last");
  64044. }
  64045. ul.appendChild(li);
  64046. }
  64047. }
  64048. /**
  64049. * @description 点击页码事件。
  64050. * @param e
  64051. * @private
  64052. */
  64053. }, {
  64054. key: "_changePageEvent",
  64055. value: function _changePageEvent(e) {
  64056. //todo
  64057. var trigger = e.target; //若列表禁用,点击无效
  64058. if (trigger.parentElement.classList[0] === "disable") {
  64059. return;
  64060. }
  64061. var targetLi;
  64062. if (trigger.id) {
  64063. targetLi = trigger.id;
  64064. } else if (Number(trigger.innerHTML)) {
  64065. targetLi = Number(trigger.innerHTML);
  64066. } else {
  64067. return;
  64068. } //页码预处理:
  64069. this._prePageNum(targetLi); //根据 currentPageNumberLis 创建页码列表
  64070. this.clearPageLink();
  64071. this._appendPageLink();
  64072. }
  64073. /**
  64074. * @description 根据 currentPage 改变按钮状态。
  64075. * @private
  64076. */
  64077. }, {
  64078. key: "_changeDisableState",
  64079. value: function _changeDisableState() {
  64080. this.link.children[0].setAttribute("class", "");
  64081. this.link.children[1].setAttribute("class", "");
  64082. this.link.children[this.link.children.length - 1].setAttribute("class", "");
  64083. this.link.children[this.link.children.length - 2].setAttribute("class", "");
  64084. if (this.currentPage === 1) {
  64085. this.link.children[0].setAttribute("class", "disable");
  64086. this.link.children[1].setAttribute("class", "disable");
  64087. }
  64088. if (this.currentPage === this.pageNumberLis.length) {
  64089. this.link.children[this.link.children.length - 1].setAttribute("class", "disable");
  64090. this.link.children[this.link.children.length - 2].setAttribute("class", "disable");
  64091. }
  64092. }
  64093. /**
  64094. * @description 根据点击页码列表事件准备需展现的页码列表。
  64095. * @param {string|number} targetLi - 被点击的列表对象 id 或 被点击的页码值。
  64096. * @private
  64097. */
  64098. }, {
  64099. key: "_prePageNum",
  64100. value: function _prePageNum(targetLi) {
  64101. var currentPageNumberLis = [];
  64102. if (targetLi === "first") {
  64103. this.currentPage = 1;
  64104. } else if (targetLi === "last") {
  64105. this.currentPage = this.pageNumberLis.length;
  64106. } else if (targetLi === "prev") {
  64107. this.currentPage = this.currentPage - 1;
  64108. } else if (targetLi === "next") {
  64109. this.currentPage = this.currentPage + 1;
  64110. } else {
  64111. this.currentPage = targetLi;
  64112. }
  64113. if (this.pageNumberLis.length <= 5) {
  64114. for (var i = 0; i < this.pageNumberLis.length; i++) {
  64115. currentPageNumberLis.push(this.pageNumberLis[i]);
  64116. }
  64117. } else {
  64118. //当前点击前三,都取前五
  64119. if (this.currentPage <= 3) {
  64120. for (var _i3 = 0; _i3 < 5; _i3++) {
  64121. currentPageNumberLis.push(this.pageNumberLis[_i3]);
  64122. }
  64123. } else if (this.currentPage >= this.pageNumberLis.length - 3) {
  64124. //点击后三,都取后5
  64125. for (var _i4 = this.pageNumberLis.length - 5; _i4 < this.pageNumberLis.length; _i4++) {
  64126. currentPageNumberLis.push(this.pageNumberLis[_i4]);
  64127. }
  64128. } else {
  64129. //其他,取中间:
  64130. for (var _i5 = this.currentPage - 3; _i5 <= this.currentPage + 1; _i5++) {
  64131. currentPageNumberLis.push(this.pageNumberLis[_i5]);
  64132. }
  64133. }
  64134. }
  64135. if (currentPageNumberLis.length > 0) {
  64136. this.currentPageNumberLis = currentPageNumberLis;
  64137. }
  64138. }
  64139. }]);
  64140. return PaginationContainer;
  64141. }(TemplateBase);
  64142. SuperMap.Components.PaginationContainer = PaginationContainer;
  64143. ;// CONCATENATED MODULE: ./src/common/components/util/Util.js
  64144. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64145. * This program are made available under the terms of the Apache License, Version 2.0
  64146. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64147. var ComponentsUtil = {
  64148. /**
  64149. * 获取上传文件类型
  64150. * @param fileName
  64151. */
  64152. getFileType: function getFileType(fileName) {
  64153. var regCSV = /^.*\.(?:csv)$/i;
  64154. var regExcel = /^.*\.(?:xls|xlsx)$/i; //文件名可以带空格
  64155. var regGeojson = /^.*\.(?:geojson|json)$/i;
  64156. if (regExcel.test(fileName)) {
  64157. //校验不通过
  64158. return CommonTypes_FileTypes.EXCEL;
  64159. } else if (regCSV.test(fileName)) {
  64160. return CommonTypes_FileTypes.CSV;
  64161. } else if (regGeojson.test(fileName)) {
  64162. return CommonTypes_FileTypes.GEOJSON;
  64163. }
  64164. return null;
  64165. }
  64166. };
  64167. ;// CONCATENATED MODULE: ./src/common/components/util/index.js
  64168. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64169. * This program are made available under the terms of the Apache License, Version 2.0
  64170. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64171. ;// CONCATENATED MODULE: ./src/common/components/index.js
  64172. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64173. * This program are made available under the terms of the Apache License, Version 2.0
  64174. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64175. //数据
  64176. //组件
  64177. //提示框组件
  64178. //图表组件
  64179. //公用模板:
  64180. //工具类
  64181. ;// CONCATENATED MODULE: ./src/common/lang/locales/en-US.js
  64182. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64183. * This program are made available under the terms of the Apache License, Version 2.0
  64184. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64185. /**
  64186. * Namespace: SuperMap.Lang["en"]
  64187. * Dictionary for English. Keys for entries are used in calls to
  64188. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  64189. * strings formatted for use with <SuperMap.String.format> calls.
  64190. */
  64191. var en = {
  64192. 'title_dataFlowService': 'Data Flow Service',
  64193. 'title_distributedAnalysis': 'Distributed Analysis',
  64194. 'title_clientComputing': 'Client Computing',
  64195. 'title_dataServiceQuery': 'Data Service Query',
  64196. 'title_searchCity': 'Search city',
  64197. 'title_searchLayer': ' Search layer',
  64198. 'text_input_value_inputDataFlowUrl': 'Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  64199. 'text_displayFeaturesInfo': 'Display feature information',
  64200. 'text_subscribe': 'subscribe',
  64201. 'text_cancelSubscribe': 'unsubscribe',
  64202. 'text_densityAnalysis': 'Density Analysis',
  64203. 'text_CalculateTheValuePerUnitArea': 'Calculate the value per unit area within the neighborhood shape',
  64204. 'text_option_selectDataset': 'Please select a dataset',
  64205. 'text_label_dataset': 'Dataset',
  64206. 'text_option_simplePointDensityAnalysis': 'Simple point density analysis',
  64207. 'text_option_nuclearDensityAnalysis': 'Nuclear density analysis',
  64208. 'text_label_analyticalMethod': 'Analytical method',
  64209. 'text_option_quadrilateral': 'Quadrilateral',
  64210. 'text_option_hexagon': 'hexagon',
  64211. 'text_label_meshType': 'Mesh type',
  64212. 'text_option_notSet': 'Not set',
  64213. 'text_label_weightField': 'Weight field',
  64214. 'text_label_gridSizeInMeters': 'Grid size',
  64215. 'text_label_searchRadius': 'Search radius',
  64216. 'text_label_queryRange': 'Scope of analysis',
  64217. 'text_label_areaUnit': 'Area unit',
  64218. 'text_option_equidistantSegmentation': 'Equidistant segmentation',
  64219. 'text_option_logarithm': 'Logarithm',
  64220. 'text_option_equalCountingSegment': 'Equal counting segment',
  64221. 'text_option_squareRootSegmentation': 'Square root segmentation',
  64222. 'text_label_thematicMapSegmentationMode': 'Thematic map segmentation mode',
  64223. 'text_label_thematicMapSegmentationParameters': 'Thematic map segmentation parameters',
  64224. 'text_option_greenOrangePurpleGradient': 'Green orange purple gradient',
  64225. 'text_option_greenOrangeRedGradient': 'Green orange red gradient',
  64226. 'text_option_rainbowGradient': 'Rainbow gradient',
  64227. 'text_option_spectralGradient': 'Spectral gradient',
  64228. 'text_option_terrainGradient': 'Terrain gradient',
  64229. 'text_label_thematicMapColorGradientMode': 'Thematic map color gradient mode',
  64230. 'text_label_resultLayerName': 'Result layer name',
  64231. 'text_chooseFile': 'Open File',
  64232. 'text_isoline': 'Isoline',
  64233. 'text_extractDiscreteValue': 'Extract discrete value generation curve',
  64234. 'text_buffer': 'Buffer',
  64235. 'text_specifyTheDistance': 'Specify the distance to create the surrounding area',
  64236. 'text_label_analysisLayer': 'Analysis layer',
  64237. 'text_label_extractField': 'Extract field',
  64238. 'text_label_extractedValue': 'Extracted value',
  64239. 'text_label_distanceAttenuation': 'Distance attenuation',
  64240. 'text_label_gridSize': 'gridSize',
  64241. 'text_label_bufferRadius': 'Buffer radius',
  64242. 'text_label_defaultkilometers': 'Default 10 kilometers',
  64243. 'text_label_kilometer': 'kilometer',
  64244. 'text_label_unit': 'unit',
  64245. 'text_retainOriginal': 'Retain original object field',
  64246. 'text_mergeBuffer': 'Merge buffer',
  64247. 'text_label_color': 'Color',
  64248. 'text_label_buffer': '[Buffer]',
  64249. 'text_label_isolines': '[Isolines]',
  64250. 'text_label_queryRangeTips': 'The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850',
  64251. 'text_label_queryModel': 'Query mode',
  64252. 'text_label_IDArrayOfFeatures': 'ID array of features',
  64253. 'text_label_maxFeatures': 'The maximum number of features that can be returned',
  64254. 'text_label_bufferDistance': 'Buffer distance',
  64255. 'text_label_queryRange1': 'Query range',
  64256. 'text_label_spatialQueryMode': 'Spatial query mode',
  64257. 'text_label_featureFilter': 'Feature filter',
  64258. 'text_label_geometricObject': 'Geometric object',
  64259. 'text_label_queryMode': 'Query mode',
  64260. 'text_label_searchTips': 'Search for city locations or layer features',
  64261. 'text_label_chooseSearchLayers': 'Select a query layer',
  64262. 'text_loadSearchCriteria': 'Load search criteria',
  64263. 'text_saveSearchCriteria': 'Save search criteria',
  64264. "btn_analyze": "Analyze",
  64265. "btn_analyzing": "Analyzing",
  64266. "btn_emptyTheAnalysisLayer": "Empty the analysis layer",
  64267. "btn_cancelAnalysis": "Cancel",
  64268. "btn_query": "Query",
  64269. "btn_querying": "Querying",
  64270. "btn_emptyTheRresultLayer": "Clear all result layers",
  64271. 'msg_dataReturnedIsEmpty.': 'The request is successful and the data returned by the query is empty.',
  64272. 'msg_dataFlowServiceHasBeenSubscribed': 'The data stream service has been subscribed to.',
  64273. 'msg_inputDataFlowUrlFirst': 'Please enter the data stream service address first.',
  64274. 'msg_datasetOrMethodUnsupport': 'This dataset does not support this analysis type. Please reselect the dataset.',
  64275. 'msg_selectDataset': 'Please select a data set!',
  64276. 'msg_setTheWeightField': 'Please set the weight field!',
  64277. 'msg_theFieldNotSupportAnalysis': 'The field you currently select does not support analysis!',
  64278. 'msg_resultIsEmpty': 'The result of the analysis is empty!',
  64279. 'msg_openFileFail': 'Failed to open file!',
  64280. 'msg_fileTypeUnsupported': 'File format is not supported!',
  64281. 'msg_fileSizeExceeded': 'File size exceeded! The file size should not exceed 10M!',
  64282. 'msg_dataInWrongGeoJSONFormat': 'Wrong data format! Non standard GEOJSON format data!',
  64283. 'msg_dataInWrongFormat': 'Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!',
  64284. 'msg_searchKeywords': "Search keywords cannot be empty. Please enter your search criteria.",
  64285. 'msg_searchGeocodeField': "Did not match the address matching service data!",
  64286. 'msg_cityGeocodeField': "The address matching service of the current city is not configured.",
  64287. 'msg_getFeatureField': "No related vector features found!",
  64288. 'msg_dataflowservicesubscribed': 'The data stream service has been subscribed to.',
  64289. 'msg_subscribesucceeded': 'The data stream service subscription was successful.',
  64290. 'msg_crsunsupport': 'Does not support the coordinate system of the current map',
  64291. 'msg_tilematrixsetunsupport': 'Incoming TileMatrixSet is not supported',
  64292. 'msg_jsonResolveFiled': 'JSON format parsing failure!',
  64293. 'msg_requestContentFiled': 'Failed to request data through iportal!',
  64294. 'msg_getdatafailed': 'Failed to get data!'
  64295. };
  64296. SuperMap.Lang["en-US"] = en;
  64297. ;// CONCATENATED MODULE: ./src/common/lang/locales/zh-CN.js
  64298. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64299. * This program are made available under the terms of the Apache License, Version 2.0
  64300. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64301. /**
  64302. * Namespace: SuperMap.Lang["zh-CN"]
  64303. * Dictionary for Simplified Chinese. Keys for entries are used in calls to
  64304. * <SuperMap.Lang.translate>. Entry bodies are normal strings or
  64305. * strings formatted for use with <SuperMap.String.format> calls.
  64306. */
  64307. var zh = {
  64308. 'title_dataFlowService': '数据流服务',
  64309. 'title_distributedAnalysis': '分布式分析',
  64310. 'title_clientComputing': '客户端计算',
  64311. 'title_dataServiceQuery': '数据服务查询',
  64312. 'title_searchCity': '搜索城市',
  64313. 'title_searchLayer': '搜索图层',
  64314. 'text_input_value_inputDataFlowUrl': '请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe',
  64315. 'text_displayFeaturesInfo': '显示要素信息',
  64316. 'text_subscribe': '订阅',
  64317. 'text_cancelSubscribe': '取消订阅',
  64318. 'text_densityAnalysis': '密度分析',
  64319. 'text_CalculateTheValuePerUnitArea': '计算点指定邻域形状内的每单位面积量值',
  64320. 'text_option_selectDataset': '请选择数据集',
  64321. 'text_label_dataset': '数据集',
  64322. 'text_option_simplePointDensityAnalysis': '简单点密度分析',
  64323. 'text_option_nuclearDensityAnalysis': '核密度分析',
  64324. 'text_label_analyticalMethod': '分析方法',
  64325. 'text_option_quadrilateral': '四边形',
  64326. 'text_option_hexagon': '六边形',
  64327. 'text_label_meshType': '网格面类型',
  64328. 'text_option_notSet': '未设置',
  64329. 'text_label_weightField': '权重字段',
  64330. 'text_label_gridSizeInMeters': '网格大小',
  64331. 'text_label_searchRadius': '搜索半径',
  64332. 'text_label_queryRange': '分析范围',
  64333. 'text_label_areaUnit': '面积单位',
  64334. 'text_option_equidistantSegmentation': '等距离分段',
  64335. 'text_option_logarithm': '对数',
  64336. 'text_option_equalCountingSegment': '等计数分段',
  64337. 'text_option_squareRootSegmentation': '平方根分段',
  64338. 'text_label_thematicMapSegmentationMode': '专题图分段模式',
  64339. 'text_label_thematicMapSegmentationParameters': '专题图分段参数',
  64340. 'text_option_greenOrangePurpleGradient': '绿橙紫渐变',
  64341. 'text_option_greenOrangeRedGradient': '绿橙红渐变',
  64342. 'text_option_rainbowGradient': '彩虹渐变',
  64343. 'text_option_spectralGradient': '光谱渐变',
  64344. 'text_option_terrainGradient': '地形渐变',
  64345. 'text_label_thematicMapColorGradientMode': '专题图颜色渐变模式',
  64346. 'text_label_resultLayerName': '结果图层名称',
  64347. 'text_chooseFile': '选择文件',
  64348. 'text_isoline': '等值线',
  64349. 'text_extractDiscreteValue': '提取离散值生成曲线',
  64350. 'text_buffer': '缓冲区',
  64351. 'text_specifyTheDistance': '指定距离创建周边区域',
  64352. 'text_label_analysisLayer': '分析图层',
  64353. 'text_label_extractField': '提取字段',
  64354. 'text_label_extractedValue': '提取值',
  64355. 'text_label_distanceAttenuation': '距离衰减',
  64356. 'text_label_gridSize': '栅格大小',
  64357. 'text_label_bufferRadius': '缓冲半径',
  64358. 'text_label_defaultkilometers': '默认10千米',
  64359. 'text_option_kilometer': '千米',
  64360. 'text_label_unit': '单位',
  64361. 'text_retainOriginal': '保留原对象字段属性',
  64362. 'text_mergeBuffer': '合并缓冲区',
  64363. 'text_label_color': '颜色',
  64364. 'text_label_buffer': '[缓冲区]',
  64365. 'text_label_isolines': '[等值线]',
  64366. 'text_label_queryRangeTips': '默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850',
  64367. 'text_label_IDArrayOfFeatures': '要素 ID 数组',
  64368. 'text_label_maxFeatures': '最多可返回的要素数量',
  64369. 'text_label_bufferDistance': '缓冲区距离',
  64370. 'text_label_queryRange1': '查询范围',
  64371. 'text_label_spatialQueryMode': '空间查询模式',
  64372. 'text_label_featureFilter': '要素过滤器',
  64373. 'text_label_geometricObject': '几何对象',
  64374. 'text_label_queryMode': '查询模式',
  64375. 'text_label_searchTips': '搜索城市地点或图层要素',
  64376. 'text_label_chooseSearchLayers': '选择查询图层',
  64377. 'text_loadSearchCriteria': '加载搜索条件',
  64378. 'text_saveSearchCriteria': '保存搜索条件',
  64379. "btn_analyze": "分析",
  64380. "btn_analyzing": "分析中",
  64381. "btn_emptyTheAnalysisLayer": "清空分析图层",
  64382. "btn_cancelAnalysis": "取消",
  64383. "btn_query": "查询",
  64384. "btn_querying": "查询中",
  64385. "btn_emptyTheRresultLayer": "清除所有结果图层",
  64386. 'msg_dataFlowServiceHasBeenSubscribed': '已订阅该数据流服务。',
  64387. 'msg_inputDataFlowUrlFirst': '请先输入数据流服务地址。',
  64388. 'msg_datasetOrMethodUnsupport': '该数据集不支持本分析类型,请重新选择数据集',
  64389. 'msg_selectDataset': '请选择数据集!',
  64390. 'msg_setTheWeightField': '请设置权重字段!',
  64391. 'msg_theFieldNotSupportAnalysis': '您当前选择的字段不支持分析!',
  64392. 'msg_resultIsEmpty': '分析的结果为空!',
  64393. 'msg_dataReturnedIsEmpty': '请求成功,查询返回的数据为空。',
  64394. 'msg_openFileFail': '打开文件失败!',
  64395. 'msg_fileTypeUnsupported': '不支持该文件格式!',
  64396. 'msg_fileSizeExceeded': '文件大小超限!文件大小不得超过 10M!',
  64397. 'msg_dataInWrongGeoJSONFormat': '数据格式错误!非标准的 GEOJSON 格式数据!',
  64398. 'msg_dataInWrongFormat': '数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!',
  64399. 'msg_searchKeywords': "搜索关键字不能为空,请输入搜索条件。",
  64400. 'msg_searchGeocodeField': "未匹配到地址匹配服务数据!",
  64401. 'msg_cityGeocodeField': "未配置当前城市的地址匹配服务。",
  64402. 'msg_getFeatureField': "未查找到相关矢量要素!",
  64403. 'msg_dataflowservicesubscribed': '已订阅该数据流服务。',
  64404. 'msg_subscribesucceeded': '数据流服务订阅成功。',
  64405. 'msg_crsunsupport': '不支持当前地图的坐标系',
  64406. 'msg_tilematrixsetunsupport': '不支持传入的TileMatrixSet',
  64407. 'msg_jsonResolveFiled': 'json格式解析失败!',
  64408. 'msg_requestContentFiled': '通过iportal请求数据失败!',
  64409. 'msg_getdatafailed': '获取数据失败!'
  64410. };
  64411. SuperMap.Lang["zh-CN"] = zh;
  64412. ;// CONCATENATED MODULE: ./src/common/lang/index.js
  64413. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64414. * This program are made available under the terms of the Apache License, Version 2.0
  64415. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64416. ;// CONCATENATED MODULE: ./src/common/index.js
  64417. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64418. * This program are made available under the terms of the Apache License, Version 2.0
  64419. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64420. ;// CONCATENATED MODULE: external "mapboxgl"
  64421. var external_mapboxgl_namespaceObject = mapboxgl;
  64422. var external_mapboxgl_default = /*#__PURE__*/__webpack_require__.n(external_mapboxgl_namespaceObject);
  64423. ;// CONCATENATED MODULE: ./src/mapboxgl/core/MapExtend.js
  64424. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64425. * This program are made available under the terms of the Apache License, Version 2.0
  64426. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64427. /**
  64428. * @function mapboxgl.supermap.MapExtend
  64429. * @description 扩展了 mapboxgl.Map 对图层相关的操作。
  64430. * @private
  64431. */
  64432. var MapExtend = function () {
  64433. (external_mapboxgl_default()).Map.prototype.overlayLayersManager = {};
  64434. if ((external_mapboxgl_default()).Map.prototype.addLayerBak === undefined) {
  64435. (external_mapboxgl_default()).Map.prototype.addLayerBak = (external_mapboxgl_default()).Map.prototype.addLayer;
  64436. (external_mapboxgl_default()).Map.prototype.addLayer = function (layer, before) {
  64437. if (layer.source || layer.type === 'custom' || layer.type === 'background') {
  64438. this.addLayerBak(layer, before);
  64439. return this;
  64440. }
  64441. if (this.overlayLayersManager[layer.id] || this.style._layers[layer.id]) {
  64442. this.fire('error', {
  64443. error: new Error('A layer with this id already exists.')
  64444. });
  64445. return;
  64446. }
  64447. addLayer(layer, this);
  64448. this.overlayLayersManager[layer.id] = layer;
  64449. return this;
  64450. };
  64451. }
  64452. (external_mapboxgl_default()).Map.prototype.getLayer = function (id) {
  64453. if (this.overlayLayersManager[id]) {
  64454. return this.overlayLayersManager[id];
  64455. }
  64456. return this.style.getLayer(id);
  64457. };
  64458. (external_mapboxgl_default()).Map.prototype.moveLayer = function (id, beforeId) {
  64459. if (this.overlayLayersManager[id]) {
  64460. moveLayer(id, beforeId);
  64461. return this;
  64462. }
  64463. if (this.style._layers[id]) {
  64464. this.style.moveLayer(id, beforeId);
  64465. this._update(true);
  64466. return this;
  64467. }
  64468. };
  64469. (external_mapboxgl_default()).Map.prototype.removeLayer = function (id) {
  64470. if (this.overlayLayersManager[id]) {
  64471. removeLayer(this.overlayLayersManager[id]);
  64472. delete this.overlayLayersManager[id];
  64473. return this;
  64474. }
  64475. this.style.removeLayer(id);
  64476. this._update(true);
  64477. return this;
  64478. }; //目前扩展的overlayer,只支持显示或隐藏图层操作
  64479. (external_mapboxgl_default()).Map.prototype.setLayoutProperty = function (layerID, name, value) {
  64480. if (this.overlayLayersManager[layerID]) {
  64481. if (name === "visibility") {
  64482. if (value === "visible") {
  64483. value = true;
  64484. } else {
  64485. value = false;
  64486. }
  64487. setVisibility(this.overlayLayersManager[layerID], value);
  64488. this.style.fire('data', {
  64489. dataType: 'style'
  64490. });
  64491. }
  64492. return this;
  64493. }
  64494. this.style.setLayoutProperty(layerID, name, value);
  64495. this._update(true);
  64496. return this;
  64497. };
  64498. (external_mapboxgl_default()).Map.prototype.updateTransform = function (units, originX, originY, centerX, centerY, width, height) {
  64499. this.transform.units = units;
  64500. var mercatorZfromAltitude = this.mercatorZfromAltitude;
  64501. (external_mapboxgl_default()).MercatorCoordinate.fromLngLat = function (lngLatLike, altitude) {
  64502. altitude = altitude || 0;
  64503. var lngLat = external_mapboxgl_default().LngLat.convert(lngLatLike);
  64504. return new (external_mapboxgl_default()).MercatorCoordinate((lngLat.lng - originX) / width, (originY - lngLat.lat) / height, mercatorZfromAltitude(altitude, lngLat.lat));
  64505. };
  64506. (external_mapboxgl_default()).MercatorCoordinate.prototype.toLngLat = function () {
  64507. return new (external_mapboxgl_default()).LngLat(this.x * width + originX, originY - this.y * height);
  64508. };
  64509. this.customConvertPoint = window.URL.createObjectURL(new Blob(['customConvertPoint = {projectX:function(x){return (x - ' + centerX + ') / ' + width + ' + 0.5},projectY:function(y){y = 0.5 - ((y - ' + centerY + ') / ' + height + ');return y < 0 ? 0 : y > 1 ? 1 : y;},toY:function(y){return (0.5-y)*' + height + '+' + centerY + ';}}'], {
  64510. type: "text/javascript"
  64511. }));
  64512. };
  64513. function addLayer(layer, map) {
  64514. layer.onAdd && layer.onAdd(map);
  64515. }
  64516. /**
  64517. * @function mapboxgl.supermap.MapExtend.prototype.removeFromMap
  64518. * @description 移除事件。
  64519. */
  64520. function removeLayer(layer) {
  64521. layer.removeFromMap && layer.removeFromMap();
  64522. }
  64523. /**
  64524. * @function mapboxgl.supermap.MapExtend.prototype.setVisibility
  64525. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  64526. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  64527. */
  64528. function setVisibility(layer, visibility) {
  64529. layer.setVisibility && layer.setVisibility(visibility);
  64530. }
  64531. /**
  64532. * @function mapboxgl.supermap.MapExtend.prototype.moveTo
  64533. * @description 将图层移动到某个图层之前。
  64534. * @param {string} layerID -待插入的图层 ID。
  64535. * @param {boolean} [beforeLayerID] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  64536. */
  64537. function moveLayer(layerID, beforeLayerID) {
  64538. var layer = document.getElementById(layerID); // var beforeLayer;
  64539. if (beforeLayerID) {
  64540. var beforeLayer = document.getElementById(beforeLayerID);
  64541. if (!beforeLayer) {
  64542. external_mapboxgl_default().Evented.prototype.fire("error", {
  64543. error: new Error("Layer with id \"".concat(beforeLayerID, "\" does not exist on this document."))
  64544. });
  64545. }
  64546. }
  64547. if (layer && beforeLayer) {
  64548. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  64549. } else {
  64550. //当没有传入beforeLayerID ,则默认将图层移动到最上面
  64551. layer.parentNode.appendChild(layer);
  64552. }
  64553. }
  64554. }();
  64555. ;// CONCATENATED MODULE: ./src/mapboxgl/core/Base.js
  64556. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64557. * This program are made available under the terms of the Apache License, Version 2.0
  64558. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64559. /**
  64560. * SuperMap mapboxgl基类
  64561. * 定义命名空间
  64562. */
  64563. /**
  64564. * @namespace mapboxgl
  64565. * @category BaseTypes Namespace
  64566. */
  64567. /**
  64568. * @namespace mapboxgl.supermap
  64569. * @category BaseTypes Namespace
  64570. */
  64571. (external_mapboxgl_default()).supermap = (external_mapboxgl_default()).supermap || {};
  64572. ;// CONCATENATED MODULE: ./src/common/control/img/Logo.js
  64573. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64574. * This program are made available under the terms of the Apache License, Version 2.0
  64575. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64576. 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=";
  64577. ;// CONCATENATED MODULE: ./src/mapboxgl/control/Logo.js
  64578. function Logo_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64579. 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); } }
  64580. function Logo_createClass(Constructor, protoProps, staticProps) { if (protoProps) Logo_defineProperties(Constructor.prototype, protoProps); if (staticProps) Logo_defineProperties(Constructor, staticProps); return Constructor; }
  64581. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64582. * This program are made available under the terms of the Apache License, Version 2.0
  64583. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64584. /**
  64585. * @class mapboxgl.supermap.LogoControl
  64586. * @category Control
  64587. * @classdesc Logo 控件。默认不显示。
  64588. *
  64589. * @example
  64590. * (start code)
  64591. * map.addControl(new mapboxgl.supermap.LogoControl(),'bottom-right');
  64592. * (end)
  64593. * @param {Object} options - logo 控件配置项。
  64594. * @param {string} [options.imageUrl] - logo 图片地址。
  64595. * @param {string} [options.width] - logo 图片宽。
  64596. * @param {string} [options.height] - logo 图片高。
  64597. * @param {string} [options.link] - logo 图片跳转链接。
  64598. * @param {string} [options.alt='SuperMap iClient'] - logo 图片失效时显示文本。
  64599. */
  64600. var Logo = /*#__PURE__*/function () {
  64601. function Logo(options) {
  64602. Logo_classCallCheck(this, Logo);
  64603. //logo图片地址
  64604. this.imageUrl = null; //跳转链接
  64605. this.link = null; //logo图片宽
  64606. this.width = null; //logo图片高
  64607. this.height = null; //logo图片失效时显示文本
  64608. this.alt = "SuperMap iClient";
  64609. this._extend(this, options);
  64610. }
  64611. /**
  64612. * @function mapboxgl.supermap.LogoControl.prototype.onAdd
  64613. * @description 添加一个 logo。
  64614. * @returns {HTMLElement} 返回创建的 logo 元素。
  64615. */
  64616. Logo_createClass(Logo, [{
  64617. key: "onAdd",
  64618. value: function onAdd(map) {
  64619. this._map = map;
  64620. this._container = document.createElement('div');
  64621. this._container.className = 'mapboxgl-ctrl iclient-logo';
  64622. this._container.style.marginTop = 0;
  64623. this._container.style.marginBottom = 0;
  64624. this._container.style.marginLeft = 0;
  64625. this._container.style.marginRight = 0;
  64626. var imgSrc = LogoBase64;
  64627. if (this.imageUrl) {
  64628. imgSrc = this.imageUrl;
  64629. }
  64630. var alt = this.alt;
  64631. var imageWidth = "94px";
  64632. var imageHeight = "29px";
  64633. var styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  64634. if (this.imageUrl) {
  64635. imageWidth = this.width;
  64636. imageHeight = this.height;
  64637. styleSize = "width:" + imageWidth + ";height:" + imageHeight + ";";
  64638. if (!imageWidth || !imageHeight) {
  64639. styleSize = "";
  64640. }
  64641. }
  64642. var link = this.link || "https://iclient.supermap.io";
  64643. this._container.innerHTML = "<a href='" + link + "' target='_blank'>" + "<img src=" + imgSrc + " alt='" + alt + "' style='" + styleSize + "margin-bottom: 2px'></a>";
  64644. this._createStyleSheet();
  64645. return this._container;
  64646. }
  64647. }, {
  64648. key: "_createStyleSheet",
  64649. value: function _createStyleSheet() {
  64650. var style = document.createElement('style');
  64651. style.type = 'text/css';
  64652. style.innerHTML = ".iclient-logo{" + "margin:0 !important;" + "}" + ".iclient-logo a{" + "border: none;" + "display: block;" + "height:31px;" + "}" + ".iclient-logo img{" + "border: none;" + "white-space: nowrap" + "}";
  64653. document.getElementsByTagName('head')[0].appendChild(style);
  64654. }
  64655. }, {
  64656. key: "_extend",
  64657. value: function _extend(dest) {
  64658. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  64659. var arg = Object.getOwnPropertyNames(arguments)[index];
  64660. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  64661. continue;
  64662. }
  64663. var obj = arguments[arg];
  64664. if (obj) {
  64665. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  64666. var key = Object.getOwnPropertyNames(obj)[j];
  64667. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  64668. continue;
  64669. }
  64670. dest[key] = obj[key];
  64671. }
  64672. }
  64673. }
  64674. return dest;
  64675. }
  64676. }]);
  64677. return Logo;
  64678. }();
  64679. (external_mapboxgl_default()).supermap.LogoControl = Logo;
  64680. ;// CONCATENATED MODULE: ./src/mapboxgl/control/index.js
  64681. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64682. * This program are made available under the terms of the Apache License, Version 2.0
  64683. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64684. ;// CONCATENATED MODULE: ./src/mapboxgl/core/Util.js
  64685. function core_Util_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64686. function core_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); } }
  64687. function core_Util_createClass(Constructor, protoProps, staticProps) { if (protoProps) core_Util_defineProperties(Constructor.prototype, protoProps); if (staticProps) core_Util_defineProperties(Constructor, staticProps); return Constructor; }
  64688. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64689. * This program are made available under the terms of the Apache License, Version 2.0
  64690. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64691. /**
  64692. * @class mapboxgl.supermap.Util
  64693. * @category BaseTypes Util
  64694. * @classdesc 工具类。
  64695. */
  64696. var core_Util_Util = /*#__PURE__*/function () {
  64697. function Util() {
  64698. core_Util_classCallCheck(this, Util);
  64699. }
  64700. core_Util_createClass(Util, null, [{
  64701. key: "toSuperMapGeometry",
  64702. /**
  64703. * @function mapboxgl.supermap.Util.toSuperMapGeometry
  64704. * @description 将 GeoJSON 对象转为 SuperMap 几何图形。
  64705. * @param {GeoJSONObject} geoJSON - GeoJSON 对象。
  64706. * @returns {SuperMap.Geometry}
  64707. */
  64708. value: function toSuperMapGeometry(geoJSON) {
  64709. if (geoJSON && geoJSON.type) {
  64710. var format = new GeoJSON();
  64711. var result = format.read(geoJSON, "FeatureCollection");
  64712. return result[0].geometry;
  64713. }
  64714. }
  64715. }, {
  64716. key: "toSuperMapBounds",
  64717. value: function toSuperMapBounds(bounds) {
  64718. if (this.isArray(bounds)) {
  64719. //左下右上
  64720. return new Bounds(bounds[0], bounds[1], bounds[2], bounds[3]);
  64721. }
  64722. return new Bounds(bounds.getWest(), bounds.getSouth(), bounds.getEast(), bounds.getNorth());
  64723. }
  64724. }, {
  64725. key: "toSuperMapPoint",
  64726. value: function toSuperMapPoint(lnglat) {
  64727. //客户端可传入 geojson 对象 或者 mapboxgl lnglat 点对象,或者是点数组
  64728. if (this.isArray(lnglat)) {
  64729. return new Point(lnglat[0], lnglat[1]);
  64730. } else if (lnglat.lng && lnglat.lat) {
  64731. return new Point(lnglat.lng, lnglat.lat);
  64732. }
  64733. return new Point(lnglat.geometry.coordinates[0], lnglat.geometry.coordinates[1]);
  64734. }
  64735. /**
  64736. * @function mapboxgl.supermap.Util.toSuperMapPolygon
  64737. * @description 将 Mapbox GL LngLatbounds 对象转为 SuperMap 几何图形。
  64738. * @param {Mapboxgl.LngLatBounds} lnglatBounds - Mapbox GL LngLatbounds对象。
  64739. * @returns {SuperMap.Geometry.Polygon}
  64740. */
  64741. }, {
  64742. key: "toSuperMapPolygon",
  64743. value: function toSuperMapPolygon(lnglatBounds) {
  64744. var west = lnglatBounds.getWest();
  64745. var east = lnglatBounds.getEast();
  64746. var sourth = lnglatBounds.getSouth();
  64747. var north = lnglatBounds.getNorth();
  64748. return new Polygon([new LinearRing([new Point(west, sourth), new Point(east, sourth), new Point(east, north), new Point(west, north)])]);
  64749. }
  64750. /**
  64751. * @function mapboxgl.supermap.Util.isArray
  64752. * @description 判断是否为数组格式。
  64753. * @param {Object} obj - 待判断对象。
  64754. * @returns {boolean} 是否是数组。
  64755. */
  64756. }, {
  64757. key: "isArray",
  64758. value: function isArray(obj) {
  64759. return Object.prototype.toString.call(obj) == "[object Array]";
  64760. }
  64761. /**
  64762. * @function mapboxgl.supermap.Util.toGeoJSON
  64763. * @description 将传入对象转为 GeoJSON 格式。
  64764. * @param {Object} smObj - 待转参数。
  64765. */
  64766. }, {
  64767. key: "toGeoJSON",
  64768. value: function toGeoJSON(smObj) {
  64769. if (smObj) {
  64770. var format = new GeoJSON();
  64771. return format.toGeoJSON(smObj);
  64772. }
  64773. }
  64774. /**
  64775. * @function mapboxgl.supermap.Util.toProcessingParam
  64776. * @description 将 Region 节点数组转为 Processing 服务需要的分析参数。
  64777. * @param {Array} points - Region 各个节点数组。
  64778. * @returns {Object} processing 服务裁剪、查询分析的分析参数。
  64779. */
  64780. }, {
  64781. key: "toProcessingParam",
  64782. value: function toProcessingParam(points) {
  64783. var geometryParam = {};
  64784. if (points.length < 1) {
  64785. geometryParam = "";
  64786. } else {
  64787. var results = [];
  64788. for (var i = 0; i < points.length; i++) {
  64789. var point = {};
  64790. point.x = points[i][0];
  64791. point.y = points[i][1];
  64792. results.push(point);
  64793. }
  64794. geometryParam.type = "REGION";
  64795. geometryParam.points = results;
  64796. }
  64797. return geometryParam;
  64798. }
  64799. /**
  64800. * @function mapboxgl.supermap.Util.extend
  64801. * @description 对象拷贝赋值。
  64802. * @param {Object} dest - 目标对象。
  64803. * @param {Object} arguments - 待拷贝的对象。
  64804. * @returns {Object} 赋值后的目标对象。
  64805. */
  64806. }, {
  64807. key: "extend",
  64808. value: function extend(dest) {
  64809. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  64810. var arg = Object.getOwnPropertyNames(arguments)[index];
  64811. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  64812. continue;
  64813. }
  64814. var obj = arguments[arg];
  64815. if (obj) {
  64816. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  64817. var key = Object.getOwnPropertyNames(obj)[j];
  64818. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  64819. continue;
  64820. }
  64821. dest[key] = obj[key];
  64822. }
  64823. }
  64824. }
  64825. return dest;
  64826. }
  64827. /**
  64828. * 检测数据是否为number
  64829. * @param value 值,未知数据类型
  64830. * @returns {boolean}
  64831. */
  64832. }, {
  64833. key: "isNumber",
  64834. value: function isNumber(value) {
  64835. if (value === "") {
  64836. return false;
  64837. }
  64838. var mdata = Number(value);
  64839. if (mdata === 0) {
  64840. return true;
  64841. }
  64842. return !isNaN(mdata);
  64843. }
  64844. }, {
  64845. key: "isString",
  64846. value: function isString(str) {
  64847. return typeof str === 'string' && str.constructor === String;
  64848. }
  64849. /**
  64850. * 随机生成id
  64851. * @param attr
  64852. * @returns {string}
  64853. */
  64854. }, {
  64855. key: "newGuid",
  64856. value: function newGuid(attr) {
  64857. var len = attr || 32;
  64858. var guid = "";
  64859. for (var i = 1; i < len; i++) {
  64860. var n = Math.floor(Math.random() * 16.0).toString(16);
  64861. guid += n;
  64862. }
  64863. return guid;
  64864. }
  64865. /**
  64866. * @description 十六进制转 RGBA 格式。
  64867. * @param {Object} hex - 十六进制格式参数。
  64868. * @param {number} opacity -Alpha 参数。
  64869. * @returns {string} 生成的 RGBA 格式。
  64870. */
  64871. }, {
  64872. key: "hexToRgba",
  64873. value: function hexToRgba(hex, opacity) {
  64874. var color = [],
  64875. rgba = [];
  64876. hex = hex.replace(/#/, "");
  64877. if (hex.length == 3) {
  64878. var tmp = [];
  64879. for (var i = 0; i < 3; i++) {
  64880. tmp.push(hex.charAt(i) + hex.charAt(i));
  64881. }
  64882. hex = tmp.join("");
  64883. }
  64884. for (var _i = 0; _i < 6; _i += 2) {
  64885. color[_i] = "0x" + hex.substr(_i, 2);
  64886. rgba.push(parseInt(Number(color[_i])));
  64887. }
  64888. rgba.push(opacity);
  64889. return "rgba(" + rgba.join(",") + ")";
  64890. }
  64891. /**
  64892. * @param {string} featureName 原始数据中的地名
  64893. * @param {string} fieldName 需要匹配的地名
  64894. * @returns {boolean} 是否匹配
  64895. */
  64896. }, {
  64897. key: "isMatchAdministrativeName",
  64898. value: function isMatchAdministrativeName(featureName, fieldName) {
  64899. if (this.isString(fieldName)) {
  64900. var shortName = featureName.substr(0, 2); // 张家口市和张家界市 特殊处理
  64901. if (shortName === '张家') {
  64902. shortName = featureName.substr(0, 3);
  64903. }
  64904. return !!fieldName.match(new RegExp(shortName));
  64905. }
  64906. return false;
  64907. }
  64908. }]);
  64909. return Util;
  64910. }();
  64911. (external_mapboxgl_default()).supermap.Util = core_Util_Util;
  64912. ;// CONCATENATED MODULE: ./src/mapboxgl/core/index.js
  64913. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64914. * This program are made available under the terms of the Apache License, Version 2.0
  64915. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64916. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/ThemeFeature.js
  64917. function ThemeFeature_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64918. 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); } }
  64919. function ThemeFeature_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeFeature_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeFeature_defineProperties(Constructor, staticProps); return Constructor; }
  64920. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64921. * This program are made available under the terms of the Apache License, Version 2.0
  64922. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64923. /**
  64924. * @class mapboxgl.supermap.ThemeFeature
  64925. * @category Visualization Theme
  64926. * @classdesc 专题图要素类。
  64927. * @param {GeoJSONObject} geometry - 专题图要素几何对象。
  64928. * @param {Object} [attributes] - 几何对象属性。
  64929. */
  64930. var ThemeFeature = /*#__PURE__*/function () {
  64931. function ThemeFeature(geometry, attributes) {
  64932. ThemeFeature_classCallCheck(this, ThemeFeature);
  64933. this.geometry = geometry;
  64934. this.attributes = attributes;
  64935. }
  64936. /**
  64937. * @function mapboxgl.supermap.ThemeFeature.prototype.toFeature
  64938. * @description 转为矢量要素。
  64939. */
  64940. ThemeFeature_createClass(ThemeFeature, [{
  64941. key: "toFeature",
  64942. value: function toFeature() {
  64943. var geometry = core_Util_Util.toSuperMapGeometry(this.geometry);
  64944. var points = [];
  64945. if (this.geometry instanceof (external_mapboxgl_default()).LngLat) {
  64946. points = [this.geometry.lng, this.geometry.lat];
  64947. } else if (this.geometry instanceof (external_mapboxgl_default()).Point) {
  64948. points = [this.geometry.x, this.geometry.y];
  64949. } else if (this.geometry.length === 3) {
  64950. geometry = new GeoText(this.geometry[0], this.geometry[1], this.geometry[2]);
  64951. }
  64952. if (points.length > 1) {
  64953. geometry = new Point(points[0], points[1]);
  64954. }
  64955. return new Vector(geometry, this.attributes);
  64956. }
  64957. }]);
  64958. return ThemeFeature;
  64959. }();
  64960. (external_mapboxgl_default()).supermap.ThemeFeature = ThemeFeature;
  64961. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/ThemeLayer.js
  64962. function ThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  64963. function ThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  64964. function ThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  64965. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  64966. * This program are made available under the terms of the Apache License, Version 2.0
  64967. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  64968. /**
  64969. * @class mapboxgl.supermap.ThemeLayer
  64970. * @category Visualization Theme
  64971. * @classdesc 专题图基类。
  64972. * @param {string} name - 专题图图层名。
  64973. * @param {Object} options -可选参数。
  64974. * @param {mapboxgl.Map} options.map - 当前 mapboxgl map 对象,将在下个版本弃用,请用 map.addLayer()方法添加图层。
  64975. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  64976. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。
  64977. * @param {boolean} [options.visibility=true] - 图层是否可见。
  64978. * @param {number} [options.opacity=1] - 图层透明度。
  64979. * @fires mapboxgl.supermap.ThemeLayer#changelayer
  64980. * @fires mapboxgl.supermap.ThemeLayer#featuresremoved
  64981. */
  64982. var ThemeLayer_Theme = /*#__PURE__*/function () {
  64983. function Theme(name, opt_options) {
  64984. ThemeLayer_classCallCheck(this, Theme);
  64985. var options = opt_options ? opt_options : {};
  64986. /**
  64987. * @member {string} mapboxgl.supermap.ThemeLayer.prototype.name
  64988. * @description 专题图图层名称。
  64989. */
  64990. this.name = name;
  64991. /**
  64992. * @member {string} [mapboxgl.supermap.ThemeLayer.prototype.id]
  64993. * @description 专题图图层 id。
  64994. */
  64995. this.id = options.id ? options.id : Util.createUniqueID("themeLayer_");
  64996. /**
  64997. * @member {float} [mapboxgl.supermap.ThemeLayer.prototype.opacity=1]
  64998. * @description 图层透明度。
  64999. */
  65000. this.opacity = options.opacity ? options.opacity : 1;
  65001. /**
  65002. * @member {boolean} [mapboxgl.supermap.ThemeLayer.prototype.visibility=true]
  65003. * @description 图层是否可见。
  65004. */
  65005. this.visibility = true;
  65006. /**
  65007. * @member {boolean} [mapboxgl.supermap.ThemeLayer.prototype.loadWhileAnimating=true]
  65008. * @description 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为 false)。
  65009. */
  65010. this.loadWhileAnimating = options.loadWhileAnimating === undefined ? true : options.loadWhileAnimating;
  65011. /**
  65012. * @member {mapboxgl.Map} mapboxgl.supermap.ThemeLayer.prototype.map
  65013. * @description map 对象。
  65014. */
  65015. this.map = options.map ? options.map : null;
  65016. this.features = [];
  65017. this.TFEvents = []; //todo 保留之前创建图层同时添加到图层的用法,在下个版本遗弃
  65018. if (this.map) {
  65019. this.map.addLayer(this);
  65020. }
  65021. }
  65022. /**
  65023. * @function mapboxgl.supermap.ThemeLayer.prototype.onAdd
  65024. * @description 向底图添加该图层。
  65025. */
  65026. ThemeLayer_createClass(Theme, [{
  65027. key: "onAdd",
  65028. value: function onAdd(map) {
  65029. this.map = map;
  65030. this._createCanvasContainer(); //处理用户预先(在图层添加到 map 前)监听的事件
  65031. this.addTFEvents();
  65032. this.map.on('resize', this.resizeEvent.bind(this));
  65033. this.map.on('zoomstart', this.zoomStartEvent.bind(this));
  65034. this.map.on('zoomend', this.zoomEndEvent.bind(this));
  65035. this.map.on('rotatestart', this.rotateStartEvent.bind(this));
  65036. this.map.on('rotate', this.rotateEvent.bind(this));
  65037. this.map.on('rotateend', this.rotateEndEvent.bind(this));
  65038. this.map.on('dragend', this.dragEndEvent.bind(this));
  65039. this.map.on('movestart', this.moveStartEvent.bind(this));
  65040. this.map.on('move', this.moveEvent.bind(this));
  65041. this.map.on('moveend', this.moveEndEvent.bind(this));
  65042. this.map.on('remove', this.removeFromMap.bind(this));
  65043. this.refresh();
  65044. }
  65045. /**
  65046. * @function mapboxgl.supermap.HeatMapLayer.prototype.refresh
  65047. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  65048. */
  65049. }, {
  65050. key: "refresh",
  65051. value: function refresh() {
  65052. if (this.features.length === 0) {
  65053. return;
  65054. }
  65055. if (this.map) {
  65056. this.redrawThematicFeatures(this.map.getBounds());
  65057. }
  65058. }
  65059. }, {
  65060. key: "_createCanvasContainer",
  65061. value: function _createCanvasContainer() {
  65062. this.movingOffset = [0, 0];
  65063. this.mapContainer = this.map.getCanvasContainer();
  65064. this.div = document.createElement('div');
  65065. this.div.id = this.id;
  65066. this.div.style.position = 'absolute';
  65067. var container = this.map.getCanvasContainer();
  65068. var canvas = this.map.getCanvas();
  65069. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  65070. this.div.style.width = canvas.style.width;
  65071. this.div.style.height = canvas.style.height;
  65072. this.div.className = "themeLayer";
  65073. this.div.width = parseInt(canvas.width);
  65074. this.div.height = parseInt(canvas.height);
  65075. container.appendChild(this.div);
  65076. this.setOpacity(this.opacity);
  65077. this.levelRenderer = new LevelRenderer();
  65078. this.renderer = this.levelRenderer.init(this.div);
  65079. this.renderer.clear();
  65080. }
  65081. /**
  65082. * @function mapboxgl.supermap.ThemeLayer.prototype.destroyFeatures
  65083. * @description 销毁某个要素。
  65084. * @param {SuperMap.Feature.Vector} features - 将被销毁的要素。
  65085. */
  65086. }, {
  65087. key: "destroyFeatures",
  65088. value: function destroyFeatures(features) {
  65089. var all = features == undefined;
  65090. if (all) {
  65091. features = this.features;
  65092. }
  65093. if (features) {
  65094. this.removeFeatures(features);
  65095. for (var i = features.length - 1; i >= 0; i--) {
  65096. features[i].destroy();
  65097. }
  65098. }
  65099. }
  65100. /**
  65101. * @function mapboxgl.supermap.ThemeLayer.prototype.setVisibility
  65102. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  65103. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  65104. */
  65105. }, {
  65106. key: "setVisibility",
  65107. value: function setVisibility(visibility) {
  65108. if (visibility !== this.visibility) {
  65109. this.visibility = visibility;
  65110. this.display(visibility);
  65111. this.redrawThematicFeatures(this.map.getBounds());
  65112. }
  65113. }
  65114. /**
  65115. * @function mapboxgl.supermap.ThemeLayer.prototype.display
  65116. * @description 临时隐藏或者显示图层。通过对 CSS 控制产生即时效果,重新渲染失效。一般用 setVisibility 方法来动态控制图层的显示和隐藏。
  65117. * @param {boolean} [display] - 是否显示图层。
  65118. */
  65119. }, {
  65120. key: "display",
  65121. value: function display(_display) {
  65122. this.div.style.display = _display ? "block" : "none";
  65123. }
  65124. /**
  65125. * @function mapboxgl.supermap.ThemeLayer.prototype.setOpacity
  65126. * @description 设置图层的不透明度,取值[0-1]之间。
  65127. * @param {number} [opacity] - 不透明度。
  65128. */
  65129. }, {
  65130. key: "setOpacity",
  65131. value: function setOpacity(opacity) {
  65132. if (opacity !== this.opacity) {
  65133. this.opacity = opacity;
  65134. var element = this.div;
  65135. Util.modifyDOMElement(element, null, null, null, null, null, null, opacity);
  65136. if (this.map !== null) {
  65137. /**
  65138. * @event mapboxgl.supermap.ThemeLayer#changelayer
  65139. * @description 图层属性改变之后触发。
  65140. * @property {Object} layer - 图层。
  65141. * @property {string} property - 被改变的属性。
  65142. */
  65143. external_mapboxgl_default().Evented.prototype.fire('changelayer', {
  65144. layer: this,
  65145. property: "opacity"
  65146. });
  65147. }
  65148. }
  65149. }
  65150. /**
  65151. * @function mapboxgl.supermap.ThemeLayer.prototype.addFeatures
  65152. * @param {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature|GeoJSONObject} features - 待添加要素。
  65153. * @description 抽象方法,可实例化子类必须实现此方法。向专题图图层中添加数据 ,
  65154. */
  65155. }, {
  65156. key: "addFeatures",
  65157. value: function addFeatures(features) {// eslint-disable-line no-unused-vars
  65158. }
  65159. /**
  65160. * @function mapboxgl.supermap.ThemeLayer.prototype.removeFeatures
  65161. * @param {Array.<SuperMap.Feature.Vector>} features - 要删除 feature 的数组。
  65162. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  65163. * 参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature,
  65164. * 如果无法确定 feature 数组,则可以调用 removeAllFeatures 来删除所有 feature。
  65165. * 如果要删除的 feature 数组中的元素特别多,推荐使用 removeAllFeatures,
  65166. * 删除所有 feature 后再重新添加。这样效率会更高。
  65167. */
  65168. }, {
  65169. key: "removeFeatures",
  65170. value: function removeFeatures(features) {
  65171. if (!features || features.length === 0) {
  65172. return;
  65173. }
  65174. if (features === this.features) {
  65175. return this.removeAllFeatures();
  65176. }
  65177. if (!Util.isArray(features)) {
  65178. features = [features];
  65179. }
  65180. var featuresFailRemoved = [];
  65181. for (var i = features.length - 1; i >= 0; i--) {
  65182. var feature = features[i]; //如果我们传入的feature在features数组中没有的话,则不进行删除,
  65183. //并将其放入未删除的数组中。
  65184. var findex = Util.indexOf(this.features, feature);
  65185. if (findex === -1) {
  65186. featuresFailRemoved.push(feature);
  65187. continue;
  65188. }
  65189. this.features.splice(findex, 1);
  65190. }
  65191. var drawFeatures = [];
  65192. for (var hex = 0, len = this.features.length; hex < len; hex++) {
  65193. feature = this.features[hex];
  65194. drawFeatures.push(feature);
  65195. }
  65196. this.features = [];
  65197. this.addFeatures(drawFeatures); //绘制专题要素
  65198. if (this.renderer) {
  65199. this.redrawThematicFeatures(this.map.getBounds());
  65200. }
  65201. var succeed = featuresFailRemoved.length == 0 ? true : false;
  65202. /**
  65203. * @event mapboxgl.supermap.ThemeLayer#featuresremoved
  65204. * @description 要素删除之后触发。
  65205. * @property {Array.<SuperMap.Feature.Vector>} features - 未被成功删除的要素。
  65206. * @property {boolean} succeed - 删除成功与否。
  65207. */
  65208. external_mapboxgl_default().Evented.prototype.fire("featuresremoved", {
  65209. features: featuresFailRemoved,
  65210. succeed: succeed
  65211. });
  65212. }
  65213. /**
  65214. * @function mapboxgl.supermap.ThemeLayer.prototype.removeAllFeatures
  65215. * @description 清除当前图层所有的矢量要素。
  65216. */
  65217. }, {
  65218. key: "removeAllFeatures",
  65219. value: function removeAllFeatures() {
  65220. if (this.renderer) {
  65221. this.renderer.clear();
  65222. }
  65223. this.features = [];
  65224. external_mapboxgl_default().Evented.prototype.fire('featuresremoved', {
  65225. features: [],
  65226. succeed: true
  65227. });
  65228. }
  65229. /**
  65230. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatures
  65231. * @description 查看当前图层中的有效数据。
  65232. * @returns {SuperMap.Feature.Vector} 用户加入图层的有效数据。
  65233. */
  65234. }, {
  65235. key: "getFeatures",
  65236. value: function getFeatures() {
  65237. var len = this.features.length;
  65238. var clonedFeatures = new Array(len);
  65239. for (var i = 0; i < len; ++i) {
  65240. clonedFeatures[i] = this.features[i];
  65241. }
  65242. return clonedFeatures;
  65243. }
  65244. /**
  65245. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatureBy
  65246. * @description 在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,
  65247. * 返回此 feature(并且只返回第一个)。
  65248. * @param {string} property - feature 的某个属性名称。
  65249. * @param {string} value - property 所对应的值。
  65250. * @returns {SuperMap.Feature.Vector} 第一个匹配属性和值的矢量要素。
  65251. */
  65252. }, {
  65253. key: "getFeatureBy",
  65254. value: function getFeatureBy(property, value) {
  65255. var feature = null;
  65256. for (var id in this.features) {
  65257. if (this.features[id][property] === value) {
  65258. feature = this.features[id];
  65259. break;
  65260. }
  65261. }
  65262. return feature;
  65263. }
  65264. /**
  65265. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeatureById
  65266. * @description 通过给定一个 id,返回对应的矢量要素。
  65267. * @param {string} featureId - 矢量要素的属性 id。
  65268. * @returns {SuperMap.Feature.Vector} 对应 id 的 feature,如果不存在则返回 null。
  65269. */
  65270. }, {
  65271. key: "getFeatureById",
  65272. value: function getFeatureById(featureId) {
  65273. return this.getFeatureBy('id', featureId);
  65274. }
  65275. /**
  65276. * @function mapboxgl.supermap.ThemeLayer.prototype.getFeaturesByAttribute
  65277. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  65278. * @param {string} attrName - 属性的 key。
  65279. * @param {string} attrValue - 矢量要素的属性 id。
  65280. * @returns {Array.<SuperMap.Feature.Vector>} 一个匹配的 feature 数组。
  65281. */
  65282. }, {
  65283. key: "getFeaturesByAttribute",
  65284. value: function getFeaturesByAttribute(attrName, attrValue) {
  65285. var feature,
  65286. foundFeatures = [];
  65287. for (var id in this.features) {
  65288. feature = this.features[id];
  65289. if (feature && feature.attributes) {
  65290. if (feature.attributes[attrName] === attrValue) {
  65291. foundFeatures.push(feature);
  65292. }
  65293. }
  65294. }
  65295. return foundFeatures;
  65296. }
  65297. /**
  65298. * @function mapboxgl.supermap.ThemeLayer.prototype.redrawThematicFeatures
  65299. * @description 抽象方法,可实例化子类必须实现此方法。重绘专题要素。
  65300. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  65301. */
  65302. }, {
  65303. key: "redrawThematicFeatures",
  65304. value: function redrawThematicFeatures(extent) {// eslint-disable-line no-unused-vars
  65305. }
  65306. /**
  65307. * @function mapboxgl.supermap.ThemeLayer.prototype.on
  65308. * @description 添加专题要素事件监听。添加专题要素事件监听。
  65309. * @param {Event} event - 监听事件。
  65310. * @param {function} callback - 回调函数。
  65311. * @param {string} context - 信息。
  65312. */
  65313. }, {
  65314. key: "on",
  65315. value: function on(event, callback, context) {
  65316. // eslint-disable-line no-unused-vars
  65317. if (this.renderer) {
  65318. this.renderer.on(event, callback);
  65319. } else {
  65320. this.map.on(event, callback);
  65321. }
  65322. return this;
  65323. }
  65324. /**
  65325. * @function mapboxgl.supermap.ThemeLayer.prototype.off
  65326. * @description 移除专题要素事件监听。
  65327. * @param {Event} event - 监听事件。
  65328. * @param {function} callback - 回调函数。
  65329. * @param {string} context - 信息。
  65330. */
  65331. }, {
  65332. key: "off",
  65333. value: function off(event, callback, context) {
  65334. // eslint-disable-line no-unused-vars
  65335. var me = this;
  65336. if (me.renderer) {
  65337. me.renderer.off(event, callback);
  65338. } else {
  65339. this.map.off(event, callback);
  65340. }
  65341. return this;
  65342. }
  65343. /**
  65344. * @function mapboxgl.supermap.ThemeLayer.prototype.addTFEvents
  65345. * @description 将图层添加到地图上之前用户要求添加的事件监听添加到图层。
  65346. * @private
  65347. */
  65348. }, {
  65349. key: "addTFEvents",
  65350. value: function addTFEvents() {
  65351. var tfEs = this.TFEvents;
  65352. var len = tfEs.length;
  65353. for (var i = 0; i < len; i++) {
  65354. this.renderer.on(tfEs[i][0], tfEs[i][1]);
  65355. }
  65356. }
  65357. /**
  65358. * @function mapboxgl.supermap.ThemeLayer.prototype.getLocalXY
  65359. * @description 地理坐标转为像素坐标。
  65360. * @param {Object} [coordinate] - 坐标位置。
  65361. */
  65362. }, {
  65363. key: "getLocalXY",
  65364. value: function getLocalXY(coordinate) {
  65365. var pixelP,
  65366. map = this.map;
  65367. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  65368. var tempPoint = map.project(new (external_mapboxgl_default()).LngLat(coordinate.x, coordinate.y));
  65369. pixelP = [tempPoint.x, tempPoint.y];
  65370. }
  65371. if (coordinate instanceof LonLat) {
  65372. var _tempPoint = map.project(new (external_mapboxgl_default()).LngLat(coordinate.lon, coordinate.lat));
  65373. pixelP = [_tempPoint.x, _tempPoint.y];
  65374. }
  65375. return pixelP;
  65376. }
  65377. /**
  65378. * @function mapboxgl.supermap.ThemeLayer.prototype.toFeature
  65379. * @description 转为 iClient 要素。
  65380. * @param {mapboxgl.supermap.ThemeFeature|GeoJSONObject} features - 待转要素。
  65381. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
  65382. */
  65383. }, {
  65384. key: "toiClientFeature",
  65385. value: function toiClientFeature(features) {
  65386. if (!Util.isArray(features)) {
  65387. features = [features];
  65388. }
  65389. var featuresTemp = [];
  65390. for (var i = 0; i < features.length; i++) {
  65391. //mapboxgl.supermap.ThemeFeature 类型
  65392. if (features[i] instanceof ThemeFeature) {
  65393. featuresTemp.push(features[i].toFeature());
  65394. } else if (features[i] instanceof Vector) {
  65395. // 若是 GeometryVector 直接返回
  65396. featuresTemp.push(features[i]);
  65397. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  65398. //GeoJSON 规范数据类型
  65399. var format = new GeoJSON();
  65400. featuresTemp = featuresTemp.concat(format.read(features[i]));
  65401. } else if (features[i].geometry && features[i].geometry.parts) {
  65402. //iServer服务器返回数据格式
  65403. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  65404. } else {
  65405. throw new Error("features's type is not be supported.");
  65406. }
  65407. }
  65408. return featuresTemp;
  65409. }
  65410. /**
  65411. * @function mapboxgl.supermap.ThemeLayer.prototype.toFeature
  65412. * @deprecated
  65413. * @description 转为 iClient 要素,该方法将被弃用,由 {@link mapboxgl.supermap.ThemeLayer#toiClientFeature} 代替。
  65414. * @param {mapboxgl.supermap.ThemeFeature|GeoJSONObject} features - 待转要素。
  65415. * @returns {SuperMap.Feature.Vector} 转换后的 iClient 要素。
  65416. */
  65417. }, {
  65418. key: "toFeature",
  65419. value: function toFeature(features) {
  65420. return this.toiClientFeature(features);
  65421. }
  65422. }, {
  65423. key: "moveEndEvent",
  65424. value: function moveEndEvent() {
  65425. if (this.loadWhileAnimating || !this.visibility) {
  65426. return;
  65427. }
  65428. this.div.style.transform = '';
  65429. this.redrawThematicFeatures(this.map.getBounds());
  65430. this._show();
  65431. }
  65432. }, {
  65433. key: "moveStartEvent",
  65434. value: function moveStartEvent() {
  65435. if (this.loadWhileAnimating || !this.visibility) {
  65436. return;
  65437. }
  65438. this.startPitch = this.map.getPitch();
  65439. this.startBearing = this.map.getBearing();
  65440. var startMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  65441. this.startMoveX = startMovePoint.x;
  65442. this.startMoveY = startMovePoint.y;
  65443. }
  65444. }, {
  65445. key: "moveEvent",
  65446. value: function moveEvent() {
  65447. if (this.loadWhileAnimating || !this.visibility) {
  65448. this.redrawThematicFeatures(this.map.getBounds());
  65449. return;
  65450. }
  65451. if (this.rotating || this.zooming) {
  65452. return;
  65453. }
  65454. if (this.map.getPitch() !== 0) {
  65455. this._hide();
  65456. }
  65457. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  65458. var tPitch = this.map.getPitch() - this.startPitch;
  65459. var tBearing = -this.map.getBearing() + this.startBearing;
  65460. var endMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  65461. var tMoveX = endMovePoint.x - this.startMoveX;
  65462. var tMoveY = endMovePoint.y - this.startMoveY;
  65463. this.div.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  65464. }
  65465. }, {
  65466. key: "zoomStartEvent",
  65467. value: function zoomStartEvent() {
  65468. if (this.loadWhileAnimating || !this.visibility) {
  65469. return;
  65470. }
  65471. this.zooming = true;
  65472. this._hide();
  65473. }
  65474. }, {
  65475. key: "zoomEndEvent",
  65476. value: function zoomEndEvent() {
  65477. if (this.loadWhileAnimating || !this.visibility) {
  65478. return;
  65479. }
  65480. this.zooming = false;
  65481. this._show();
  65482. }
  65483. }, {
  65484. key: "rotateStartEvent",
  65485. value: function rotateStartEvent() {
  65486. if (this.loadWhileAnimating || !this.visibility) {
  65487. return;
  65488. }
  65489. this.rotating = true;
  65490. }
  65491. }, {
  65492. key: "rotateEvent",
  65493. value: function rotateEvent() {
  65494. if (this.loadWhileAnimating || !this.visibility) {
  65495. return;
  65496. }
  65497. if (this.map.getPitch() !== 0) {
  65498. this._hide();
  65499. }
  65500. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  65501. var tPitch = this.map.getPitch() - this.startPitch;
  65502. var tBearing = -this.map.getBearing() + this.startBearing;
  65503. this.div.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  65504. }
  65505. }, {
  65506. key: "rotateEndEvent",
  65507. value: function rotateEndEvent() {
  65508. if (this.loadWhileAnimating || !this.visibility) {
  65509. return;
  65510. }
  65511. this.rotating = false;
  65512. this._show();
  65513. }
  65514. }, {
  65515. key: "dragEndEvent",
  65516. value: function dragEndEvent() {
  65517. if (this.loadWhileAnimating || !this.visibility) {
  65518. return;
  65519. }
  65520. this._hide();
  65521. }
  65522. }, {
  65523. key: "resizeEvent",
  65524. value: function resizeEvent() {
  65525. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  65526. var canvas = this.map.getCanvas();
  65527. this.div.style.width = canvas.style.width;
  65528. this.div.style.height = canvas.style.height;
  65529. this.div.width = parseInt(canvas.width);
  65530. this.div.height = parseInt(canvas.height);
  65531. this.renderer.resize();
  65532. }
  65533. /**
  65534. * @function mapboxgl.supermap.ThemeLayer.prototype.removeFromMap
  65535. * @description 移除图层。
  65536. */
  65537. }, {
  65538. key: "removeFromMap",
  65539. value: function removeFromMap() {
  65540. this.mapContainer.removeChild(this.div);
  65541. this.removeAllFeatures();
  65542. }
  65543. /**
  65544. * @function mapboxgl.supermap.ThemeLayer.prototype.moveTo
  65545. * @description 将图层移动到某个图层之前。
  65546. * @param {string} layerID - 待插入的图层 ID。
  65547. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  65548. */
  65549. }, {
  65550. key: "moveTo",
  65551. value: function moveTo(layerID, before) {
  65552. var layer = document.getElementById(this.div.id);
  65553. before = before !== undefined ? before : true;
  65554. if (before) {
  65555. var beforeLayer = document.getElementById(layerID);
  65556. if (layer && beforeLayer) {
  65557. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  65558. }
  65559. return;
  65560. }
  65561. var nextLayer = document.getElementById(layerID);
  65562. if (layer) {
  65563. if (nextLayer.nextSibling) {
  65564. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  65565. return;
  65566. }
  65567. nextLayer.parentNode.appendChild(layer);
  65568. }
  65569. }
  65570. }, {
  65571. key: "_hide",
  65572. value: function _hide() {
  65573. this.renderer.painter.root.style.display = 'none';
  65574. }
  65575. }, {
  65576. key: "_show",
  65577. value: function _show() {
  65578. this.renderer.painter.root.style.display = 'block';
  65579. }
  65580. }]);
  65581. return Theme;
  65582. }();
  65583. (external_mapboxgl_default()).supermap.ThemeLayer = ThemeLayer_Theme;
  65584. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/GraphThemeLayer.js
  65585. function GraphThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GraphThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { GraphThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GraphThemeLayer_typeof(obj); }
  65586. function GraphThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65587. function GraphThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65588. function GraphThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  65589. function GraphThemeLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { GraphThemeLayer_get = Reflect.get; } else { GraphThemeLayer_get = function _get(target, property, receiver) { var base = GraphThemeLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return GraphThemeLayer_get(target, property, receiver || target); }
  65590. function GraphThemeLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = GraphThemeLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  65591. function GraphThemeLayer_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 } }); if (superClass) GraphThemeLayer_setPrototypeOf(subClass, superClass); }
  65592. function GraphThemeLayer_setPrototypeOf(o, p) { GraphThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GraphThemeLayer_setPrototypeOf(o, p); }
  65593. function GraphThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = GraphThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GraphThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GraphThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GraphThemeLayer_possibleConstructorReturn(this, result); }; }
  65594. function GraphThemeLayer_possibleConstructorReturn(self, call) { if (call && (GraphThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return GraphThemeLayer_assertThisInitialized(self); }
  65595. function GraphThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  65596. function GraphThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  65597. function GraphThemeLayer_getPrototypeOf(o) { GraphThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GraphThemeLayer_getPrototypeOf(o); }
  65598. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  65599. * This program are made available under the terms of the Apache License, Version 2.0
  65600. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  65601. /**
  65602. * @class mapboxgl.supermap.GraphThemeLayer
  65603. * @category Visualization Theme
  65604. * @classdesc 统计专题图层。
  65605. * @param {string} name - 图层名。
  65606. * @param {string} chartsType - 图表类别。
  65607. * @param {Object} opt_options - 参数。
  65608. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  65609. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  65610. * @param {mapboxgl.Map} opt_options.map - 当前mapboxgl map对象。
  65611. * @param {number} [opt_options.opacity=1] - 图层透明度。
  65612. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  65613. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  65614. * @param {string} [opt_options.chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  65615. * @param {Object} opt_options.chartsSetting - 符号 Circle 配置对象。
  65616. * @param {Array.<number>} opt_options.chartsSetting.codomain - 图表允许展示的数据值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  65617. * @param {number} [opt_options.chartsSetting.maxR] - 圆形的最大半径。
  65618. * @param {number} [opt_options.chartsSetting.minR] - 圆形的最小半径。
  65619. * @param {string} opt_options.chartsSetting.fillColor - 圆形的填充色,如:fillColor: "#FFB980"。
  65620. * @param {Object} opt_options.chartsSetting.circleStyle - 圆形的基础 style,此参数控制圆形基础样式,优先级低于 circleStyleByFields 和 circleStyleByCodomain。
  65621. * @param {number} opt_options.chartsSetting.decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  65622. * @param {Object} opt_options.chartsSetting.circleHoverStyle - 圆形 hover 状态时的样式,circleHoverAble 为 true 时有效。
  65623. * @param {boolean} [opt_options.chartsSetting.circleHoverAble=true] - 是否允许圆形使用 hover 状态。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  65624. * @param {boolean} [opt_options.chartsSetting.circleClickAble=true] - 是否允许圆形被点击。同时设置 circleHoverAble 和 circleClickAble 为 false,可以直接屏蔽图形对专题图层事件的响应。
  65625. * @extends {mapboxgl.supermap.ThemeLayer}
  65626. * @fires mapboxgl.supermap.GraphThemeLayer#beforefeaturesadded
  65627. */
  65628. var GraphThemeLayer_Graph = /*#__PURE__*/function (_Theme) {
  65629. GraphThemeLayer_inherits(Graph, _Theme);
  65630. var _super = GraphThemeLayer_createSuper(Graph);
  65631. function Graph(name, chartsType, opt_options) {
  65632. var _this;
  65633. GraphThemeLayer_classCallCheck(this, Graph);
  65634. _this = _super.call(this, name, opt_options);
  65635. _this.chartsSetting = opt_options.chartsSetting || {};
  65636. _this.themeFields = opt_options.themeFields || null;
  65637. _this.overlayWeightField = opt_options.overlayWeightField || null;
  65638. _this.isOverLay = opt_options.isOverLay === undefined ? true : opt_options.isOverLay;
  65639. _this.charts = opt_options.charts || [];
  65640. _this.cache = opt_options.cache || {};
  65641. _this.chartsType = chartsType;
  65642. return _this;
  65643. }
  65644. /**
  65645. * @function mapboxgl.supermap.GraphThemeLayer.prototype.setChartsType
  65646. * @description 设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。
  65647. * @param {string} [chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  65648. */
  65649. GraphThemeLayer_createClass(Graph, [{
  65650. key: "setChartsType",
  65651. value: function setChartsType(chartsType) {
  65652. this.chartsType = chartsType;
  65653. this.redraw();
  65654. }
  65655. /**
  65656. * @function mapboxgl.supermap.GraphThemeLayer.prototype.addFeatures
  65657. * @description 向专题图图层中添加数据,支持的 feature 类型为:iServer 返回的 feature JSON 对象。
  65658. * @param {SuperMap.ServerFeature} features - 待添加的要素。
  65659. */
  65660. }, {
  65661. key: "addFeatures",
  65662. value: function addFeatures(features) {
  65663. /**
  65664. * @event mapboxgl.supermap.GraphThemeLayer#beforefeaturesadded
  65665. * @description 要素添加之前触发。
  65666. * @property {SuperMap.ServerFeature} features - 要被添加的要素。
  65667. */
  65668. var ret = external_mapboxgl_default().Evented.prototype.fire('beforefeaturesadded', {
  65669. features: features
  65670. });
  65671. if (ret === false) {
  65672. return;
  65673. } //转换 features 形式
  65674. this.features = this.toiClientFeature(features); //绘制专题要素
  65675. if (this.renderer) {
  65676. this.redrawThematicFeatures(this.map.getBounds());
  65677. }
  65678. }
  65679. /**
  65680. * @function mapboxgl.supermap.GraphThemeLayer.prototype.redrawThematicFeatures
  65681. * @description 重绘所有专题要素。
  65682. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。
  65683. * 地图漫游时调用此方法进行图层刷新。
  65684. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  65685. */
  65686. }, {
  65687. key: "redrawThematicFeatures",
  65688. value: function redrawThematicFeatures(extent) {
  65689. // eslint-disable-line no-unused-vars
  65690. this.clearCache(); //清除当前所有可视元素
  65691. this.renderer.clearAll();
  65692. var features = this.features;
  65693. for (var i = 0, len = features.length; i < len; i++) {
  65694. var feature = features[i]; // // 要素范围判断
  65695. // var feaBounds = feature.geometry.getBounds();
  65696. // //剔除当前视图(地理)范围以外的数据
  65697. // if (extent) {
  65698. // var bounds = new SuperMap.Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  65699. // // if (!bounds.intersectsBounds(feaBounds)) continue;
  65700. // }
  65701. var cache = this.cache; // 用 feature id 做缓存标识
  65702. var cacheField = feature.id; // 数据对应的图表是否已缓存,没缓存则重新创建图表
  65703. if (cache[cacheField]) {
  65704. continue;
  65705. }
  65706. cache[cacheField] = cacheField;
  65707. var chart = this.createThematicFeature(feature); // 压盖处理权重值
  65708. if (chart && this.overlayWeightField) {
  65709. if (feature.attributes[this.overlayWeightField] && !isNaN(feature.attributes[this.overlayWeightField])) {
  65710. chart["__overlayWeight"] = feature.attributes[this.overlayWeightField];
  65711. }
  65712. }
  65713. if (chart) {
  65714. this.charts.push(chart);
  65715. }
  65716. }
  65717. this.drawCharts();
  65718. }
  65719. /**
  65720. * @function mapboxgl.supermap.GraphThemeLayer.prototype.createThematicFeature
  65721. * @description 向专题图图层中添加数据, 支持的 feature 类型为:iServer 返回的 feature json 对象。
  65722. * @param {Object} feature - 待添加的要素。
  65723. *
  65724. */
  65725. }, {
  65726. key: "createThematicFeature",
  65727. value: function createThematicFeature(feature) {
  65728. var thematicFeature; // 检查图表创建条件并创建图形
  65729. if (Theme_Theme[this.chartsType] && this.themeFields && this.chartsSetting) {
  65730. thematicFeature = new Theme_Theme[this.chartsType](feature, this, this.themeFields, this.chartsSetting);
  65731. } // thematicFeature 是否创建成功
  65732. if (!thematicFeature) {
  65733. return false;
  65734. } // 对专题要素执行图形装载
  65735. thematicFeature.assembleShapes();
  65736. return thematicFeature;
  65737. }
  65738. /**
  65739. * @function mapboxgl.supermap.GraphThemeLayer.prototype.drawCharts
  65740. * @description 绘制图表。包含压盖处理。
  65741. *
  65742. */
  65743. }, {
  65744. key: "drawCharts",
  65745. value: function drawCharts() {
  65746. // 判断 rendere r就绪
  65747. if (!this.renderer) {
  65748. return;
  65749. }
  65750. var charts = this.charts; // 图表权重值处理des
  65751. if (this.overlayWeightField) {
  65752. charts.sort(function (cs, ce) {
  65753. if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  65754. return 0;
  65755. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] == "undefined") {
  65756. return -1;
  65757. } else if (typeof cs["__overlayWeight"] == "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  65758. return 1;
  65759. } else if (typeof cs["__overlayWeight"] != "undefined" && typeof ce["__overlayWeight"] != "undefined") {
  65760. if (parseFloat(cs["__overlayWeight"]) < parseFloat(ce["__overlayWeight"])) {
  65761. return 1;
  65762. } else {
  65763. return -1;
  65764. }
  65765. }
  65766. return 0;
  65767. });
  65768. } // 不进行避让
  65769. if (!this.isOverLay) {
  65770. for (var m = 0, len_m = charts.length; m < len_m; m++) {
  65771. var chart_m = charts[m]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  65772. var shapeROP_m = chart_m.resetLocation(); // 添加图形
  65773. var shapes_m = chart_m.shapes;
  65774. for (var n = 0, slen_n = shapes_m.length; n < slen_n; n++) {
  65775. shapes_m[n].refOriginalPosition = shapeROP_m;
  65776. this.renderer.addShape(shapes_m[n]);
  65777. }
  65778. }
  65779. } else {
  65780. // 压盖判断所需 chartsBounds 集合
  65781. var chartsBounds = []; //var extent = this.map.getBounds();
  65782. //var mapBounds = new Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  65783. // 获取地图像素 bounds
  65784. //var mapPxLT = this.getLocalXY(new LonLat(mapBounds.left, mapBounds.top));
  65785. //var mapPxRB = this.getLocalXY(new LonLat(mapBounds.right, mapBounds.bottom));
  65786. //var mBounds = new Bounds(mapPxLT[0], mapPxRB[1], mapPxRB[0], mapPxLT[1]);
  65787. // 压盖处理 & 添加图形
  65788. for (var i = 0, len = charts.length; i < len; i++) {
  65789. var chart = charts[i]; // 图形参考位置 (reSetLocation 会更新 chartBounds)
  65790. var shapeROP = chart.resetLocation(); // 图表框
  65791. var cbs = chart.chartBounds;
  65792. var cBounds = [{
  65793. "x": cbs.left,
  65794. "y": cbs.top
  65795. }, {
  65796. "x": cbs.left,
  65797. "y": cbs.bottom
  65798. }, {
  65799. "x": cbs.right,
  65800. "y": cbs.bottom
  65801. }, {
  65802. "x": cbs.right,
  65803. "y": cbs.top
  65804. }, {
  65805. "x": cbs.left,
  65806. "y": cbs.top
  65807. }]; // // 地图范围外不绘制
  65808. // if (mBounds) {
  65809. // // if (!this.isChartInMap(mBounds, cBounds)) continue;
  65810. // }
  65811. // 是否压盖
  65812. var isOL = false;
  65813. if (i !== 0) {
  65814. for (var j = 0; j < chartsBounds.length; j++) {
  65815. //压盖判断
  65816. if (this.isQuadrilateralOverLap(cBounds, chartsBounds[j])) {
  65817. isOL = true;
  65818. break;
  65819. }
  65820. }
  65821. }
  65822. if (isOL) {
  65823. continue;
  65824. } else {
  65825. chartsBounds.push(cBounds);
  65826. } // 添加图形
  65827. var shapes = chart.shapes;
  65828. for (var _j = 0, slen = shapes.length; _j < slen; _j++) {
  65829. shapes[_j].refOriginalPosition = shapeROP;
  65830. this.renderer.addShape(shapes[_j]);
  65831. }
  65832. }
  65833. } // 绘制图形
  65834. this.renderer.render();
  65835. }
  65836. /**
  65837. * @function mapboxgl.supermap.GraphThemeLayer.prototype.getShapesByFeatureID
  65838. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  65839. * @param {number} featureID - 要素 ID。
  65840. */
  65841. }, {
  65842. key: "getShapesByFeatureID",
  65843. value: function getShapesByFeatureID(featureID) {
  65844. var list = [];
  65845. var shapeList = this.renderer.getAllShapes();
  65846. if (!featureID) {
  65847. return shapeList;
  65848. }
  65849. for (var i = 0, len = shapeList.length; i < len; i++) {
  65850. var si = shapeList[i];
  65851. if (si.refDataID && featureID === si.refDataID) {
  65852. list.push(si);
  65853. }
  65854. }
  65855. return list;
  65856. }
  65857. /**
  65858. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isQuadrilateralOverLap
  65859. * @description 判断两个四边形是否有压盖。
  65860. * @param {Array.<Object>} quadrilateral - 四边形节点数组。
  65861. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  65862. */
  65863. }, {
  65864. key: "isQuadrilateralOverLap",
  65865. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  65866. var quadLen = quadrilateral.length,
  65867. quad2Len = quadrilateral2.length;
  65868. if (quadLen !== 5 || quad2Len !== 5) {
  65869. return null;
  65870. } //不是四边形
  65871. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  65872. for (var i = 0; i < quadLen; i++) {
  65873. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  65874. OverLap = true;
  65875. break;
  65876. }
  65877. }
  65878. for (var _i = 0; _i < quad2Len; _i++) {
  65879. if (this.isPointInPoly(quadrilateral2[_i], quadrilateral)) {
  65880. OverLap = true;
  65881. break;
  65882. }
  65883. } //加上两矩形十字相交的情况
  65884. for (var _i2 = 0; _i2 < quadLen - 1; _i2++) {
  65885. if (OverLap) {
  65886. break;
  65887. }
  65888. for (var j = 0; j < quad2Len - 1; j++) {
  65889. var isLineIn = Util.lineIntersection(quadrilateral[_i2], quadrilateral[_i2 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  65890. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  65891. OverLap = true;
  65892. break;
  65893. }
  65894. }
  65895. }
  65896. return OverLap;
  65897. }
  65898. /**
  65899. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isPointInPoly
  65900. * @description 判断一个点是否在多边形里面。(射线法)
  65901. * @param {Object} pt - 需要判定的点对象,该对象含有属性 x (横坐标),属性 y (纵坐标)。
  65902. * @param {Array.<Object>} poly - 多边形节点数组。
  65903. */
  65904. }, {
  65905. key: "isPointInPoly",
  65906. value: function isPointInPoly(pt, poly) {
  65907. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  65908. (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);
  65909. }
  65910. return isIn;
  65911. }
  65912. /**
  65913. * @function mapboxgl.supermap.GraphThemeLayer.prototype.isChartInMap
  65914. * @description 判断图表是否在地图里。
  65915. * @param {SuperMap.Bounds} mapPxBounds - 地图像素范围。
  65916. * @param {Array.<Object>} chartPxBounds - 图表范围的四边形节点数组。
  65917. */
  65918. }, {
  65919. key: "isChartInMap",
  65920. value: function isChartInMap(mapPxBounds, chartPxBounds) {
  65921. var mb = mapPxBounds;
  65922. var isIn = false;
  65923. for (var i = 0, len = chartPxBounds.length; i < len; i++) {
  65924. var cb = chartPxBounds[i];
  65925. if (cb.x >= mb.left && cb.x <= mb.right && cb.y >= mb.top && cb.y <= mb.bottom) {
  65926. isIn = true;
  65927. break;
  65928. }
  65929. }
  65930. return isIn;
  65931. }
  65932. /**
  65933. * @function mapboxgl.supermap.GraphThemeLayer.prototype.clearCache
  65934. * @description 清除缓存
  65935. */
  65936. }, {
  65937. key: "clearCache",
  65938. value: function clearCache() {
  65939. this.cache = {};
  65940. this.charts = [];
  65941. }
  65942. /**
  65943. * @function mapboxgl.supermap.GraphThemeLayer.prototype.removeFeatures
  65944. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。参数中的 features 数组中的每一项,必须是已经添加到当前图层中的 feature。
  65945. * @param {SuperMap.Feature.Vector} features - 要删除的要素。
  65946. */
  65947. }, {
  65948. key: "removeFeatures",
  65949. value: function removeFeatures(features) {
  65950. this.clearCache();
  65951. GraphThemeLayer_get(GraphThemeLayer_getPrototypeOf(Graph.prototype), "removeFeatures", this).call(this, features);
  65952. }
  65953. /**
  65954. * @function mapboxgl.supermap.GraphThemeLayer.prototype.removeAllFeatures
  65955. * @description 移除所有的要素。
  65956. */
  65957. }, {
  65958. key: "removeAllFeatures",
  65959. value: function removeAllFeatures() {
  65960. this.clearCache();
  65961. GraphThemeLayer_get(GraphThemeLayer_getPrototypeOf(Graph.prototype), "removeAllFeatures", this).call(this);
  65962. }
  65963. /**
  65964. * @function mapboxgl.supermap.GraphThemeLayer.prototype.redraw
  65965. * @description 重绘该图层。
  65966. */
  65967. }, {
  65968. key: "redraw",
  65969. value: function redraw() {
  65970. this.clearCache();
  65971. if (this.renderer) {
  65972. this.redrawThematicFeatures(this.map.getBounds());
  65973. return true;
  65974. }
  65975. return false;
  65976. }
  65977. /**
  65978. * @function mapboxgl.supermap.GraphThemeLayer.prototype.clear
  65979. * @description 清除的内容包括数据(features) 、专题要素、缓存。
  65980. */
  65981. }, {
  65982. key: "clear",
  65983. value: function clear() {
  65984. if (this.renderer) {
  65985. this.renderer.clearAll();
  65986. this.renderer.refresh();
  65987. }
  65988. this.removeAllFeatures();
  65989. this.clearCache();
  65990. }
  65991. }]);
  65992. return Graph;
  65993. }(ThemeLayer_Theme);
  65994. (external_mapboxgl_default()).supermap.GraphThemeLayer = GraphThemeLayer_Graph;
  65995. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/GeoFeatureThemeLayer.js
  65996. function GeoFeatureThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GeoFeatureThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { GeoFeatureThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GeoFeatureThemeLayer_typeof(obj); }
  65997. function GeoFeatureThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  65998. function GeoFeatureThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  65999. function GeoFeatureThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GeoFeatureThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GeoFeatureThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  66000. function GeoFeatureThemeLayer_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 } }); if (superClass) GeoFeatureThemeLayer_setPrototypeOf(subClass, superClass); }
  66001. function GeoFeatureThemeLayer_setPrototypeOf(o, p) { GeoFeatureThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GeoFeatureThemeLayer_setPrototypeOf(o, p); }
  66002. function GeoFeatureThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = GeoFeatureThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = GeoFeatureThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = GeoFeatureThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return GeoFeatureThemeLayer_possibleConstructorReturn(this, result); }; }
  66003. function GeoFeatureThemeLayer_possibleConstructorReturn(self, call) { if (call && (GeoFeatureThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return GeoFeatureThemeLayer_assertThisInitialized(self); }
  66004. function GeoFeatureThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66005. function GeoFeatureThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66006. function GeoFeatureThemeLayer_getPrototypeOf(o) { GeoFeatureThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GeoFeatureThemeLayer_getPrototypeOf(o); }
  66007. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66008. * This program are made available under the terms of the Apache License, Version 2.0
  66009. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66010. /**
  66011. * @class mapboxgl.supermap.GeoFeatureThemeLayer
  66012. * @category Visualization Theme
  66013. * @classdesc 地理几何专题要素型专题图层。
  66014. * @param {string} name - 图层名。
  66015. * @param {Object} opt_options - 参数。
  66016. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  66017. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  66018. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  66019. * @param {number} [opt_options.nodesClipPixel=2] - 节点抽稀像素距离。
  66020. * @param {boolean} [opt_options.isHoverAble=false] - 图形是否在 hover 时高亮。
  66021. * @param {boolean} [opt_options.isMultiHover=false] - 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  66022. * @param {boolean} [opt_options.isClickAble=true] - 图形是否可点击。
  66023. * @param {boolean} [opt_options.isAllowFeatureStyle=false] - 是否允许 feature 样式(style) 中的有效属性应用到专题图层。
  66024. * 禁止对专题要素使用数据(feature)的 style。
  66025. * 此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
  66026. * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
  66027. * @param {number} [opt_options.opacity=1] - 图层透明度。
  66028. * @extends {mapboxgl.supermap.ThemeLayer}
  66029. * @fires mapboxgl.supermap.GeoFeatureThemeLayer#beforefeaturesadded
  66030. */
  66031. var GeoFeature = /*#__PURE__*/function (_Theme) {
  66032. GeoFeatureThemeLayer_inherits(GeoFeature, _Theme);
  66033. var _super = GeoFeatureThemeLayer_createSuper(GeoFeature);
  66034. function GeoFeature(name, opt_options) {
  66035. var _this;
  66036. GeoFeatureThemeLayer_classCallCheck(this, GeoFeature);
  66037. _this = _super.call(this, name, opt_options);
  66038. /**
  66039. * @member {string} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.name
  66040. * @description 专题图图层名称。
  66041. */
  66042. _this.name = null;
  66043. /**
  66044. * @member {SuperMap.ThemeStyle} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.style
  66045. * @description 专题图图层全局样式。
  66046. */
  66047. _this.style = null;
  66048. /**
  66049. * @member {SuperMap.ThemeStyle} mapboxgl.supermap.GeoFeatureThemeLayer.prototype.highlightStyle
  66050. * @description 专题图图层高亮样式。
  66051. */
  66052. _this.highlightStyle = null;
  66053. /**
  66054. * @member {number} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.nodesClipPixel=2]
  66055. * @description 节点抽稀像素距离。
  66056. */
  66057. _this.nodesClipPixel = 2;
  66058. /**
  66059. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isHoverAble=false]
  66060. * @description 图形是否在 hover 时高亮。
  66061. */
  66062. _this.isHoverAble = false;
  66063. /**
  66064. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isMultiHover=false]
  66065. * @description 是否多图形同时高亮,用于高亮同一个数据对应的所有图形(如:多面)。
  66066. */
  66067. _this.isMultiHover = false;
  66068. /**
  66069. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isClickAble=true]
  66070. * @description 图形是否可点击。
  66071. */
  66072. _this.isClickAble = true;
  66073. /**
  66074. * @member {boolean} [mapboxgl.supermap.GeoFeatureThemeLayer.prototype.isAllowFeatureStyle=false]
  66075. * @description 是否允许 feature 样式(style) 中的有效属性应用到专题图层。</br>
  66076. * 禁止对专题要素使用数据(feature)的 style。此属性可强制将数据 feature 的 style 中有效属性应用到专题要素上,且拥有比图层 style 和 styleGroups 更高的优先级,使专题要素
  66077. * 的样式脱离专题图层的控制。可以通过此方式实现对特殊数据(feature) 对应专题要素赋予独立 style。
  66078. */
  66079. _this.isAllowFeatureStyle = false;
  66080. Util.extend(GeoFeatureThemeLayer_assertThisInitialized(_this), opt_options);
  66081. _this.cache = opt_options.cache || {};
  66082. _this.cacheFields = opt_options.cacheFields || [];
  66083. _this.maxCacheCount = opt_options.maxCacheCount || 0;
  66084. _this.isCustomSetMaxCacheCount = opt_options.isCustomSetMaxCacheCount === undefined ? false : opt_options.isCustomSetMaxCacheCount;
  66085. return _this;
  66086. }
  66087. /**
  66088. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.addFeatures
  66089. * @description 添加要素。
  66090. * @param {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature} features - 要素对象。
  66091. */
  66092. GeoFeatureThemeLayer_createClass(GeoFeature, [{
  66093. key: "addFeatures",
  66094. value: function addFeatures(features) {
  66095. /**
  66096. * @event mapboxgl.supermap.GeoFeatureThemeLayer#beforefeaturesadded
  66097. * @description 要素添加之前触发。
  66098. * @property {mapboxgl.supermap.ThemeFeature|SuperMap.ServerFeature} features - 被添加的要素。
  66099. */
  66100. external_mapboxgl_default().Evented.prototype.fire('beforefeaturesadded', {
  66101. features: features
  66102. }); //转换 features 形式
  66103. this.features = this.toiClientFeature(features);
  66104. if (!this.isCustomSetMaxCacheCount) {
  66105. this.maxCacheCount = this.features.length * 5;
  66106. } //绘制专题要素
  66107. if (this.renderer) {
  66108. this.redrawThematicFeatures(this.map.getBounds());
  66109. }
  66110. }
  66111. /**
  66112. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.removeFeatures
  66113. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  66114. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  66115. */
  66116. }, {
  66117. key: "removeFeatures",
  66118. value: function removeFeatures(features) {
  66119. // eslint-disable-line no-unused-vars
  66120. this.clearCache();
  66121. ThemeLayer_Theme.prototype.removeFeatures.apply(this, arguments);
  66122. }
  66123. /**
  66124. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.removeAllFeatures
  66125. * @description 清除当前图层所有的矢量要素。
  66126. */
  66127. }, {
  66128. key: "removeAllFeatures",
  66129. value: function removeAllFeatures() {
  66130. this.clearCache();
  66131. ThemeLayer_Theme.prototype.removeAllFeatures.apply(this, arguments);
  66132. }
  66133. /**
  66134. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.redrawThematicFeatures
  66135. * @description 重绘所有专题要素。
  66136. * @param {mapboxgl.LngLatBounds} extent - 重绘的范围。
  66137. */
  66138. }, {
  66139. key: "redrawThematicFeatures",
  66140. value: function redrawThematicFeatures(extent) {
  66141. // eslint-disable-line no-unused-vars
  66142. this.clearCache(); //获取高亮专题要素对应的用户 id
  66143. var hoverone = this.renderer.getHoverOne();
  66144. var hoverFid = null;
  66145. if (hoverone && hoverone.refDataID) {
  66146. hoverFid = hoverone.refDataID;
  66147. } //清除当前所有可视元素
  66148. this.renderer.clearAll();
  66149. var features = this.features;
  66150. var cache = this.cache;
  66151. var cacheFields = this.cacheFields;
  66152. var cmZoom = this.map.getZoom();
  66153. var maxCC = this.maxCacheCount;
  66154. for (var i = 0, len = features.length; i < len; i++) {
  66155. var feature = features[i]; // var feaBounds = feature.geometry.getBounds();
  66156. //
  66157. // //剔除当前视图(地理)范围以外的数据
  66158. // if (extent) {
  66159. // var bounds = new SuperMap.Bounds(extent.getWest(), extent.getSouth(), extent.getEast(), extent.getNorth());
  66160. // // if (!bounds.intersectsBounds(feaBounds)) continue;
  66161. // }
  66162. //缓存字段
  66163. var fields = feature.id + "_zoom_" + cmZoom.toString();
  66164. var thematicFeature; //判断专题要素缓存是否存在
  66165. if (cache[fields]) {
  66166. cache[fields].updateAndAddShapes();
  66167. } else {
  66168. //如果专题要素缓存不存在,创建专题要素
  66169. thematicFeature = this.createThematicFeature(features[i]); //检查 thematicFeature 是否有可视化图形
  66170. if (thematicFeature.getShapesCount() < 1) {
  66171. continue;
  66172. } //加入缓存
  66173. cache[fields] = thematicFeature;
  66174. cacheFields.push(fields); //缓存数量限制
  66175. if (cacheFields.length > maxCC) {
  66176. var fieldsTemp = cacheFields[0];
  66177. cacheFields.splice(0, 1);
  66178. delete cache[fieldsTemp];
  66179. }
  66180. }
  66181. }
  66182. this.renderer.render(); //地图漫游后,重新高亮图形
  66183. if (hoverFid && this.isHoverAble && this.isMultiHover) {
  66184. var hShapes = this.getShapesByFeatureID(hoverFid);
  66185. this.renderer.updateHoverShapes(hShapes);
  66186. }
  66187. }
  66188. /**
  66189. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.createThematicFeature
  66190. * @description 创建专题要素。
  66191. * @param {SuperMap.Feature.Vector} feature - 要素对象。
  66192. */
  66193. }, {
  66194. key: "createThematicFeature",
  66195. value: function createThematicFeature(feature) {
  66196. var style = Util.copyAttributesWithClip(this.style);
  66197. if (feature.style && this.isAllowFeatureStyle === true) {
  66198. style = Util.copyAttributesWithClip(feature.style);
  66199. } //创建专题要素时的可选参数
  66200. var options = {};
  66201. options.nodesClipPixel = this.nodesClipPixel;
  66202. options.isHoverAble = this.isHoverAble;
  66203. options.isMultiHover = this.isMultiHover;
  66204. options.isClickAble = this.isClickAble;
  66205. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  66206. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  66207. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  66208. this.renderer.addShape(thematicFeature.shapes[m]);
  66209. }
  66210. return thematicFeature;
  66211. }
  66212. /**
  66213. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.clearCache
  66214. * @description 清除缓存。
  66215. */
  66216. }, {
  66217. key: "clearCache",
  66218. value: function clearCache() {
  66219. this.cache = {};
  66220. this.cacheFields = [];
  66221. }
  66222. /**
  66223. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.clear
  66224. * @description 清除的内容包括数据(features)、专题要素和缓存。
  66225. */
  66226. }, {
  66227. key: "clear",
  66228. value: function clear() {
  66229. this.renderer.clearAll();
  66230. this.renderer.refresh();
  66231. this.removeAllFeatures();
  66232. this.clearCache();
  66233. }
  66234. /**
  66235. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.getCacheCount
  66236. * @description 获取当前缓存数量。
  66237. * @returns {number} 当前缓存数量。
  66238. */
  66239. }, {
  66240. key: "getCacheCount",
  66241. value: function getCacheCount() {
  66242. return this.cacheFields.length;
  66243. }
  66244. /**
  66245. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.setMaxCacheCount
  66246. * @param {number} [cacheCount] - 缓存总数。
  66247. * @description 设置最大缓存条数。
  66248. */
  66249. }, {
  66250. key: "setMaxCacheCount",
  66251. value: function setMaxCacheCount(cacheCount) {
  66252. if (!isNaN(cacheCount)) {
  66253. this.maxCacheCount = cacheCount;
  66254. this.isCustomSetMaxCacheCount = true;
  66255. }
  66256. }
  66257. /**
  66258. * @function mapboxgl.supermap.GeoFeatureThemeLayer.prototype.setMaxCacheCount
  66259. * @param {number} [featureID=si.refDataID] - 要素 ID。
  66260. * @description 通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。
  66261. */
  66262. }, {
  66263. key: "getShapesByFeatureID",
  66264. value: function getShapesByFeatureID(featureID) {
  66265. var list = [];
  66266. var shapeList = this.renderer.getAllShapes();
  66267. if (!featureID) {
  66268. return shapeList;
  66269. }
  66270. for (var i = 0, len = shapeList.length; i < len; i++) {
  66271. var si = shapeList[i];
  66272. if (si.refDataID && featureID === si.refDataID) {
  66273. list.push(si);
  66274. }
  66275. }
  66276. return list;
  66277. }
  66278. }]);
  66279. return GeoFeature;
  66280. }(ThemeLayer_Theme);
  66281. (external_mapboxgl_default()).supermap.GeoFeatureThemeLayer = GeoFeature;
  66282. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/LabelThemeLayer.js
  66283. function LabelThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LabelThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { LabelThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LabelThemeLayer_typeof(obj); }
  66284. function LabelThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  66285. function LabelThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  66286. function LabelThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) LabelThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) LabelThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  66287. function LabelThemeLayer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { LabelThemeLayer_get = Reflect.get; } else { LabelThemeLayer_get = function _get(target, property, receiver) { var base = LabelThemeLayer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return LabelThemeLayer_get(target, property, receiver || target); }
  66288. function LabelThemeLayer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = LabelThemeLayer_getPrototypeOf(object); if (object === null) break; } return object; }
  66289. function LabelThemeLayer_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 } }); if (superClass) LabelThemeLayer_setPrototypeOf(subClass, superClass); }
  66290. function LabelThemeLayer_setPrototypeOf(o, p) { LabelThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LabelThemeLayer_setPrototypeOf(o, p); }
  66291. function LabelThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = LabelThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = LabelThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = LabelThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return LabelThemeLayer_possibleConstructorReturn(this, result); }; }
  66292. function LabelThemeLayer_possibleConstructorReturn(self, call) { if (call && (LabelThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return LabelThemeLayer_assertThisInitialized(self); }
  66293. function LabelThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  66294. function LabelThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  66295. function LabelThemeLayer_getPrototypeOf(o) { LabelThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LabelThemeLayer_getPrototypeOf(o); }
  66296. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  66297. * This program are made available under the terms of the Apache License, Version 2.0
  66298. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  66299. /**
  66300. * @class mapboxgl.supermap.LabelThemeLayer
  66301. * @category Visualization Theme
  66302. * @classdesc 标签专题图层。
  66303. * @param {string} name - 图层名。
  66304. * @param {Object} opt_options - 参数。
  66305. * @param {mapboxgl.Map} opt_options.map - 当前mapboxgl map 对象。
  66306. * @param {string} opt_options.themeField - 指定创建专题图字段。
  66307. * @param {Object} opt_options.style - 专题图样式。
  66308. * @param {Object} opt_options.styleGroups - 各专题类型样式组。
  66309. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  66310. * @param {string} [opt_options.id] - 专题图层 ID。专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  66311. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  66312. * @param {number} [opt_options.opacity=1] - 图层透明度。
  66313. * @param {boolean} [options.isAvoid=true] - 是否进行地图边缘的避让处理。
  66314. * @param {boolean} [options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  66315. * @param {boolean} [opt_options.isHoverAble] - 是否开启 hover 事件。
  66316. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  66317. */
  66318. var LabelThemeLayer_Label = /*#__PURE__*/function (_GeoFeature) {
  66319. LabelThemeLayer_inherits(Label, _GeoFeature);
  66320. var _super = LabelThemeLayer_createSuper(Label);
  66321. function Label(name, opt_options) {
  66322. var _this;
  66323. LabelThemeLayer_classCallCheck(this, Label);
  66324. _this = _super.call(this, name, opt_options);
  66325. /**
  66326. * @member {boolean} [mapboxgl.supermap.LabelThemeLayer.prototype.isOverLay=true]
  66327. * @description 是否进行压盖处理,如果设为 true,将隐藏被压盖的标签。
  66328. */
  66329. _this.isOverLay = true;
  66330. /**
  66331. * @member {boolean} [mapboxgl.supermap.LabelThemeLayer.prototype.isAvoid=true]
  66332. * @description 是否进行地图边缘的避让处理,如果设为 true,将把与地图边缘相交的标签移到地图范围内,在地图边缘处做避让处理。
  66333. */
  66334. _this.isAvoid = true;
  66335. /**
  66336. * @member {string} mapboxgl.supermap.LabelThemeLayer.prototype.themeField
  66337. * @description 用于指定专题要素样式的属性字段名称。</br>
  66338. * 此属性字段是要用户数据(feature) attributes 中包含的字段,且字段对应的值的类型必须是数值型。</br>
  66339. * 使用标签分组显示还需要设置 styleGroups 属性。
  66340. */
  66341. _this.themeField = null;
  66342. /**
  66343. * @member {Array.<Object>} mapboxgl.supermap.LabelThemeLayer.prototype.styleGroups
  66344. * @description 分组样式。使用此属性需要设置 themeField 属性。</br>
  66345. * 1.没有同时设置 themeField 和 styleGroups,则所有专题要素都使用本图层的 style 进行渲染;</br>
  66346. * 2.同时设置 themeField 和 styleGroups,则按照 themeField 指定的字段名称获取用户数据(feature)attributes 中对应的属性值;</br>
  66347. * &nbsp;&nbsp;a.如果属性值等于 styleGroups 数组里某个元素定义的 value 值,则此专题要素取 styleGroups 数组中该元素定义的 style 进行渲染。</br>
  66348. * &nbsp;&nbsp;b.如果属性值不等于 styleGroups 数组里任何元素定义的 value 值,则此专题要素按照本图层的 style 进行渲染。</br>
  66349. * 此数组每个元素对象必须有两个属性:value : 与字段 themeField 相对应的属性值;style:专题要素 style。
  66350. */
  66351. _this.styleGroups = null;
  66352. Util.extend(LabelThemeLayer_assertThisInitialized(_this), opt_options);
  66353. _this.defaultStyle = {
  66354. //默认文本样式
  66355. fontColor: "#000000",
  66356. fontOpacity: 1,
  66357. fontSize: "12px",
  66358. fontStyle: "normal",
  66359. fontWeight: "normal",
  66360. labelAlign: "cm",
  66361. labelXOffset: 0,
  66362. labelYOffset: 0,
  66363. labelRotation: 0,
  66364. //默认样式
  66365. fill: false,
  66366. fillColor: "#ee9900",
  66367. fillOpacity: 0.4,
  66368. stroke: false,
  66369. strokeColor: "#ee9900",
  66370. strokeOpacity: 1,
  66371. strokeWidth: 1,
  66372. strokeLinecap: "round",
  66373. strokeDashstyle: "solid",
  66374. //默认显示背景框
  66375. labelRect: true,
  66376. //对用户隐藏但必须保持此值的属性
  66377. //cursor: "pointer",
  66378. labelSelect: true,
  66379. //用 _isGeoTextStrategyStyle 标记此style,携带此类style的要素特指GeoText策略中的标签要素
  66380. _isGeoTextStrategyStyle: true
  66381. }; //获取标签像素 bounds 的方式。0 - 表示通过文本类容和文本风格计算获取像素范围,现在支持中文、英文; 1 - 表示通过绘制的文本标签获取像素范围,支持各个语种的文字范围获取,但性能消耗较大(尤其是采用SVG渲染)。默认值为0。
  66382. _this.getPxBoundsMode = 0;
  66383. _this.labelFeatures = [];
  66384. return _this;
  66385. }
  66386. /**
  66387. * @function mapboxgl.supermap.LabelThemeLayer.prototype.redrawThematicFeatures
  66388. * @description 重绘所有专题要素。</br>
  66389. * 此方法包含绘制专题要素的所有步骤,包含用户数据到专题要素的转换,抽稀,缓存等步骤。</br>
  66390. * 地图漫游时调用此方法进行图层刷新。
  66391. * @param {mapboxgl.LngLatBounds} bounds - 重绘范围。
  66392. */
  66393. LabelThemeLayer_createClass(Label, [{
  66394. key: "redrawThematicFeatures",
  66395. value: function redrawThematicFeatures(bounds) {
  66396. if (this.features.length > 0 && this.labelFeatures.length == 0) {
  66397. var feats = this.setLabelsStyle(this.features);
  66398. for (var i = 0, len = feats.length; i < len; i++) {
  66399. this.labelFeatures.push(feats[i]);
  66400. }
  66401. }
  66402. this.features = this.getDrawnLabels(this.labelFeatures);
  66403. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "redrawThematicFeatures", this).call(this, bounds);
  66404. }
  66405. /**
  66406. * @function mapboxgl.supermap.LabelThemeLayer.prototype.removeFeatures
  66407. * @description 从专题图中删除 feature。这个函数删除所有传递进来的矢量要素。
  66408. * @param {SuperMap.Feature.Vector} features - 要删除的要素对象。
  66409. */
  66410. }, {
  66411. key: "removeFeatures",
  66412. value: function removeFeatures(features) {
  66413. // eslint-disable-line no-unused-vars
  66414. this.labelFeatures = [];
  66415. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "removeFeatures", this).call(this, arguments);
  66416. }
  66417. /**
  66418. * @function mapboxgl.supermap.LabelThemeLayer.prototype.removeAllFeatures
  66419. * @description 清除当前图层所有的矢量要素。
  66420. */
  66421. }, {
  66422. key: "removeAllFeatures",
  66423. value: function removeAllFeatures() {
  66424. this.labelFeatures = [];
  66425. LabelThemeLayer_get(LabelThemeLayer_getPrototypeOf(Label.prototype), "removeAllFeatures", this).call(this, arguments);
  66426. }
  66427. /**
  66428. * @function mapboxgl.supermap.LabelThemeLayer.prototype.createThematicFeature
  66429. * @description 创建专题图要素。
  66430. * @param {Object} feature - 要创建的专题图形要素。
  66431. */
  66432. }, {
  66433. key: "createThematicFeature",
  66434. value: function createThematicFeature(feature) {
  66435. //赋 style
  66436. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  66437. var options = {};
  66438. options.nodesClipPixel = this.nodesClipPixel;
  66439. options.isHoverAble = this.isHoverAble;
  66440. options.isMultiHover = this.isMultiHover;
  66441. options.isClickAble = this.isClickAble;
  66442. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  66443. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  66444. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  66445. this.renderer.addShape(thematicFeature.shapes[m]);
  66446. }
  66447. return thematicFeature;
  66448. }
  66449. /**
  66450. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getDrawnLabels
  66451. * @description 获取经(压盖)处理后将要绘制在图层上的标签要素。
  66452. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 所有标签要素的数组。
  66453. * @returns {Array.<SuperMap.Feature.Vector>} 最终要绘制的标签要素数组。
  66454. */
  66455. }, {
  66456. key: "getDrawnLabels",
  66457. value: function getDrawnLabels(labelFeatures) {
  66458. var feas = [],
  66459. //最终要绘制的标签要素集
  66460. fea,
  66461. //最终要绘制的标签要素
  66462. fi,
  66463. //临时标签要素,用户的第i个标签
  66464. labelsB = [],
  66465. //不产生压盖的标签要素范围集
  66466. styTmp,
  66467. //用于临时存储要素style的变量
  66468. feaSty,
  66469. //标签要素最终的style
  66470. // styleTemp用于屏蔽文本style中带有偏移性质style属性,偏移已经在计算bounds的过程中参与了运算,
  66471. // 所以在最终按照bounds来绘制标签时,需屏蔽style中带有偏移性质属性,否则文本的偏移量将扩大一倍。
  66472. styleTemp = {
  66473. labelAlign: "cm",
  66474. labelXOffset: 0,
  66475. labelYOffset: 0
  66476. };
  66477. var map = this.map;
  66478. var zoom = map.getZoom();
  66479. var canvas = map.getCanvas();
  66480. var mapSize = {
  66481. x: parseFloat(canvas.style.width),
  66482. y: parseFloat(canvas.style.height)
  66483. }; //对用户的每个标签要素进行处理与判断
  66484. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  66485. fi = labelFeatures[i]; //检查fi的style在避让中是否被改变,如果改变,重新设置要素的style
  66486. if (fi.isStyleChange || fi.isStyleChange === undefined) {
  66487. fi = this.setStyle(fi);
  66488. } //标签最终的中心点像素位置 (偏移后)
  66489. var loc = this.getLabelPxLocation(fi); //过滤掉地图范围外的标签 (偏移后)
  66490. if (loc.x >= 0 && loc.x <= mapSize.x && loc.y >= 0 && loc.y <= mapSize.y) {
  66491. //根据当前地图缩放级别过滤标签
  66492. if (fi.style.minZoomLevel > -1) {
  66493. if (zoom <= fi.style.minZoomLevel) {
  66494. continue;
  66495. }
  66496. }
  66497. if (fi.style.maxZoomLevel > -1) {
  66498. if (zoom > fi.style.maxZoomLevel) {
  66499. continue;
  66500. }
  66501. } //计算标签bounds
  66502. var boundsQuad = null;
  66503. if (fi.isStyleChange) {
  66504. fi.isStyleChange = null;
  66505. boundsQuad = this.calculateLabelBounds(fi, loc);
  66506. } else {
  66507. if (fi.geometry.bsInfo.w && fi.geometry.bsInfo.h) {
  66508. //使用calculateLabelBounds2可以提高bounds的计算效率,尤其是在getPxBoundsMode = 1时
  66509. boundsQuad = this.calculateLabelBounds2(fi, loc);
  66510. } else {
  66511. boundsQuad = this.calculateLabelBounds(fi, loc);
  66512. }
  66513. } //避让处理 -start
  66514. var mapViewBounds = new Bounds(0, mapSize.y, mapSize.x, 0),
  66515. //地图像素范围
  66516. quadlen = boundsQuad.length;
  66517. if (this.isAvoid) {
  66518. var avoidInfo = this.getAvoidInfo(mapViewBounds, boundsQuad); //避让信息
  66519. if (avoidInfo) {
  66520. //横向(x方向)上的避让
  66521. if (avoidInfo.aspectW === "left") {
  66522. fi.style.labelXOffset += avoidInfo.offsetX;
  66523. for (var j = 0; j < quadlen; j++) {
  66524. boundsQuad[j].x += avoidInfo.offsetX;
  66525. }
  66526. } else if (avoidInfo.aspectW === "right") {
  66527. fi.style.labelXOffset += -avoidInfo.offsetX;
  66528. for (var _j = 0; _j < quadlen; _j++) {
  66529. boundsQuad[_j].x += -avoidInfo.offsetX;
  66530. }
  66531. } //纵向(y方向)上的避让
  66532. if (avoidInfo.aspectH === "top") {
  66533. fi.style.labelYOffset += avoidInfo.offsetY;
  66534. for (var _j2 = 0; _j2 < quadlen; _j2++) {
  66535. boundsQuad[_j2].y += avoidInfo.offsetY;
  66536. }
  66537. } else if (avoidInfo.aspectH === "bottom") {
  66538. fi.style.labelYOffset += -avoidInfo.offsetY;
  66539. for (var _j3 = 0; _j3 < quadlen; _j3++) {
  66540. boundsQuad[_j3].y += -avoidInfo.offsetY;
  66541. }
  66542. } //如果style发生变化,记录下来
  66543. fi.isStyleChange = true;
  66544. }
  66545. } //避让处理 -end
  66546. //压盖处理 -start
  66547. if (this.isOverLay) {
  66548. //是否压盖
  66549. var isOL = false;
  66550. if (i != 0) {
  66551. for (var _j4 = 0; _j4 < labelsB.length; _j4++) {
  66552. //压盖判断
  66553. if (this.isQuadrilateralOverLap(boundsQuad, labelsB[_j4])) {
  66554. isOL = true;
  66555. break;
  66556. }
  66557. }
  66558. }
  66559. if (isOL) {
  66560. continue;
  66561. } else {
  66562. labelsB.push(boundsQuad);
  66563. }
  66564. } //压盖处理 -end
  66565. //背景(事件)-start
  66566. //将标签像素范围转为地理范围
  66567. var geoBs = [];
  66568. for (var _j5 = 0; _j5 < quadlen - 1; _j5++) {
  66569. geoBs.push(map.unproject(boundsQuad[_j5]));
  66570. } //屏蔽有偏移性质的style属性,偏移量在算bounds时已经加入计算
  66571. var leftBottom = geoBs[3];
  66572. var rightTop = geoBs[1];
  66573. var bounds = new Bounds(leftBottom.lng, leftBottom.lat, rightTop.lng, rightTop.lat);
  66574. var center = bounds.getCenterLonLat();
  66575. var label = new GeoText(center.lon, center.lat, fi.attributes[this.themeField]);
  66576. label.calculateBounds();
  66577. styTmp = Util.cloneObject(fi.style);
  66578. feaSty = Util.cloneObject(Util.copyAttributes(styTmp, styleTemp));
  66579. fea = new Vector(label, fi.attributes, feaSty); //赋予id
  66580. fea.id = fi.id;
  66581. fea.fid = fi.fid;
  66582. feas.push(fea);
  66583. }
  66584. } //返回最终要绘制的标签要素
  66585. return feas;
  66586. }
  66587. /**
  66588. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getStyleByData
  66589. * @description 根据用户数据(feature)设置专题要素的 Style。
  66590. * @param {SuperMap.Feature.Vector} feat - 矢量要素对象。
  66591. * @returns {Array.<SuperMap.ThemeStyle>} 专题要素的 Style。
  66592. */
  66593. }, {
  66594. key: "getStyleByData",
  66595. value: function getStyleByData(feat) {
  66596. var feature = feat;
  66597. feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  66598. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  66599. this.style.fontSize = "12px";
  66600. }
  66601. feature.style = Util.copyAttributes(feature.style, this.style);
  66602. if (this.themeField && this.styleGroups && feature.attributes) {
  66603. var Sf = this.themeField;
  66604. var attributes = feature.attributes;
  66605. var groups = this.styleGroups;
  66606. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  66607. var attr = null; //属性值
  66608. for (var property in attributes) {
  66609. if (Sf === property) {
  66610. isSfInAttrs = true;
  66611. attr = attributes[property];
  66612. break;
  66613. }
  66614. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  66615. if (isSfInAttrs) {
  66616. for (var i = 0, len = groups.length; i < len; i++) {
  66617. if (attr >= groups[i].start && attr < groups[i].end) {
  66618. var sty1 = groups[i].style;
  66619. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  66620. sty1.fontSize = "12px";
  66621. }
  66622. feature.style = Util.copyAttributes(feature.style, sty1);
  66623. }
  66624. }
  66625. }
  66626. feature.style.label = feature.attributes[this.themeField];
  66627. }
  66628. return feature.style;
  66629. }
  66630. /**
  66631. * @function mapboxgl.supermap.LabelThemeLayer.prototype.setLabelsStyle
  66632. * @description 设置标签要素的 Style。
  66633. * @param {Array.<SuperMap.Feature.Vector>} labelFeatures - 需要设置 Style 的标签要素数组。
  66634. * @returns {Array.<SuperMap.Feature.Vector>} 赋予 Style 后的标签要素数组。
  66635. */
  66636. }, {
  66637. key: "setLabelsStyle",
  66638. value: function setLabelsStyle(labelFeatures) {
  66639. var fea,
  66640. labelFeas = [];
  66641. for (var i = 0, len = labelFeatures.length; i < len; i++) {
  66642. var feature = labelFeatures[i];
  66643. if (feature.geometry.CLASS_NAME === "SuperMap.Geometry.GeoText") {
  66644. //设置标签的Style
  66645. if (feature.geometry.bsInfo.w || feature.geometry.bsInfo.h) {
  66646. feature.geometry.bsInfo.w = null;
  66647. feature.geometry.bsInfo.h = null;
  66648. feature.geometry.labelWTmp = null;
  66649. }
  66650. fea = this.setStyle(feature); //为标签要素指定图层
  66651. fea.layer = this.layer;
  66652. labelFeas.push(fea);
  66653. } else {
  66654. return labelFeatures;
  66655. }
  66656. }
  66657. return labelFeas;
  66658. }
  66659. /**
  66660. * @function mapboxgl.supermap.LabelThemeLayer.prototype.setStyle
  66661. * @description 设置标签要素的Style。
  66662. * @param {SuperMap.Feature.Vector} feat - 需要赋予 style 的要素。
  66663. */
  66664. }, {
  66665. key: "setStyle",
  66666. value: function setStyle(feat) {
  66667. var feature = feat;
  66668. feature.style = Util.copyAttributes(feature.style, this.defaultStyle); //将style赋给标签
  66669. if (this.style && this.style.fontSize && parseFloat(this.style.fontSize) < 12) {
  66670. this.style.fontSize = "12px";
  66671. }
  66672. feature.style = Util.copyAttributes(feature.style, this.style);
  66673. if (this.groupField && this.styleGroups && feature.attributes) {
  66674. var Sf = this.groupField;
  66675. var Attrs = feature.attributes;
  66676. var Gro = this.styleGroups;
  66677. var isSfInAttrs = false; //指定的 groupField 是否是geotext的属性字段之一
  66678. var attr = null; //属性值
  66679. for (var property in Attrs) {
  66680. if (Sf === property) {
  66681. isSfInAttrs = true;
  66682. attr = Attrs[property];
  66683. break;
  66684. }
  66685. } //判断属性值是否属于styleGroups的某一个范围,以便对标签分组
  66686. if (isSfInAttrs) {
  66687. for (var i = 0, len = Gro.length; i < len; i++) {
  66688. if (attr >= Gro[i].start && attr < Gro[i].end) {
  66689. //feature.style = Util.copyAttributes(feature.style, this.defaultStyle);
  66690. var sty1 = Gro[i].style;
  66691. if (sty1 && sty1.fontSize && parseFloat(sty1.fontSize) < 12) {
  66692. sty1.fontSize = "12px";
  66693. }
  66694. feature.style = Util.copyAttributes(feature.style, sty1);
  66695. }
  66696. }
  66697. }
  66698. } //将文本内容赋到标签要素的style上
  66699. feature.style.label = feature.geometry.text;
  66700. return feature;
  66701. }
  66702. /**
  66703. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getLabelPxLocation
  66704. * @description 获取标签要素的像素坐标。
  66705. * @param {SuperMap.Feature.Vector} feature - 标签要素。
  66706. * @returns {mapboxgl.Point} 标签位置。
  66707. */
  66708. }, {
  66709. key: "getLabelPxLocation",
  66710. value: function getLabelPxLocation(feature) {
  66711. var geoText = feature.geometry;
  66712. var styleTmp = feature.style; //将标签的地理位置转为像素位置
  66713. var locationTmp = geoText.getCentroid();
  66714. var locTmp = this.map.project(new (external_mapboxgl_default()).LngLat(locationTmp.x, locationTmp.y));
  66715. var loc = new (external_mapboxgl_default()).Point(locTmp.x, locTmp.y); //偏移处理
  66716. if (styleTmp.labelXOffset || styleTmp.labelYOffset) {
  66717. var xOffset = isNaN(styleTmp.labelXOffset) ? 0 : styleTmp.labelXOffset;
  66718. var yOffset = isNaN(styleTmp.labelYOffset) ? 0 : styleTmp.labelYOffset;
  66719. var point = loc.add(new (external_mapboxgl_default()).Point(xOffset, -yOffset));
  66720. return new (external_mapboxgl_default()).Point(point.x, point.y);
  66721. } else {
  66722. return new (external_mapboxgl_default()).Point(loc.x, loc.y);
  66723. }
  66724. }
  66725. /**
  66726. * @function mapboxgl.supermap.LabelThemeLayer.prototype.calculateLabelBounds
  66727. * @description 获得标签要素的最终范围。
  66728. *
  66729. * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
  66730. * @param {mapboxgl.Point} loc - 标签位置。
  66731. *
  66732. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  66733. */
  66734. }, {
  66735. key: "calculateLabelBounds",
  66736. value: function calculateLabelBounds(feature, loc) {
  66737. var geoText = feature.geometry; //标签范围(未旋转前)
  66738. var labB = null;
  66739. var labelInfo = null; //获取bounds的方式
  66740. if (this.getPxBoundsMode == 0) {
  66741. labB = geoText.getLabelPxBoundsByText(loc, feature.style);
  66742. } else if (this.getPxBoundsMode === 1) {
  66743. //canvas
  66744. labelInfo = this.getLabelInfo(feature.geometry.getCentroid(), feature.style);
  66745. labB = geoText.getLabelPxBoundsByLabel(loc, labelInfo.w, labelInfo.h, feature.style);
  66746. } else {
  66747. return null;
  66748. } //旋转Bounds
  66749. var boundsQuad = [];
  66750. if (feature.style.labelRotation % 180 == 0) {
  66751. boundsQuad = [{
  66752. "x": labB.left,
  66753. "y": labB.top
  66754. }, {
  66755. "x": labB.right,
  66756. "y": labB.top
  66757. }, {
  66758. "x": labB.right,
  66759. "y": labB.bottom
  66760. }, {
  66761. "x": labB.left,
  66762. "y": labB.bottom
  66763. }, {
  66764. "x": labB.left,
  66765. "y": labB.top
  66766. }];
  66767. } else {
  66768. boundsQuad = this.rotationBounds(labB, loc, feature.style.labelRotation);
  66769. } //重置GeoText的bounds
  66770. geoText.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  66771. return boundsQuad;
  66772. }
  66773. /**
  66774. * @function mapboxgl.supermap.LabelThemeLayer.prototype.calculateLabelBounds2
  66775. * @description 获得标签要素的最终范围的另一种算法(通过记录下的标签宽高),提高计算 bounds 的效率。
  66776. *
  66777. * @param {SuperMap.Feature.Vector} feature - 需要计算 bounds 的标签要素数。
  66778. * @param {mapboxgl.Point} loc - 标签位置。
  66779. *
  66780. * @returns {Array.<Object>} 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  66781. */
  66782. }, {
  66783. key: "calculateLabelBounds2",
  66784. value: function calculateLabelBounds2(feature, loc) {
  66785. var labB, left, bottom, top, right;
  66786. var labelSize = feature.geometry.bsInfo;
  66787. var style = feature.style;
  66788. var locationPx = Util.cloneObject(loc); //处理文字对齐
  66789. if (style.labelAlign && style.labelAlign !== "cm") {
  66790. switch (style.labelAlign) {
  66791. case "lt":
  66792. locationPx.x += labelSize.w / 2;
  66793. locationPx.y += labelSize.h / 2;
  66794. break;
  66795. case "lm":
  66796. locationPx.x += labelSize.w / 2;
  66797. break;
  66798. case "lb":
  66799. locationPx.x += labelSize.w / 2;
  66800. locationPx.y -= labelSize.h / 2;
  66801. break;
  66802. case "ct":
  66803. locationPx.y += labelSize.h / 2;
  66804. break;
  66805. case "cb":
  66806. locationPx.y -= labelSize.h / 2;
  66807. break;
  66808. case "rt":
  66809. locationPx.x -= labelSize.w / 2;
  66810. locationPx.y += labelSize.h / 2;
  66811. break;
  66812. case "rm":
  66813. locationPx.x -= labelSize.w / 2;
  66814. break;
  66815. case "rb":
  66816. locationPx.x -= labelSize.w / 2;
  66817. locationPx.y -= labelSize.h / 2;
  66818. break;
  66819. default:
  66820. break;
  66821. }
  66822. }
  66823. left = locationPx.x - labelSize.w / 2;
  66824. bottom = locationPx.y + labelSize.h / 2; //处理斜体字
  66825. if (style.fontStyle && style.fontStyle === "italic") {
  66826. right = locationPx.x + labelSize.w / 2 + parseInt(parseFloat(style.fontSize) / 2);
  66827. } else {
  66828. right = locationPx.x + labelSize.w / 2;
  66829. }
  66830. top = locationPx.y - labelSize.h / 2;
  66831. labB = new Bounds(left, bottom, right, top); //旋转Bounds
  66832. var boundsQuad = [];
  66833. if (style.labelRotation % 180 == 0) {
  66834. boundsQuad = [{
  66835. "x": labB.left,
  66836. "y": labB.top
  66837. }, {
  66838. "x": labB.right,
  66839. "y": labB.top
  66840. }, {
  66841. "x": labB.right,
  66842. "y": labB.bottom
  66843. }, {
  66844. "x": labB.left,
  66845. "y": labB.bottom
  66846. }, {
  66847. "x": labB.left,
  66848. "y": labB.top
  66849. }];
  66850. } else {
  66851. boundsQuad = this.rotationBounds(labB, loc, style.labelRotation);
  66852. } //重置GeoText的bounds
  66853. feature.geometry.bounds = new Bounds(boundsQuad[1].x, boundsQuad[3].y, boundsQuad[2].x, boundsQuad[4].y);
  66854. return boundsQuad;
  66855. }
  66856. /**
  66857. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getLabelInfo
  66858. * @description 根据当前位置获取绘制后的标签信息,包括标签的宽,高和行数等。
  66859. * @returns {Object} 绘制后的标签信息。
  66860. */
  66861. }, {
  66862. key: "getLabelInfo",
  66863. value: function getLabelInfo(location, style) {
  66864. var LABEL_ALIGN = {
  66865. "l": "left",
  66866. "r": "right",
  66867. "t": "top",
  66868. "b": "bottom"
  66869. },
  66870. LABEL_FACTOR = {
  66871. "l": 0,
  66872. "r": -1,
  66873. "t": 0,
  66874. "b": -1
  66875. };
  66876. style = Util.extend({
  66877. fontColor: "#000000",
  66878. labelAlign: "cm"
  66879. }, style);
  66880. var pt = this.getLocalXY(location);
  66881. var labelWidth = 0;
  66882. if (style.labelXOffset || style.labelYOffset) {
  66883. var xOffset = isNaN(style.labelXOffset) ? 0 : style.labelXOffset;
  66884. var yOffset = isNaN(style.labelYOffset) ? 0 : style.labelYOffset;
  66885. pt[0] += xOffset;
  66886. pt[1] -= yOffset;
  66887. }
  66888. var canvas = document.createElement('canvas');
  66889. canvas.globalAlpha = 0;
  66890. canvas.lineWidth = 1;
  66891. var ctx = canvas.getContext("2d");
  66892. ctx.fillStyle = style.fontColor;
  66893. ctx.globalAlpha = style.fontOpacity || 1.0;
  66894. 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(" ");
  66895. var labelRows = style.label.split('\n');
  66896. var numRows = labelRows.length;
  66897. var vfactor, lineHeight, labelWidthTmp;
  66898. if (ctx.fillText) {
  66899. // HTML5
  66900. ctx.font = fontStyle;
  66901. ctx.textAlign = LABEL_ALIGN[style.labelAlign[0]] || "center";
  66902. ctx.textBaseline = LABEL_ALIGN[style.labelAlign[1]] || "middle";
  66903. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  66904. if (vfactor == null) {
  66905. vfactor = -.5;
  66906. }
  66907. lineHeight = ctx.measureText('Mg').height || ctx.measureText('xx').width;
  66908. pt[1] += lineHeight * vfactor * (numRows - 1);
  66909. for (var i = 0; i < numRows; i++) {
  66910. labelWidthTmp = ctx.measureText(labelRows[i]).width;
  66911. if (labelWidth < labelWidthTmp) {
  66912. labelWidth = labelWidthTmp;
  66913. }
  66914. }
  66915. } else if (ctx.mozDrawText) {
  66916. // Mozilla pre-Gecko1.9.1 (<FF3.1)
  66917. ctx.mozTextStyle = fontStyle;
  66918. vfactor = LABEL_FACTOR[style.labelAlign[1]];
  66919. if (vfactor == null) {
  66920. vfactor = -.5;
  66921. }
  66922. lineHeight = ctx.mozMeasureText('xx');
  66923. pt[1] += lineHeight * (1 + vfactor * numRows);
  66924. for (var _i = 0; _i < numRows; _i++) {
  66925. labelWidthTmp = ctx.measureText(labelRows[_i]).width;
  66926. if (labelWidth < labelWidthTmp) {
  66927. labelWidth = labelWidthTmp;
  66928. }
  66929. }
  66930. }
  66931. var labelInfo = {}; //标签信息
  66932. if (labelWidth) {
  66933. labelInfo.w = labelWidth; //标签的宽
  66934. } else {
  66935. return null;
  66936. }
  66937. labelInfo.h = style.fontSize; //一行标签的高
  66938. labelInfo.rows = labelRows.length; //标签的行数
  66939. return labelInfo;
  66940. }
  66941. /**
  66942. * @function mapboxgl.supermap.LabelThemeLayer.prototype.rotationBounds
  66943. * @description 旋转 bounds。
  66944. *
  66945. * @param {SuperMap.Bounds} bounds - 要旋转的 bounds。
  66946. * @param {Object} rotationCenterPoi - 旋转中心点对象,此对象含有属性X(横坐标),属性Y(纵坐标)。
  66947. * @param {number} angle - 旋转角度(顺时针)。
  66948. *
  66949. * @returns {Array.<Object>} bounds 旋转后形成的多边形节点数组。是一个四边形,形如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]
  66950. */
  66951. }, {
  66952. key: "rotationBounds",
  66953. value: function rotationBounds(bounds, rotationCenterPoi, angle) {
  66954. var ltPoi = new (external_mapboxgl_default()).Point(bounds.left, bounds.top);
  66955. var rtPoi = new (external_mapboxgl_default()).Point(bounds.right, bounds.top);
  66956. var rbPoi = new (external_mapboxgl_default()).Point(bounds.right, bounds.bottom);
  66957. var lbPoi = new (external_mapboxgl_default()).Point(bounds.left, bounds.bottom);
  66958. var ver = [];
  66959. ver.push(this.getRotatedLocation(ltPoi.x, ltPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  66960. ver.push(this.getRotatedLocation(rtPoi.x, rtPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  66961. ver.push(this.getRotatedLocation(rbPoi.x, rbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle));
  66962. ver.push(this.getRotatedLocation(lbPoi.x, lbPoi.y, rotationCenterPoi.x, rotationCenterPoi.y, angle)); //bounds旋转后形成的多边形节点数组
  66963. var quad = [];
  66964. for (var i = 0; i < ver.length; i++) {
  66965. quad.push({
  66966. "x": ver[i].x,
  66967. "y": ver[i].y
  66968. });
  66969. }
  66970. quad.push({
  66971. "x": ver[0].x,
  66972. "y": ver[0].y
  66973. });
  66974. return quad;
  66975. }
  66976. /**
  66977. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getRotatedLocation
  66978. * @description 获取一个点绕旋转中心顺时针旋转后的位置(此方法用于屏幕坐标)。
  66979. *
  66980. * @param {number} x - 旋转点横坐标。
  66981. * @param {number} y - 旋转点纵坐标。
  66982. * @param {number} rx - 旋转中心点横坐标。
  66983. * @param {number} ry - 旋转中心点纵坐标。
  66984. * @param {number} angle - 旋转角度。
  66985. *
  66986. * @returns {Object} 旋转后的坐标位置对象,该对象含有属性X(横坐标),属性Y(纵坐标)。
  66987. */
  66988. }, {
  66989. key: "getRotatedLocation",
  66990. value: function getRotatedLocation(x, y, rx, ry, angle) {
  66991. var loc = {},
  66992. x0,
  66993. y0;
  66994. y = -y;
  66995. ry = -ry;
  66996. angle = -angle; //顺时针旋转
  66997. x0 = (x - rx) * Math.cos(angle / 180 * Math.PI) - (y - ry) * Math.sin(angle / 180 * Math.PI) + rx;
  66998. y0 = (x - rx) * Math.sin(angle / 180 * Math.PI) + (y - ry) * Math.cos(angle / 180 * Math.PI) + ry;
  66999. loc.x = x0;
  67000. loc.y = -y0;
  67001. return loc;
  67002. }
  67003. /**
  67004. * @function mapboxgl.supermap.LabelThemeLayer.prototype.getAvoidInfo
  67005. * @description 获取避让的信息。
  67006. *
  67007. * @param {SuperMap.Bounds} bounds - 地图像素范围。
  67008. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67009. *
  67010. * @returns {Object} 避让的信息。
  67011. */
  67012. }, {
  67013. key: "getAvoidInfo",
  67014. value: function getAvoidInfo(bounds, quadrilateral) {
  67015. if (quadrilateral.length !== 5) {
  67016. return null;
  67017. } //不是四边形
  67018. //将bound序列化为点数组形式
  67019. var bounddQuad = [{
  67020. "x": bounds.left,
  67021. "y": bounds.top
  67022. }, {
  67023. "x": bounds.right,
  67024. "y": bounds.top
  67025. }, {
  67026. "x": bounds.right,
  67027. "y": bounds.bottom
  67028. }, {
  67029. "x": bounds.left,
  67030. "y": bounds.bottom
  67031. }, {
  67032. "x": bounds.left,
  67033. "y": bounds.top
  67034. }];
  67035. var isIntersection = false,
  67036. bqLen = bounddQuad.length,
  67037. quadLen = quadrilateral.length;
  67038. var offsetX = 0,
  67039. offsetY = 0,
  67040. aspectH = "",
  67041. aspectW = "";
  67042. for (var i = 0; i < bqLen - 1; i++) {
  67043. for (var j = 0; j < quadLen - 1; j++) {
  67044. var isLineIn = Util.lineIntersection(bounddQuad[i], bounddQuad[i + 1], quadrilateral[j], quadrilateral[j + 1]);
  67045. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  67046. //设置避让信息
  67047. setInfo(quadrilateral[j]);
  67048. setInfo(quadrilateral[j + 1]);
  67049. isIntersection = true;
  67050. }
  67051. }
  67052. }
  67053. if (isIntersection) {
  67054. //组织避让操作所需的信息
  67055. return {
  67056. "aspectW": aspectW,
  67057. "aspectH": aspectH,
  67058. "offsetX": offsetX,
  67059. "offsetY": offsetY
  67060. };
  67061. } else {
  67062. return null;
  67063. } //内部函数:设置避让信息
  67064. //参数:{Object} vec- quadrilateral四边形单个节点。如:{"x":1,"y":1}。
  67065. function setInfo(vec) {
  67066. //四边形不在bounds内的节点
  67067. if (!bounds.contains(vec.x, vec.y)) {
  67068. //bounds的Top边
  67069. if (vec.y < bounds.top) {
  67070. var oY = Math.abs(bounds.top - vec.y);
  67071. if (oY > offsetY) {
  67072. offsetY = oY;
  67073. aspectH = "top";
  67074. }
  67075. } //bounds的Bottom边
  67076. if (vec.y > bounds.bottom) {
  67077. var _oY = Math.abs(vec.y - bounds.bottom);
  67078. if (_oY > offsetY) {
  67079. offsetY = _oY;
  67080. aspectH = "bottom";
  67081. }
  67082. } //bounds的left边
  67083. if (vec.x < bounds.left) {
  67084. var oX = Math.abs(bounds.left - vec.x);
  67085. if (oX > offsetX) {
  67086. offsetX = oX;
  67087. aspectW = "left";
  67088. }
  67089. } //bounds的right边
  67090. if (vec.x > bounds.right) {
  67091. var _oX = Math.abs(vec.x - bounds.right);
  67092. if (_oX > offsetX) {
  67093. offsetX = _oX;
  67094. aspectW = "right";
  67095. }
  67096. }
  67097. }
  67098. }
  67099. }
  67100. /**
  67101. * @function mapboxgl.supermap.LabelThemeLayer.prototype.isQuadrilateralOverLap
  67102. * @description 判断两个四边形是否有压盖。
  67103. * @param {Array.<Object>} quadrilateral - 四边形节点数组。例如:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]。
  67104. * @param {Array.<Object>} quadrilateral2 - 第二个四边形节点数组。
  67105. * @returns {boolean} 是否压盖,true 表示压盖。
  67106. */
  67107. }, {
  67108. key: "isQuadrilateralOverLap",
  67109. value: function isQuadrilateralOverLap(quadrilateral, quadrilateral2) {
  67110. var quadLen = quadrilateral.length,
  67111. quad2Len = quadrilateral2.length;
  67112. if (quadLen !== 5 || quad2Len !== 5) {
  67113. return null;
  67114. } //不是四边形
  67115. var OverLap = false; //如果两四边形互不包含对方的节点,则两个四边形不相交
  67116. for (var i = 0; i < quadLen; i++) {
  67117. if (this.isPointInPoly(quadrilateral[i], quadrilateral2)) {
  67118. OverLap = true;
  67119. break;
  67120. }
  67121. }
  67122. for (var _i2 = 0; _i2 < quad2Len; _i2++) {
  67123. if (this.isPointInPoly(quadrilateral2[_i2], quadrilateral)) {
  67124. OverLap = true;
  67125. break;
  67126. }
  67127. } //加上两矩形十字相交的情况
  67128. for (var _i3 = 0; _i3 < quadLen - 1; _i3++) {
  67129. if (OverLap) {
  67130. break;
  67131. }
  67132. for (var j = 0; j < quad2Len - 1; j++) {
  67133. var isLineIn = Util.lineIntersection(quadrilateral[_i3], quadrilateral[_i3 + 1], quadrilateral2[j], quadrilateral2[j + 1]);
  67134. if (isLineIn.CLASS_NAME === "SuperMap.Geometry.Point") {
  67135. OverLap = true;
  67136. break;
  67137. }
  67138. }
  67139. }
  67140. return OverLap;
  67141. }
  67142. /**
  67143. * @function mapboxgl.supermap.LabelThemeLayer.prototype.isPointInPoly
  67144. * @description 判断一个点是否在多边形里面。(射线法)
  67145. *
  67146. * @param {Object} pt - 需要判定的点对象,该对象含有属性x(横坐标),属性y(纵坐标)。
  67147. * @param {Array.<Object>} poly - 多边形节点数组。例如一个四边形:[{"x":1,"y":1},{"x":3,"y":1},{"x":6,"y":4},{"x":2,"y":10},{"x":1,"y":1}]
  67148. * @returns {boolean} 点是否在多边形内。
  67149. */
  67150. }, {
  67151. key: "isPointInPoly",
  67152. value: function isPointInPoly(pt, poly) {
  67153. for (var isIn = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) {
  67154. (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);
  67155. }
  67156. return isIn;
  67157. }
  67158. }]);
  67159. return Label;
  67160. }(GeoFeature);
  67161. (external_mapboxgl_default()).supermap.LabelThemeLayer = LabelThemeLayer_Label;
  67162. ;// CONCATENATED MODULE: external "function(){try{return mapv}catch(e){return {}}}()"
  67163. var external_function_try_return_mapv_catch_e_return_namespaceObject = function(){try{return mapv}catch(e){return {}}}();
  67164. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapvRenderer.js
  67165. function MapvRenderer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { MapvRenderer_typeof = function _typeof(obj) { return typeof obj; }; } else { MapvRenderer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return MapvRenderer_typeof(obj); }
  67166. function MapvRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67167. function MapvRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67168. function MapvRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  67169. function MapvRenderer_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { MapvRenderer_get = Reflect.get; } else { MapvRenderer_get = function _get(target, property, receiver) { var base = MapvRenderer_superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return MapvRenderer_get(target, property, receiver || target); }
  67170. function MapvRenderer_superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = MapvRenderer_getPrototypeOf(object); if (object === null) break; } return object; }
  67171. function MapvRenderer_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 } }); if (superClass) MapvRenderer_setPrototypeOf(subClass, superClass); }
  67172. function MapvRenderer_setPrototypeOf(o, p) { MapvRenderer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return MapvRenderer_setPrototypeOf(o, p); }
  67173. function MapvRenderer_createSuper(Derived) { var hasNativeReflectConstruct = MapvRenderer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = MapvRenderer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = MapvRenderer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return MapvRenderer_possibleConstructorReturn(this, result); }; }
  67174. function MapvRenderer_possibleConstructorReturn(self, call) { if (call && (MapvRenderer_typeof(call) === "object" || typeof call === "function")) { return call; } return MapvRenderer_assertThisInitialized(self); }
  67175. function MapvRenderer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  67176. function MapvRenderer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  67177. function MapvRenderer_getPrototypeOf(o) { MapvRenderer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return MapvRenderer_getPrototypeOf(o); }
  67178. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67179. * This program are made available under the terms of the Apache License, Version 2.0
  67180. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67181. var BaseLayer = external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer ? external_function_try_return_mapv_catch_e_return_namespaceObject.baiduMapLayer.__proto__ : Function;
  67182. /**
  67183. * @private
  67184. * @class MapvRenderer
  67185. * @classdesc MapV图层渲染。
  67186. * @param {Object} map - 地图。
  67187. * @param {Object} layer - 图层。
  67188. * @param {MapV.DataSet} dataSet - 数据集。
  67189. * @param {Object} options - 交互时所需可选参数。
  67190. * @extends {MapV.BaseLayer}
  67191. *
  67192. */
  67193. var MapvRenderer = /*#__PURE__*/function (_BaseLayer) {
  67194. MapvRenderer_inherits(MapvRenderer, _BaseLayer);
  67195. var _super = MapvRenderer_createSuper(MapvRenderer);
  67196. function MapvRenderer(map, layer, dataSet, options) {
  67197. var _this;
  67198. MapvRenderer_classCallCheck(this, MapvRenderer);
  67199. _this = _super.call(this, map, dataSet, options);
  67200. if (!BaseLayer) {
  67201. return MapvRenderer_possibleConstructorReturn(_this);
  67202. }
  67203. _this.map = map;
  67204. var self = MapvRenderer_assertThisInitialized(_this);
  67205. options = options || {};
  67206. self.init(options);
  67207. self.argCheck(options);
  67208. _this.canvasLayer = layer;
  67209. _this.stopAniamation = false;
  67210. _this.animation = options.animation;
  67211. _this.clickEvent = _this.clickEvent.bind(MapvRenderer_assertThisInitialized(_this));
  67212. _this.mousemoveEvent = _this.mousemoveEvent.bind(MapvRenderer_assertThisInitialized(_this));
  67213. _this.bindMapEvent();
  67214. _this.bindEvent();
  67215. _this._expectShow = true;
  67216. return _this;
  67217. }
  67218. /**
  67219. * @function MapvRenderer.prototype.clickEvent
  67220. * @description 点击绑定事件。
  67221. * @param {Object} e - 事件。
  67222. */
  67223. MapvRenderer_createClass(MapvRenderer, [{
  67224. key: "clickEvent",
  67225. value: function clickEvent(e) {
  67226. var pixel = e.point;
  67227. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "clickEvent", this).call(this, pixel, e);
  67228. }
  67229. /**
  67230. * @function MapvRenderer.prototype.mousemoveEvent
  67231. * @description 鼠标移动事件。
  67232. * @param {Object} e - 事件。
  67233. */
  67234. }, {
  67235. key: "mousemoveEvent",
  67236. value: function mousemoveEvent(e) {
  67237. var pixel = e.point;
  67238. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "mousemoveEvent", this).call(this, pixel, e);
  67239. }
  67240. /**
  67241. * @function MapvRenderer.prototype.bindEvent
  67242. * @description 绑定事件。
  67243. */
  67244. }, {
  67245. key: "bindEvent",
  67246. value: function bindEvent() {
  67247. var map = this.map;
  67248. if (this.options.methods) {
  67249. if (this.options.methods.click) {
  67250. map.on('click', this.clickEvent);
  67251. }
  67252. if (this.options.methods.mousemove) {
  67253. map.on('mousemove', this.mousemoveEvent);
  67254. }
  67255. }
  67256. }
  67257. /**
  67258. * @function MapvRenderer.prototype.unbindEvent
  67259. * @description 解绑事件。
  67260. */
  67261. }, {
  67262. key: "unbindEvent",
  67263. value: function unbindEvent() {
  67264. var map = this.map;
  67265. if (this.options.methods) {
  67266. if (this.options.methods.click) {
  67267. map.off('click', this.clickEvent);
  67268. }
  67269. if (this.options.methods.mousemove) {
  67270. map.off('mousemove', this.mousemoveEvent);
  67271. }
  67272. }
  67273. }
  67274. /**
  67275. * @function MapvRenderer.prototype.getContext
  67276. * @description 获取信息。
  67277. */
  67278. }, {
  67279. key: "getContext",
  67280. value: function getContext() {
  67281. return this.canvasLayer.canvas.getContext(this.context);
  67282. }
  67283. /**
  67284. * @function MapvRenderer.prototype.addData
  67285. * @description 添加数据。
  67286. * @param {oject} data - 待添加的数据。
  67287. * @param {oject} options - 待添加的数据信息。
  67288. */
  67289. }, {
  67290. key: "addData",
  67291. value: function addData(data, options) {
  67292. var _data = data;
  67293. if (data && data.get) {
  67294. _data = data.get();
  67295. }
  67296. this.dataSet.add(_data);
  67297. this.update({
  67298. options: options
  67299. });
  67300. }
  67301. /**
  67302. * @function MapvRenderer.prototype.update
  67303. * @description 更新图层。
  67304. * @param {Object} opt - 待更新的数据。
  67305. * @param {Object} opt.data - mapv 数据集。
  67306. * @param {Object} opt.options - mapv 绘制参数。
  67307. */
  67308. }, {
  67309. key: "update",
  67310. value: function update(opt) {
  67311. var update = opt || {};
  67312. var _data = update.data;
  67313. if (_data && _data.get) {
  67314. _data = _data.get();
  67315. }
  67316. if (_data != undefined) {
  67317. this.dataSet.set(_data);
  67318. }
  67319. MapvRenderer_get(MapvRenderer_getPrototypeOf(MapvRenderer.prototype), "update", this).call(this, {
  67320. options: update.options
  67321. });
  67322. }
  67323. /**
  67324. * @function MapvRenderer.prototype.getData
  67325. * @description 获取数据。
  67326. */
  67327. }, {
  67328. key: "getData",
  67329. value: function getData() {
  67330. return this.dataSet;
  67331. }
  67332. /**
  67333. * @function MapvRenderer.prototype.removeData
  67334. * @description 删除符合过滤条件的数据。
  67335. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为true,表示删除该元素;否则表示不删除。
  67336. */
  67337. }, {
  67338. key: "removeData",
  67339. value: function removeData(_filter) {
  67340. if (!this.dataSet) {
  67341. return;
  67342. }
  67343. var newData = this.dataSet.get({
  67344. filter: function filter(data) {
  67345. return _filter != null && typeof _filter === 'function' ? !_filter(data) : true;
  67346. }
  67347. });
  67348. this.dataSet.set(newData);
  67349. this.update({
  67350. options: null
  67351. });
  67352. }
  67353. /**
  67354. * @function MapVRenderer.prototype.clearData
  67355. * @description 清除数据。
  67356. */
  67357. }, {
  67358. key: "clearData",
  67359. value: function clearData() {
  67360. this.dataSet && this.dataSet.clear();
  67361. this.update({
  67362. options: null
  67363. });
  67364. }
  67365. /**
  67366. * @function MapVRenderer.prototype.updateData
  67367. * @param {Object} dataSet - 数据集。
  67368. * @param {Object} options - 数据项配置。
  67369. * @description 更新数据。
  67370. */
  67371. }, {
  67372. key: "updateData",
  67373. value: function updateData(dataSet, options) {
  67374. if (dataSet && dataSet.get) {
  67375. this.dataSet.set(dataSet.get());
  67376. }
  67377. this.update({
  67378. options: options
  67379. });
  67380. }
  67381. }, {
  67382. key: "_canvasUpdate",
  67383. value: function _canvasUpdate(time) {
  67384. var map = this.map;
  67385. if (!this.canvasLayer || this.stopAniamation) {
  67386. return;
  67387. }
  67388. var self = this;
  67389. var animationOptions = self.options.animation;
  67390. var context = this.getContext();
  67391. if (self.isEnabledTime()) {
  67392. if (time === undefined) {
  67393. this.clear(context);
  67394. return;
  67395. }
  67396. if (this.context === '2d') {
  67397. context.save();
  67398. context.globalCompositeOperation = 'destination-out';
  67399. context.fillStyle = 'rgba(0, 0, 0, .1)';
  67400. context.fillRect(0, 0, context.canvas.width, context.canvas.height);
  67401. context.restore();
  67402. }
  67403. } else {
  67404. this.clear(context);
  67405. }
  67406. if (this.context === '2d') {
  67407. for (var key in self.options) {
  67408. context[key] = self.options[key];
  67409. }
  67410. } else {
  67411. context.clear(context.COLOR_BUFFER_BIT);
  67412. }
  67413. if (self.options.minZoom && map.getZoom() < self.options.minZoom || self.options.maxZoom && map.getZoom() > self.options.maxZoom) {
  67414. return;
  67415. }
  67416. var bounds = map.getBounds(),
  67417. dw = bounds.getEast() - bounds.getWest(),
  67418. dh = bounds.getNorth() - bounds.getSouth();
  67419. var resolutionX = dw / this.canvasLayer.canvas.width,
  67420. resolutionY = dh / this.canvasLayer.canvas.height; // 一个像素是多少米
  67421. var zoomUnit = getMeterPerMapUnit('DEGREE') * resolutionX;
  67422. var center = map.getCenter();
  67423. var centerPx = map.project(center);
  67424. var dataGetOptions = {
  67425. transferCoordinate: function transferCoordinate(coordinate) {
  67426. if (map.transform.rotationMatrix || self.context === '2d') {
  67427. var worldPoint = map.project(new (external_mapboxgl_default()).LngLat(coordinate[0], coordinate[1]));
  67428. return [worldPoint.x, worldPoint.y];
  67429. }
  67430. var pixel = [(coordinate[0] - center.lng) / resolutionX, (center.lat - coordinate[1]) / resolutionY];
  67431. return [pixel[0] + centerPx.x, pixel[1] + centerPx.y];
  67432. }
  67433. };
  67434. if (time !== undefined) {
  67435. dataGetOptions.filter = function (item) {
  67436. var trails = animationOptions.trails || 10;
  67437. return time && item.time > time - trails && item.time < time;
  67438. };
  67439. }
  67440. var data = self.dataSet.get(dataGetOptions);
  67441. this.processData(data); // 兼容unit为'm'的情况
  67442. if (self.options.unit === 'm') {
  67443. if (self.options.size) {
  67444. self.options._size = self.options.size / zoomUnit;
  67445. }
  67446. if (self.options.width) {
  67447. self.options._width = self.options.width / zoomUnit;
  67448. }
  67449. if (self.options.height) {
  67450. self.options._height = self.options.height / zoomUnit;
  67451. }
  67452. } else {
  67453. self.options._size = self.options.size;
  67454. self.options._height = self.options.height;
  67455. self.options._width = self.options.width;
  67456. }
  67457. var worldPoint = map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  67458. this.drawContext(context, data, self.options, worldPoint);
  67459. self.options.updateCallback && self.options.updateCallback(time);
  67460. }
  67461. }, {
  67462. key: "init",
  67463. value: function init(options) {
  67464. var self = this;
  67465. self.options = options;
  67466. this.initDataRange(options);
  67467. this.context = self.options.context || '2d';
  67468. if (self.options.zIndex) {
  67469. this.canvasLayer && this.canvasLayer.setZIndex(self.options.zIndex);
  67470. }
  67471. this.initAnimator();
  67472. }
  67473. /**
  67474. * @function L.supermap.MapVRenderer.prototype.bindMapEvent
  67475. * @description 绑定鼠标移动事件。
  67476. */
  67477. }, {
  67478. key: "bindMapEvent",
  67479. value: function bindMapEvent() {
  67480. this.mapEvent = {
  67481. resizeEvent: this.resizeEvent.bind(this),
  67482. zoomStartEvent: this.zoomStartEvent.bind(this),
  67483. zoomEndEvent: this.zoomEndEvent.bind(this),
  67484. rotateStartEvent: this.rotateStartEvent.bind(this),
  67485. rotateEvent: this.rotateEvent.bind(this),
  67486. moveStartEvent: this.moveStartEvent.bind(this),
  67487. rotateEndEvent: this.rotateEndEvent.bind(this),
  67488. moveEvent: this.moveEvent.bind(this),
  67489. moveEndEvent: this.moveEndEvent.bind(this),
  67490. removeEvent: this.removeEvent.bind(this)
  67491. };
  67492. this.map.on('resize', this.mapEvent.resizeEvent);
  67493. this.map.on('zoomstart', this.mapEvent.zoomStartEvent);
  67494. this.map.on('zoomend', this.mapEvent.zoomEndEvent);
  67495. this.map.on('rotatestart', this.mapEvent.rotateStartEvent);
  67496. this.map.on('rotate', this.mapEvent.rotateEvent);
  67497. this.map.on('rotateend', this.mapEvent.rotateEndEvent); // this.map.on('dragend', this.dragEndEvent.bind(this));
  67498. this.map.on('movestart', this.mapEvent.moveStartEvent);
  67499. this.map.on('move', this.mapEvent.moveEvent);
  67500. this.map.on('moveend', this.mapEvent.moveEndEvent);
  67501. this.map.on('remove', this.mapEvent.removeEvent);
  67502. }
  67503. /**
  67504. * @function L.supermap.MapVRenderer.prototype.unbindMapEvent
  67505. * @description 解绑鼠标移动事件。
  67506. */
  67507. }, {
  67508. key: "unbindMapEvent",
  67509. value: function unbindMapEvent() {
  67510. this.map.off('resize', this.mapEvent.resizeEvent);
  67511. this.map.off('zoomstart', this.mapEvent.zoomStartEvent);
  67512. this.map.off('zoomend', this.mapEvent.zoomEndEvent);
  67513. this.map.off('rotatestart', this.mapEvent.rotateStartEvent);
  67514. this.map.off('rotate', this.mapEvent.rotateEvent);
  67515. this.map.off('rotateend', this.mapEvent.rotateEndEvent);
  67516. this.map.off('movestart', this.mapEvent.moveStartEvent);
  67517. this.map.off('move', this.mapEvent.moveEvent);
  67518. this.map.off('moveend', this.mapEvent.moveEndEvent);
  67519. this.map.off('remove', this.mapEvent.removeEvent);
  67520. }
  67521. /**
  67522. * @function L.supermap.MapVRenderer.prototype.destroy
  67523. * @description 释放资源。
  67524. */
  67525. }, {
  67526. key: "destroy",
  67527. value: function destroy() {
  67528. this.unbindMapEvent();
  67529. this.unbindEvent();
  67530. this.clearData();
  67531. this.animator && this.animator.stop();
  67532. this.animator = null;
  67533. this.canvasLayer = null;
  67534. }
  67535. /**
  67536. * @function MapvRenderer.prototype.addAnimatorEvent
  67537. * @description 添加动画事件。
  67538. */
  67539. }, {
  67540. key: "addAnimatorEvent",
  67541. value: function addAnimatorEvent() {}
  67542. /**
  67543. * @function MapvRenderer.prototype.removeEvent
  67544. * @description 移除事件。
  67545. */
  67546. }, {
  67547. key: "removeEvent",
  67548. value: function removeEvent() {
  67549. this.canvasLayer.mapContainer.removeChild(this.canvasLayer.canvas);
  67550. }
  67551. /**
  67552. * @function MapvRenderer.prototype.resizeEvent
  67553. * @description 调整事件。
  67554. */
  67555. }, {
  67556. key: "resizeEvent",
  67557. value: function resizeEvent() {
  67558. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  67559. var canvas = this.canvasLayer.canvas;
  67560. canvas.style.position = 'absolute';
  67561. canvas.style.top = 0 + 'px';
  67562. canvas.style.left = 0 + 'px';
  67563. var global$2 = typeof window === 'undefined' ? {} : window;
  67564. var devicePixelRatio = this.canvasLayer.devicePixelRatio = global$2.devicePixelRatio || 1;
  67565. canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio;
  67566. canvas.height = parseInt(this.map.getCanvas().style.height) * devicePixelRatio;
  67567. if (!this.canvasLayer.mapVOptions.context || this.canvasLayer.mapVOptions.context == '2d') {
  67568. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  67569. }
  67570. canvas.style.width = this.map.getCanvas().style.width;
  67571. canvas.style.height = this.map.getCanvas().style.height;
  67572. }
  67573. }, {
  67574. key: "moveEndEvent",
  67575. value: function moveEndEvent() {
  67576. this.stopAniamation = false;
  67577. var canvas = this.getContext().canvas;
  67578. canvas.style.transform = '';
  67579. this._canvasUpdate();
  67580. if (this._expectShow === true) {
  67581. this._show();
  67582. }
  67583. }
  67584. }, {
  67585. key: "moveStartEvent",
  67586. value: function moveStartEvent() {
  67587. this.startPitch = this.map.getPitch();
  67588. this.startBearing = this.map.getBearing();
  67589. var startMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  67590. this.startMoveX = startMovePoint.x;
  67591. this.startMoveY = startMovePoint.y;
  67592. if (this.animation) {
  67593. this.stopAniamation = true;
  67594. }
  67595. if (this.rotating || this.zooming) {
  67596. return;
  67597. }
  67598. this._expectShow = this.canvasLayer.canvas.style.display !== 'none';
  67599. if (this.map.getPitch() !== 0) {
  67600. this._hide();
  67601. }
  67602. }
  67603. }, {
  67604. key: "moveEvent",
  67605. value: function moveEvent() {
  67606. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  67607. var tPitch = this.map.getPitch() - this.startPitch;
  67608. var tBearing = -this.map.getBearing() + this.startBearing;
  67609. var endMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  67610. var tMoveX = endMovePoint.x - this.startMoveX;
  67611. var tMoveY = endMovePoint.y - this.startMoveY;
  67612. var canvas = this.getContext().canvas;
  67613. canvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  67614. }
  67615. }, {
  67616. key: "zoomStartEvent",
  67617. value: function zoomStartEvent() {
  67618. this.zooming = true;
  67619. this._hide();
  67620. }
  67621. }, {
  67622. key: "zoomEndEvent",
  67623. value: function zoomEndEvent() {
  67624. this.zooming = false;
  67625. }
  67626. }, {
  67627. key: "rotateStartEvent",
  67628. value: function rotateStartEvent() {
  67629. this.rotating = true;
  67630. if (this.map.getPitch() !== 0) {
  67631. this._hide();
  67632. }
  67633. }
  67634. }, {
  67635. key: "rotateEvent",
  67636. value: function rotateEvent() {
  67637. this.canvasLayer.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  67638. var tPitch = this.map.getPitch() - this.startPitch;
  67639. var tBearing = -this.map.getBearing() + this.startBearing;
  67640. var canvas = this.getContext().canvas;
  67641. canvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  67642. }
  67643. }, {
  67644. key: "rotateEndEvent",
  67645. value: function rotateEndEvent() {
  67646. this.rotating = false;
  67647. }
  67648. /**
  67649. * @function MapvRenderer.prototype.clear
  67650. * @param {Object} context - 当前环境。
  67651. * @description 清除环境。
  67652. */
  67653. }, {
  67654. key: "clear",
  67655. value: function clear(context) {
  67656. context && context.clearRect && context.clearRect(0, 0, parseInt(this.map.getCanvas().style.width), parseInt(this.map.getCanvas().style.height));
  67657. }
  67658. /**
  67659. * @function MapvRenderer.prototype.draw
  67660. * @description 渲染绘制。
  67661. */
  67662. }, {
  67663. key: "draw",
  67664. value: function draw() {
  67665. this._canvasUpdate();
  67666. }
  67667. }, {
  67668. key: "_hide",
  67669. value: function _hide() {
  67670. this.canvasLayer.canvas.style.display = 'none';
  67671. }
  67672. }, {
  67673. key: "_show",
  67674. value: function _show() {
  67675. this.canvasLayer.canvas.style.display = 'block';
  67676. }
  67677. }]);
  67678. return MapvRenderer;
  67679. }(BaseLayer);
  67680. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/MapvLayer.js
  67681. function MapvLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67682. 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); } }
  67683. function MapvLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) MapvLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) MapvLayer_defineProperties(Constructor, staticProps); return Constructor; }
  67684. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67685. * This program are made available under the terms of the Apache License, Version 2.0
  67686. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67687. /**
  67688. * @class mapboxgl.supermap.MapvLayer
  67689. * @category Visualization MapV
  67690. * @classdesc Mapv 图层。
  67691. * @param {mapboxgl.Map} map - mapboxgl 地图对象,将在下个版本弃用,请用 map.addLayer() 方法添加图层。
  67692. * @param {Mapv.DataSet} dataSet - MapV 图层数据集。
  67693. * @param {Object} mapVOptions - Mapv 参数。
  67694. * @param {string} [mapVOptions.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("mapvLayer_") 创建专题图层 ID。
  67695. */
  67696. var MapvLayer = /*#__PURE__*/function () {
  67697. function MapvLayer(map, dataSet, mapVOptions) {
  67698. MapvLayer_classCallCheck(this, MapvLayer);
  67699. this.map = map;
  67700. this.id = mapVOptions.layerID ? mapVOptions.layerID : Util.createUniqueID('mapvLayer_');
  67701. delete mapVOptions['layerID'];
  67702. this.mapVOptions = mapVOptions;
  67703. this.dataSet = dataSet;
  67704. this.visibility = true; //保留之前的用法
  67705. if (this.map) {
  67706. this.map.addLayer(this);
  67707. }
  67708. }
  67709. MapvLayer_createClass(MapvLayer, [{
  67710. key: "onAdd",
  67711. value: function onAdd(map) {
  67712. this.map = map;
  67713. this.renderer = new MapvRenderer(this.map, this, this.dataSet, this.mapVOptions);
  67714. this.canvas = this._createCanvas();
  67715. this.renderer._canvasUpdate();
  67716. this.mapContainer = map.getCanvasContainer();
  67717. this.mapContainer.appendChild(this.canvas);
  67718. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  67719. }
  67720. /**
  67721. * @function mapboxgl.supermap.MapvLayer.prototype.removeFromMap
  67722. * @description 移除图层。
  67723. */
  67724. }, {
  67725. key: "removeFromMap",
  67726. value: function removeFromMap() {
  67727. this.mapContainer.removeChild(this.canvas);
  67728. this.renderer.destroy();
  67729. }
  67730. /**
  67731. * @function mapboxgl.supermap.MapvLayer.prototype.setVisibility
  67732. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  67733. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  67734. */
  67735. }, {
  67736. key: "setVisibility",
  67737. value: function setVisibility(visibility) {
  67738. if (visibility !== this.visibility) {
  67739. this.visibility = visibility;
  67740. if (visibility) {
  67741. this.show();
  67742. } else {
  67743. this.hide();
  67744. }
  67745. }
  67746. }
  67747. /**
  67748. * @function mapboxgl.supermap.MapvLayer.prototype.moveTo
  67749. * @description 将图层移动到某个图层之前。
  67750. * @param {string} layerID - 待插入的图层 ID。
  67751. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  67752. */
  67753. }, {
  67754. key: "moveTo",
  67755. value: function moveTo(layerID, before) {
  67756. var layer = document.getElementById(this.canvas.id);
  67757. before = before !== undefined ? before : true;
  67758. if (before) {
  67759. var beforeLayer = document.getElementById(layerID);
  67760. if (layer && beforeLayer) {
  67761. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  67762. }
  67763. return;
  67764. }
  67765. var nextLayer = document.getElementById(layerID);
  67766. if (layer) {
  67767. if (nextLayer.nextSibling) {
  67768. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  67769. return;
  67770. }
  67771. nextLayer.parentNode.appendChild(layer);
  67772. }
  67773. }
  67774. /**
  67775. * @function mapboxgl.supermap.MapvLayer.prototype.getTopLeft
  67776. * @description 获取左上的距离。
  67777. */
  67778. }, {
  67779. key: "getTopLeft",
  67780. value: function getTopLeft() {
  67781. var map = this.map;
  67782. var topLeft;
  67783. if (map) {
  67784. var bounds = map.getBounds();
  67785. topLeft = bounds.getNorthWest();
  67786. }
  67787. return topLeft;
  67788. }
  67789. /**
  67790. * @function mapboxgl.supermap.MapvLayer.prototype.addData
  67791. * @description 追加数据。
  67792. * @param {Object} data - 要追加的数据。
  67793. * @param {Object} options - 要追加的值。
  67794. */
  67795. }, {
  67796. key: "addData",
  67797. value: function addData(data, options) {
  67798. this.renderer.addData(data, options);
  67799. }
  67800. /**
  67801. * @function mapboxgl.supermap.MapvLayer.prototype.update
  67802. * @description 更新图层。
  67803. * @param {Object} opt - 待更新的数据。
  67804. * @param {Object} opt.data - mapv 数据集。
  67805. * @param {Object} opt.options - mapv 绘制参数。
  67806. */
  67807. }, {
  67808. key: "update",
  67809. value: function update(opt) {
  67810. this.renderer.update(opt);
  67811. }
  67812. /**
  67813. * @function mapboxgl.supermap.MapvLayer.prototype.getData
  67814. * @description 获取数据。
  67815. * @returns {mapv.DataSet} mapv 数据集。
  67816. */
  67817. }, {
  67818. key: "getData",
  67819. value: function getData() {
  67820. if (this.renderer) {
  67821. this.dataSet = this.renderer.getData();
  67822. }
  67823. return this.dataSet;
  67824. }
  67825. /**
  67826. * @function mapboxgl.supermap.MapvLayer.prototype.removeData
  67827. * @description 删除符合过滤条件的数据。
  67828. * @param {function} [filter] - 过滤条件。条件参数为数据项,返回值为 true,表示删除该元素;否则表示不删除。
  67829. * @example
  67830. * filter=function(data){
  67831. * if(data.id=="1"){
  67832. * return true
  67833. * }
  67834. * return false;
  67835. * }
  67836. */
  67837. }, {
  67838. key: "removeData",
  67839. value: function removeData(filter) {
  67840. this.renderer && this.renderer.removeData(filter);
  67841. }
  67842. /**
  67843. * @function mapboxgl.supermap.MapvLayer.prototype.clearData
  67844. * @description 清除数据。
  67845. */
  67846. }, {
  67847. key: "clearData",
  67848. value: function clearData() {
  67849. this.renderer.clearData();
  67850. }
  67851. }, {
  67852. key: "show",
  67853. value: function show() {
  67854. if (this.renderer) {
  67855. this.renderer._show();
  67856. }
  67857. return this;
  67858. }
  67859. }, {
  67860. key: "hide",
  67861. value: function hide() {
  67862. if (this.renderer) {
  67863. this.renderer._hide();
  67864. }
  67865. return this;
  67866. }
  67867. }, {
  67868. key: "_createCanvas",
  67869. value: function _createCanvas() {
  67870. var canvas = document.createElement('canvas');
  67871. canvas.id = this.id;
  67872. canvas.style.position = 'absolute';
  67873. canvas.style.top = 0 + 'px';
  67874. canvas.style.left = 0 + 'px';
  67875. var global$2 = typeof window === 'undefined' ? {} : window;
  67876. var devicePixelRatio = this.devicePixelRatio = global$2.devicePixelRatio || 1;
  67877. canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio;
  67878. canvas.height = parseInt(this.map.getCanvas().style.height) * devicePixelRatio;
  67879. if (!this.mapVOptions.context || this.mapVOptions.context == '2d') {
  67880. canvas.getContext('2d').scale(devicePixelRatio, devicePixelRatio);
  67881. }
  67882. canvas.style.width = this.map.getCanvas().style.width;
  67883. canvas.style.height = this.map.getCanvas().style.height;
  67884. return canvas;
  67885. }
  67886. /**
  67887. * @function mapboxgl.supermap.MapvLayer.prototype.setZIndex
  67888. * @description 设置 canvas 层级。
  67889. * @param {number} zIndex - canvas 层级。
  67890. */
  67891. }, {
  67892. key: "setZIndex",
  67893. value: function setZIndex(z) {
  67894. this.canvas.style.zIndex = z;
  67895. }
  67896. }]);
  67897. return MapvLayer;
  67898. }();
  67899. (external_mapboxgl_default()).supermap.MapvLayer = MapvLayer;
  67900. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/Theme3DLayer.js
  67901. function Theme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  67902. function Theme3DLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  67903. function Theme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) Theme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) Theme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  67904. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  67905. * This program are made available under the terms of the Apache License, Version 2.0
  67906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  67907. /**
  67908. * @class mapboxgl.supermap.Theme3DLayer
  67909. * @category Visualization Theme
  67910. * @classdesc 三维专题图基类,不能直接实例化。
  67911. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  67912. * @param {Object} layerOptions -专题图图层配置项。
  67913. * @param {number} [layerOptions.opacity=1] - 图层透明度。
  67914. * @param {boolean} [layerOptions.parseNumber=fasle] - 是否预处理数据,将数据转换为 number。
  67915. * @param {boolean} [layerOptions.enableHighlight=false] - 是否开启高亮。
  67916. * @param {string} [layerOptions.highlight="#ADA91E"] - 高亮颜色。
  67917. * @param {string} [layerOptions.baseHeightField] - 数据中表示基础高度的字段。
  67918. * @param {number} [layerOptions.height] - 高度。如果数据指定的 heightField (为height)没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  67919. * @param {string} [layerOptions.heightField] - 数据中表示高度的字段。
  67920. * @param {string} [layerOptions.themeField] - 专题展示的字段。
  67921. * @param {boolean} [playerOptions.showLegend=true] - 是否显示图例。
  67922. * @param {string} [layerOptions.legendTitle] - 图例标题。
  67923. * @param {string} [layerOptions.legendTheme='light'] - 图例主题,取值:'light','dark'。
  67924. * @param {string} [layerOptions.legendOrientation='horizontal'] - 图例方向,取值:'horizontal','vertical'。
  67925. * @param {string} [layerOptions.legendPosition] - 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  67926. */
  67927. var Theme3DLayer = /*#__PURE__*/function () {
  67928. function Theme3DLayer(id, layerOptions) {
  67929. Theme3DLayer_classCallCheck(this, Theme3DLayer);
  67930. /**
  67931. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.id
  67932. * @description Mapbox GL 图层 id。
  67933. */
  67934. this.id = id;
  67935. /**
  67936. * @member {Object} mapboxgl.supermap.Theme3DLayer.prototype.map
  67937. * @description Mapbox GL 地图对象。
  67938. */
  67939. this.map = null;
  67940. /**
  67941. * @member {number} [mapboxgl.supermap.Theme3DLayer.prototype.opacity=1]
  67942. * @description 图层透明度。
  67943. */
  67944. this.opacity = 1;
  67945. /**
  67946. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.parseNumber=false]
  67947. * @description 是否进行数据预处理,有些字段是 string 类型,需要转换为 number。
  67948. */
  67949. this.parseNumber = false;
  67950. /**
  67951. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.enableHighlight=false]
  67952. * @description 是否开启高亮。
  67953. */
  67954. this.enableHighlight = false;
  67955. /**
  67956. * @member {Object} [mapboxgl.supermap.Theme3DLayer.prototype.highlight={color: "#ADA91E"}]
  67957. * @description 高亮相关配置。
  67958. */
  67959. this.highlight = {
  67960. color: "#ADA91E"
  67961. };
  67962. /**
  67963. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.baseHeightField
  67964. * @description 数据中表示基础高度的字段。
  67965. */
  67966. this.baseHeightField = null;
  67967. /**
  67968. * @member {number} mapboxgl.supermap.Theme3DLayer.prototype.height
  67969. * @description 高度。如果数据指定的 heightField (默认 height) 没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  67970. */
  67971. this.height = null;
  67972. /**
  67973. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.heightField
  67974. * @description 数据中表示高度的字段。
  67975. */
  67976. this.heightField = 'height';
  67977. /**
  67978. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.themeField]
  67979. * @description 专题展示的字段。
  67980. */
  67981. this.themeField = this.heightField;
  67982. /**
  67983. * @member {boolean} [mapboxgl.supermap.Theme3DLayer.prototype.showLegend=true]
  67984. * @description 是否显示图例。
  67985. */
  67986. this.showLegend = true;
  67987. /**
  67988. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendTitle]
  67989. * @description 图例标题。
  67990. */
  67991. this.legendTitle = null;
  67992. /**
  67993. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendTheme='light']
  67994. * @description 图例主题,取值:'light','dark'。
  67995. * @default 'light'
  67996. */
  67997. this.legendTheme = 'light';
  67998. /**
  67999. * @member {string} [mapboxgl.supermap.Theme3DLayer.prototype.legendOrientation='horizontal']
  68000. * @description 图例方向,取值:'horizontal','vertical'。
  68001. * @default 'horizontal'
  68002. */
  68003. this.legendOrientation = 'horizontal';
  68004. /**
  68005. * @member {string} mapboxgl.supermap.Theme3DLayer.prototype.legendPosition
  68006. * @description 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  68007. * @default 'bottom-right'
  68008. */
  68009. this.legendPosition = 'bottom-right';
  68010. this._highlightLayerId = "".concat(this.id, "-highlightLayer");
  68011. this._extend(this, layerOptions);
  68012. }
  68013. /**
  68014. * @function mapboxgl.supermap.Theme3DLayer.prototype.setLayerOptions
  68015. * @description 设置图层相关参数。
  68016. * @param {Object} layerOptions - 该专题图图层相关参数。
  68017. * @param {number} [layerOptions.opacity=1] - 图层透明度。
  68018. * @param {boolean} [layerOptions.parseNumber=false] - 是否预处理数据,将数据转换为 number。
  68019. * @param {string} [layerOptions.baseHeightField] - 数据中表示基础高度的字段
  68020. * @param {number} [layerOptions.height] - 高度。如果数据指定的heightField(默认height)没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  68021. * @param {string} [layerOptions.heightField] - 数据中表示高度的字段。
  68022. * @param {string} [layerOptions.themeField] - 专题展示的字段。
  68023. * @param {boolean} [layerOptions.showLegend=true] - 是否显示图例。
  68024. * @param {string} layerOptions.legendTitle - 图例标题。
  68025. * @param {string} [layerOptions.legendTheme='light'] - 图例主题,取值:'light','dark'。
  68026. * @param {string} [layerOptions.legendOrientation='horizontal'] - 图例方向,取值:'horizontal','vertical'。
  68027. * @param {string} [layerOptions.legendPosition] - 图例位置,取值:'top-right'|'top-left'|'bottom-left'|'bottom-right'。
  68028. * @returns {this}
  68029. */
  68030. Theme3DLayer_createClass(Theme3DLayer, [{
  68031. key: "setLayerOptions",
  68032. value: function setLayerOptions(layerOptions) {
  68033. this._extend(this, layerOptions);
  68034. return this;
  68035. }
  68036. /**
  68037. * @function mapboxgl.supermap.Theme3DLayer.prototype.setHighlightStyleOptions
  68038. * @description 设置图层高亮相关参数。
  68039. * @param {Object} highlightOptions - 该专题图图层高亮相关参数。
  68040. * @param {string} [highlightOptions.color] - 颜色。
  68041. * @param {function} highlightOptions.callback - 回调,返回数据参数(data,event)。
  68042. * @returns {this}
  68043. */
  68044. }, {
  68045. key: "setHighlightStyleOptions",
  68046. value: function setHighlightStyleOptions(highlightOptions) {
  68047. this._extend(this.highlight, highlightOptions);
  68048. return this;
  68049. }
  68050. /**
  68051. * @function mapboxgl.supermap.Theme3DLayer.prototype.setData
  68052. * @description 设置数据,数据格式必须为 GeoJSON 格式。
  68053. * @param {GeoJSONObject} data - GeoJSON 格式数据。
  68054. * @param {boolean} [parseNumber=false] - 是否进行数据预处理,有些字段是 string 类型,需要转换为 number。
  68055. */
  68056. }, {
  68057. key: "setData",
  68058. value: function setData(data, parseNumber) {
  68059. var me = this;
  68060. me.data = data;
  68061. if (parseNumber != null) {
  68062. me.parseNumber = parseNumber;
  68063. }
  68064. me.parseNumber && me.data && me.data.features && me.data.features.map(function (val) {
  68065. if (me.baseHeightField && val.properties[me.baseHeightField]) {
  68066. val.properties[me.baseHeightField] = parseFloat(val.properties[me.baseHeightField]);
  68067. }
  68068. if (me.heightField && val.properties[me.heightField]) {
  68069. val.properties[me.heightField] = parseFloat(val.properties[me.heightField]);
  68070. }
  68071. return val;
  68072. });
  68073. return this;
  68074. }
  68075. /**
  68076. * @function mapboxgl.supermap.Theme3DLayer.prototype.getData
  68077. * @description 获取数据。
  68078. * @returns {GeoJSONObject} 获取的数据。
  68079. */
  68080. }, {
  68081. key: "getData",
  68082. value: function getData() {
  68083. return this.data;
  68084. }
  68085. /**
  68086. * @function mapboxgl.supermap.Theme3DLayer.prototype.addTo
  68087. * @description 添加图层到地图上。
  68088. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  68089. * @returns {this} this 对象。
  68090. */
  68091. }, {
  68092. key: "addTo",
  68093. value: function addTo(map) {
  68094. this.map = map;
  68095. if (!this.map) {
  68096. return this;
  68097. }
  68098. this.show();
  68099. return this;
  68100. }
  68101. /**
  68102. * @function mapboxgl.supermap.Theme3DLayer.prototype.show
  68103. * @description 显示图层。
  68104. * @param {Object} options - 图层配置项。
  68105. * @returns {this} this 对象。
  68106. */
  68107. }, {
  68108. key: "show",
  68109. value: function show(options) {
  68110. this._extend(this, options);
  68111. this._addLayer();
  68112. if (this.enableHighlight) {
  68113. this._addHighLightLayer();
  68114. }
  68115. if (this.showLegend) {
  68116. if (!this.legend) {
  68117. this.legend = this._createLegendControl();
  68118. }
  68119. this.map.addControl(this.legend, this.legendPosition);
  68120. }
  68121. return this;
  68122. }
  68123. /**
  68124. * @function mapboxgl.supermap.Theme3DLayer.prototype.remove
  68125. * @description 从地图上移除图层。
  68126. * @returns {this} this 对象。
  68127. */
  68128. }, {
  68129. key: "remove",
  68130. value: function remove() {
  68131. if (!this.map) {
  68132. return this;
  68133. } //移除图层
  68134. var layerId = this.id ? this.id : "theme3DLayer";
  68135. if (this.map.getLayer(layerId)) {
  68136. this.map.off('mousemove', layerId, this._onMouseMove.bind(this));
  68137. this.map.on('mouseout', layerId, this._onMouseMove.bind(this));
  68138. this.map.removeLayer(layerId);
  68139. } //移除高亮图层
  68140. if (this.map.getLayer(this._highlightLayerId)) {
  68141. this._selectFeatureId = null;
  68142. this.map.removeLayer(this._highlightLayerId);
  68143. } //移除图例
  68144. if (this.legend) {
  68145. this.map.removeControl(this.legend);
  68146. }
  68147. return this;
  68148. }
  68149. /**
  68150. * @function mapboxgl.supermap.Theme3DLayer.prototype.getLayerStyleOptions
  68151. * @description 获取图层样式。
  68152. * @returns {Object} Mapbox GL 样式对象。
  68153. */
  68154. }, {
  68155. key: "getLayerStyleOptions",
  68156. value: function getLayerStyleOptions() {//子类重写实现
  68157. }
  68158. /**
  68159. * @function mapboxgl.supermap.Theme3DLayer.prototype.getHighlightStyleOptions
  68160. * @description 获取高亮样式,子类重写实现。
  68161. * @returns {Object} Mapbox GL 样式对象。
  68162. */
  68163. }, {
  68164. key: "getHighlightStyleOptions",
  68165. value: function getHighlightStyleOptions() {//子类重写实现
  68166. }
  68167. }, {
  68168. key: "_createLegendControl",
  68169. value: function _createLegendControl(html) {
  68170. var me = this;
  68171. function LegendControl() {}
  68172. LegendControl.prototype.onAdd = function (map) {
  68173. this._map = map;
  68174. this._container = document.createElement('div');
  68175. var className = 'mapboxgl-ctrl legend ';
  68176. var theme = 'legend-light';
  68177. if (me.legendTheme === 'dark') {
  68178. theme = 'legend-dark';
  68179. }
  68180. var orientation = ' legend-horizontal';
  68181. if (me.legendOrientation === 'vertical') {
  68182. orientation = ' legend-vertical';
  68183. }
  68184. this._container.className = className + theme + orientation;
  68185. if (html) {
  68186. this._container.innerHTML = html;
  68187. } else {
  68188. var legendTitle = me.legendTitle || "";
  68189. var titleElement = " <div class='legend-title'>" + legendTitle + "</div>";
  68190. var content = me._createLegendElement.call(me) || "";
  68191. var contentElement = "<div class='legend-content'>" + content + "</div>";
  68192. this._container.innerHTML = titleElement + contentElement;
  68193. }
  68194. me._appendLegendCSSStyle();
  68195. return this._container;
  68196. };
  68197. LegendControl.prototype.onRemove = function () {
  68198. this._container.parentNode.removeChild(this._container);
  68199. this._map = undefined;
  68200. };
  68201. return new LegendControl();
  68202. }
  68203. }, {
  68204. key: "_createLegendElement",
  68205. value: function _createLegendElement() {//子类实现
  68206. }
  68207. }, {
  68208. key: "_addLayer",
  68209. value: function _addLayer() {
  68210. var paintOptions = this.getLayerStyleOptions();
  68211. var id = this.id ? this.id : "theme3DLayer";
  68212. var sourceId = this.sourceId = id + 'Source';
  68213. if (!this.map.getSource(sourceId)) {
  68214. this.map.addSource(sourceId, {
  68215. 'type': 'geojson',
  68216. 'data': this.data
  68217. });
  68218. } else {
  68219. this.map.removeSource(sourceId);
  68220. this.map.addSource(sourceId, {
  68221. 'type': 'geojson',
  68222. 'data': this.data
  68223. });
  68224. }
  68225. this.map.addLayer({
  68226. 'id': id,
  68227. 'type': 'fill-extrusion',
  68228. 'source': sourceId,
  68229. 'paint': paintOptions
  68230. });
  68231. this.map.moveLayer(id);
  68232. } //添加高亮图层
  68233. }, {
  68234. key: "_addHighLightLayer",
  68235. value: function _addHighLightLayer() {
  68236. if (!this.map) {
  68237. return;
  68238. }
  68239. var map = this.map;
  68240. map.addLayer({
  68241. 'id': this._highlightLayerId,
  68242. 'type': 'fill-extrusion',
  68243. 'source': this.sourceId,
  68244. 'paint': this.getHighlightStyleOptions(),
  68245. "filter": ["in", "$id", ""]
  68246. });
  68247. this._selectFeatureId = null;
  68248. map.on('mousemove', this.id, this._onMouseMove.bind(this));
  68249. map.on('mouseout', this.id, this._onMouseMove.bind(this));
  68250. }
  68251. }, {
  68252. key: "_onMouseMove",
  68253. value: function _onMouseMove(e) {
  68254. var me = this,
  68255. map = this.map;
  68256. var features = map.queryRenderedFeatures(e.point, {
  68257. layers: [me.id]
  68258. });
  68259. if (me.highlight && me.highlight.callback) {
  68260. me.highlight.callback(features, e);
  68261. }
  68262. if (!features || features.length < 1) {
  68263. me._clearHighlight.call(me);
  68264. me._selectFeatureId = null;
  68265. return;
  68266. }
  68267. var id = features[0].id;
  68268. if (me._selectFeatureId === id) {
  68269. return;
  68270. }
  68271. me._selectFeatureId = id;
  68272. map.setFilter(me._highlightLayerId, ['==', '$id', me._selectFeatureId]);
  68273. }
  68274. }, {
  68275. key: "_clearHighlight",
  68276. value: function _clearHighlight() {
  68277. if (this.map) {
  68278. this.map.setFilter(this._highlightLayerId, ["in", "$id", ""]);
  68279. }
  68280. }
  68281. }, {
  68282. key: "_appendLegendCSSStyle",
  68283. value: function _appendLegendCSSStyle() {
  68284. var legendStyle = document.createElement('style');
  68285. legendStyle.type = 'text/css';
  68286. var baseStyle = "\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n ";
  68287. legendStyle.innerHTML = baseStyle + this._legendCSSStyle();
  68288. document.getElementsByTagName('head')[0].appendChild(legendStyle);
  68289. } //各种图层对应的自己的图例的样式
  68290. }, {
  68291. key: "_legendCSSStyle",
  68292. value: function _legendCSSStyle() {
  68293. //子类可重写实现
  68294. return "\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n ";
  68295. }
  68296. }, {
  68297. key: "_extend",
  68298. value: function _extend(dest) {
  68299. for (var index = 0; index < Object.getOwnPropertyNames(arguments).length; index++) {
  68300. var arg = Object.getOwnPropertyNames(arguments)[index];
  68301. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  68302. continue;
  68303. }
  68304. var obj = arguments[arg];
  68305. if (obj) {
  68306. for (var j = 0; j < Object.getOwnPropertyNames(obj).length; j++) {
  68307. var key = Object.getOwnPropertyNames(obj)[j];
  68308. if (arg == "caller" || arg == "callee" || arg == "length" || arg == "arguments") {
  68309. continue;
  68310. }
  68311. dest[key] = obj[key];
  68312. }
  68313. }
  68314. }
  68315. return dest;
  68316. }
  68317. }]);
  68318. return Theme3DLayer;
  68319. }();
  68320. (external_mapboxgl_default()).supermap.Theme3DLayer = Theme3DLayer;
  68321. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/RangeTheme3DLayer.js
  68322. function RangeTheme3DLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RangeTheme3DLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { RangeTheme3DLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RangeTheme3DLayer_typeof(obj); }
  68323. function RangeTheme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68324. function RangeTheme3DLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68325. function RangeTheme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RangeTheme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RangeTheme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68326. function RangeTheme3DLayer_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 } }); if (superClass) RangeTheme3DLayer_setPrototypeOf(subClass, superClass); }
  68327. function RangeTheme3DLayer_setPrototypeOf(o, p) { RangeTheme3DLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RangeTheme3DLayer_setPrototypeOf(o, p); }
  68328. function RangeTheme3DLayer_createSuper(Derived) { var hasNativeReflectConstruct = RangeTheme3DLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RangeTheme3DLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RangeTheme3DLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RangeTheme3DLayer_possibleConstructorReturn(this, result); }; }
  68329. function RangeTheme3DLayer_possibleConstructorReturn(self, call) { if (call && (RangeTheme3DLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RangeTheme3DLayer_assertThisInitialized(self); }
  68330. function RangeTheme3DLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68331. function RangeTheme3DLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68332. function RangeTheme3DLayer_getPrototypeOf(o) { RangeTheme3DLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RangeTheme3DLayer_getPrototypeOf(o); }
  68333. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68334. * This program are made available under the terms of the Apache License, Version 2.0
  68335. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68336. /**
  68337. * @class mapboxgl.supermap.RangeTheme3DLayer
  68338. * @category Visualization Theme
  68339. * @classdesc 三维分段专题图。
  68340. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  68341. * @param {Object} layerOptions - 专题图图层配置项,参数继承自 Theme3DLayer。
  68342. * @param {Array} [layerOptions.heightStops] - 新增参数,数据高度分段数组。
  68343. * @param {Array} layerOptions.colorStops - 新增参数,数据颜色分段数组。
  68344. * @param {number} [layerOptions.base] - 新增参数,数据分段线性增量。
  68345. * @param {number} [layerOptions.legendRatio=1] - 新增参数,图例数值扩大系数。
  68346. * @example
  68347. * new mapboxgl.supermap.RangeTheme3DLayer(layerId, map, {
  68348. * enableHighlight:true,
  68349. * // 设置分段
  68350. * heightField: "floor",
  68351. * heightStops: [[1, 10], [10, 100]],
  68352. * colorStops: [[0, 'rgba(33, 41, 52, 0.8)'], [20, 'rgba(69,117,180, 0.7)'], [50, 'rgba(116,173,209, 0.7)'], [100, 'rgba(171,217,233, 0.7)']],
  68353. * // 显示图例
  68354. * showLegend: true,
  68355. * legendTheme: 'dark',
  68356. * legendTitle: "图例"
  68357. * });
  68358. */
  68359. var RangeTheme3DLayer = /*#__PURE__*/function (_Theme3DLayer) {
  68360. RangeTheme3DLayer_inherits(RangeTheme3DLayer, _Theme3DLayer);
  68361. var _super = RangeTheme3DLayer_createSuper(RangeTheme3DLayer);
  68362. function RangeTheme3DLayer(id, layerOptions) {
  68363. var _this;
  68364. RangeTheme3DLayer_classCallCheck(this, RangeTheme3DLayer);
  68365. _this = _super.call(this, id, layerOptions);
  68366. /**
  68367. * @member {Array} mapboxgl.supermap.RangeTheme3DLayer.prototype.heightStops
  68368. * @description 数据高度分段数组。
  68369. */
  68370. _this.heightStops = null;
  68371. /**
  68372. * @member {Array} mapboxgl.supermap.RangeTheme3DLayer.prototype.colorStops
  68373. * @description 数据颜色分段数组。
  68374. */
  68375. _this.colorStops = null;
  68376. /**
  68377. * @member {number} mapboxgl.supermap.RangeTheme3DLayer.prototype.base
  68378. * @description 数据分段线性增量。
  68379. */
  68380. _this.base = null;
  68381. /**
  68382. * @member {number} [mapboxgl.supermap.RangeTheme3DLayer.prototype.legendRatio=1]
  68383. * @description 图例数值扩大系数。
  68384. */
  68385. _this.legendRatio = 1;
  68386. _this._extend(RangeTheme3DLayer_assertThisInitialized(_this), layerOptions);
  68387. return _this;
  68388. }
  68389. /**
  68390. * @function mapboxgl.supermap.RangeTheme3DLayer.prototype.getLayerStyleOptions
  68391. * @description 获取图层样式。
  68392. * @returns {Object} Mapbox GL 样式对象。
  68393. */
  68394. RangeTheme3DLayer_createClass(RangeTheme3DLayer, [{
  68395. key: "getLayerStyleOptions",
  68396. value: function getLayerStyleOptions() {
  68397. var opacity = this.opacity == null ? 1 : this.opacity;
  68398. opacity = isNaN(parseFloat(opacity)) ? 1 : parseFloat(opacity);
  68399. var reg = /^[0-9]+.?[0-9]*$/;
  68400. var options = {
  68401. 'fill-extrusion-color': {
  68402. 'stops': this.colorStops,
  68403. 'property': this.themeField || this.heightField,
  68404. 'type': 'interval',
  68405. 'base': reg.test(this.base) ? this.base : 1
  68406. },
  68407. 'fill-extrusion-opacity': opacity
  68408. };
  68409. if (this.heightStops) {
  68410. options['fill-extrusion-height'] = {
  68411. 'stops': this.heightStops,
  68412. 'property': this.heightField || 'height',
  68413. 'base': reg.test(this.base) ? this.base : 1
  68414. };
  68415. } else if (this.height) {
  68416. options['fill-extrusion-height'] = this.height;
  68417. } else {
  68418. options['fill-extrusion-height'] = {
  68419. 'property': this.heightField || 'height',
  68420. 'type': 'identity'
  68421. };
  68422. }
  68423. if (this.baseHeightField) {
  68424. options['fill-extrusion-base'] = {
  68425. 'property': this.baseHeightField,
  68426. 'type': 'identity'
  68427. };
  68428. }
  68429. return options;
  68430. }
  68431. /**
  68432. * @function mapboxgl.supermap.RangeTheme3DLayer.prototype.getHighlightStyleOptions
  68433. * @description 获取高亮样式。
  68434. * @returns {Object} mapboxgl 样式对象。
  68435. */
  68436. }, {
  68437. key: "getHighlightStyleOptions",
  68438. value: function getHighlightStyleOptions() {
  68439. var color = this.highlight && this.highlight.color != null ? this.highlight.color : '#ADA91E';
  68440. return {
  68441. 'fill-extrusion-color': color,
  68442. 'fill-extrusion-height': {
  68443. "stops": this.heightStops,
  68444. "property": this.heightField
  68445. },
  68446. 'fill-extrusion-opacity': this.highlight && this.highlight.opacity || 0.6
  68447. };
  68448. }
  68449. }, {
  68450. key: "_createLegendElement",
  68451. value: function _createLegendElement() {
  68452. var len = this.colorStops && this.colorStops.length || 0; //颜色分段对应标识
  68453. var legendListElement = "<ul>";
  68454. var i;
  68455. for (i = 0; i < len; i++) {
  68456. var value = this.colorStops[i][0];
  68457. var text = this._getWrapperText(value);
  68458. if (i === len - 1) {
  68459. text = "> " + text;
  68460. } else {
  68461. var next = this._getWrapperText(this.colorStops[i + 1][0]);
  68462. text = text + "-" + next;
  68463. }
  68464. var color = this.colorStops[i][1];
  68465. legendListElement += "<li><span style='background-color:" + color + ";'></span><span>" + text + "</span></li>";
  68466. }
  68467. legendListElement += "</ul>";
  68468. return legendListElement;
  68469. }
  68470. }, {
  68471. key: "_getWrapperText",
  68472. value: function _getWrapperText(number) {
  68473. var value = number * (this.legendRatio == null ? 1 : parseFloat(this.legendRatio)); //单个颜色值宽度为60px,最大只能完全显示1000000,否则就超出宽度,则显示以为k计数单位的值
  68474. var num = parseFloat(value);
  68475. if (num % 1000000 <= 1000000) {
  68476. return num.toString();
  68477. }
  68478. return parseInt(num / 1000) + 'k';
  68479. }
  68480. }]);
  68481. return RangeTheme3DLayer;
  68482. }(Theme3DLayer);
  68483. (external_mapboxgl_default()).supermap.RangeTheme3DLayer = RangeTheme3DLayer;
  68484. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/RangeThemeLayer.js
  68485. function RangeThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RangeThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { RangeThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RangeThemeLayer_typeof(obj); }
  68486. function RangeThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68487. function RangeThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68488. function RangeThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RangeThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RangeThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68489. function RangeThemeLayer_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 } }); if (superClass) RangeThemeLayer_setPrototypeOf(subClass, superClass); }
  68490. function RangeThemeLayer_setPrototypeOf(o, p) { RangeThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RangeThemeLayer_setPrototypeOf(o, p); }
  68491. function RangeThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = RangeThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RangeThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RangeThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RangeThemeLayer_possibleConstructorReturn(this, result); }; }
  68492. function RangeThemeLayer_possibleConstructorReturn(self, call) { if (call && (RangeThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RangeThemeLayer_assertThisInitialized(self); }
  68493. function RangeThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68494. function RangeThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68495. function RangeThemeLayer_getPrototypeOf(o) { RangeThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RangeThemeLayer_getPrototypeOf(o); }
  68496. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68497. * This program are made available under the terms of the Apache License, Version 2.0
  68498. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68499. /**
  68500. * @class mapboxgl.supermap.RangeThemeLayer
  68501. * @category Visualization Theme
  68502. * @classdesc 分段专题图层。
  68503. * @param {string} name - 图层名。
  68504. * @param {Object} options - 参数。
  68505. * @param {string} [options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  68506. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。
  68507. * @param {mapboxgl.Map} options.map - 当前 Mapbox GL map 对象。
  68508. * @param {number} [options.opacity=1] - 图层透明度。
  68509. * @param {string} options.themeField - 指定创建专题图字段。
  68510. * @param {Object} options.style - 专题图样式。
  68511. * @param {Object} options.styleGroups - 各专题类型样式组。
  68512. * @param {boolean} [options.isHoverAble=false] - 是否开启 hover 事件。
  68513. * @param {Object} [options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  68514. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  68515. */
  68516. var Range = /*#__PURE__*/function (_GeoFeature) {
  68517. RangeThemeLayer_inherits(Range, _GeoFeature);
  68518. var _super = RangeThemeLayer_createSuper(Range);
  68519. function Range(name, opt_options) {
  68520. var _this;
  68521. RangeThemeLayer_classCallCheck(this, Range);
  68522. _this = _super.call(this, name, opt_options);
  68523. _this.style = opt_options.style;
  68524. _this.isHoverAble = opt_options.isHoverAble;
  68525. _this.highlightStyle = opt_options.highlightStyle;
  68526. _this.themeField = opt_options.themeField;
  68527. _this.styleGroups = opt_options.styleGroups;
  68528. return _this;
  68529. }
  68530. /**
  68531. * @function mapboxgl.supermap.RangeThemeLayer.prototype.createThematicFeature
  68532. * @description 创建专题图要素。
  68533. * @param {Object} feature - 要创建的专题图形要素。
  68534. */
  68535. RangeThemeLayer_createClass(Range, [{
  68536. key: "createThematicFeature",
  68537. value: function createThematicFeature(feature) {
  68538. //赋 style
  68539. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  68540. var options = {};
  68541. options.nodesClipPixel = this.nodesClipPixel;
  68542. options.isHoverAble = this.isHoverAble;
  68543. options.isMultiHover = this.isMultiHover;
  68544. options.isClickAble = this.isClickAble;
  68545. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  68546. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  68547. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  68548. this.renderer.addShape(thematicFeature.shapes[m]);
  68549. }
  68550. return thematicFeature;
  68551. }
  68552. /**
  68553. * @private
  68554. * @function mapboxgl.supermap.RangeThemeLayer.prototype.getStyleByData
  68555. * @description 通过数据获取 style。
  68556. * @param {Object} fea - 要素数据。
  68557. */
  68558. }, {
  68559. key: "getStyleByData",
  68560. value: function getStyleByData(fea) {
  68561. var style = {};
  68562. var feature = fea;
  68563. style = Util.copyAttributesWithClip(style, this.style);
  68564. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  68565. var Sf = this.themeField;
  68566. var Attrs = feature.attributes;
  68567. var Gro = this.styleGroups;
  68568. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  68569. var attr = null; //属性值
  68570. for (var property in Attrs) {
  68571. if (Sf === property) {
  68572. isSfInAttrs = true;
  68573. attr = Attrs[property];
  68574. break;
  68575. }
  68576. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  68577. if (isSfInAttrs) {
  68578. for (var i = 0, len = Gro.length; i < len; i++) {
  68579. if (attr >= Gro[i].start && attr < Gro[i].end) {
  68580. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  68581. var sty1 = Gro[i].style;
  68582. style = Util.copyAttributesWithClip(style, sty1);
  68583. }
  68584. }
  68585. }
  68586. }
  68587. if (feature.style && this.isAllowFeatureStyle === true) {
  68588. style = Util.copyAttributesWithClip(feature.style);
  68589. }
  68590. return style;
  68591. }
  68592. }]);
  68593. return Range;
  68594. }(GeoFeature);
  68595. (external_mapboxgl_default()).supermap.RangeThemeLayer = Range;
  68596. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/RankSymbolThemeLayer.js
  68597. function RankSymbolThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { RankSymbolThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { RankSymbolThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return RankSymbolThemeLayer_typeof(obj); }
  68598. function RankSymbolThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68599. function RankSymbolThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68600. function RankSymbolThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) RankSymbolThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) RankSymbolThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68601. function RankSymbolThemeLayer_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 } }); if (superClass) RankSymbolThemeLayer_setPrototypeOf(subClass, superClass); }
  68602. function RankSymbolThemeLayer_setPrototypeOf(o, p) { RankSymbolThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return RankSymbolThemeLayer_setPrototypeOf(o, p); }
  68603. function RankSymbolThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = RankSymbolThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = RankSymbolThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = RankSymbolThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return RankSymbolThemeLayer_possibleConstructorReturn(this, result); }; }
  68604. function RankSymbolThemeLayer_possibleConstructorReturn(self, call) { if (call && (RankSymbolThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return RankSymbolThemeLayer_assertThisInitialized(self); }
  68605. function RankSymbolThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68606. function RankSymbolThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68607. function RankSymbolThemeLayer_getPrototypeOf(o) { RankSymbolThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return RankSymbolThemeLayer_getPrototypeOf(o); }
  68608. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68609. * This program are made available under the terms of the Apache License, Version 2.0
  68610. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68611. /**
  68612. * @class mapboxgl.supermap.RankSymbolThemeLayer
  68613. * @category Visualization Theme
  68614. * @classdesc 等级符号专题图层。
  68615. * @param {string} name - 图层名。
  68616. * @param {string} symbolType - 符号类型。
  68617. * @param {Object} opt_options - 参数。
  68618. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  68619. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  68620. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  68621. * @param {number} [opt_options.opacity=1] - 图层透明度。
  68622. * @param {string} opt_options.themeFields - 指定创建专题图字段。
  68623. * @param {boolean} [opt_options.isOverLay=true] - 是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。
  68624. * @param {string} [opt_options.chartsType] - 图表类型。目前可用:"Bar", "Line", "Pie"。
  68625. * @param {Object} [opt_options.symbolSetting] - 各类型图表的 symbolSetting 对象可设属性请参考具体图表模型类的注释中对 symbolSetting 对象可设属性的描述。symbolSetting 对象通常都具有以下 5 个基础可设属性:
  68626. * @param {number} [opt_options.symbolSetting.width] - 专题要素(图表)宽度。
  68627. * @param {number} [opt_options.symbolSetting.height] - 专题要素(图表)高度。
  68628. * @param {Array.<number>} opt_options.symbolSetting.codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。
  68629. * @param {number} [opt_options.symbolSetting.XOffset] - 专题要素(图表)在 X 方向上的偏移值,单位像素。
  68630. * @param {number} [opt_options.symbolSetting.YOffset] - 专题要素(图表)在 Y 方向上的偏移值,单位像素。
  68631. * @param {Array.<number>} opt_options.symbolSetting.dataViewBoxParameter - 数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。
  68632. * @param {number} opt_options.symbolSetting.decimalNumber - 数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。
  68633. * @extends {mapboxgl.supermap.GraphThemeLayer}
  68634. */
  68635. var RankSymbolThemeLayer_RankSymbol = /*#__PURE__*/function (_Graph) {
  68636. RankSymbolThemeLayer_inherits(RankSymbol, _Graph);
  68637. var _super = RankSymbolThemeLayer_createSuper(RankSymbol);
  68638. function RankSymbol(name, symbolType, opt_options) {
  68639. var _this;
  68640. RankSymbolThemeLayer_classCallCheck(this, RankSymbol);
  68641. _this = _super.call(this, name, symbolType, opt_options);
  68642. _this.symbolType = symbolType;
  68643. _this.symbolSetting = opt_options.symbolSetting;
  68644. _this.themeField = opt_options.themeField;
  68645. return _this;
  68646. }
  68647. /**
  68648. * @function mapboxgl.supermap.RankSymbolThemeLayer.prototype.setSymbolType
  68649. * @description 设置标志符号。
  68650. * @param {string} [symbolType] - 符号类型。
  68651. */
  68652. RankSymbolThemeLayer_createClass(RankSymbol, [{
  68653. key: "setSymbolType",
  68654. value: function setSymbolType(symbolType) {
  68655. this.symbolType = symbolType;
  68656. this.redraw();
  68657. }
  68658. /**
  68659. * @function mapboxgl.supermap.RankSymbolThemeLayer.prototype.createThematicFeature
  68660. * @description 创建专题图形要素。
  68661. * @param {Object} feature - 要创建的专题图形要素。
  68662. */
  68663. }, {
  68664. key: "createThematicFeature",
  68665. value: function createThematicFeature(feature) {
  68666. var thematicFeature; // 检查图形创建条件并创建图形
  68667. if (Theme_Theme[this.symbolType] && this.themeField && this.symbolSetting) {
  68668. thematicFeature = new Theme_Theme[this.symbolType](feature, this, [this.themeField], this.symbolSetting);
  68669. } // thematicFeature 是否创建成功
  68670. if (!thematicFeature) {
  68671. return false;
  68672. } // 对专题要素执行图形装载
  68673. thematicFeature.assembleShapes();
  68674. return thematicFeature;
  68675. }
  68676. }]);
  68677. return RankSymbol;
  68678. }(GraphThemeLayer_Graph);
  68679. (external_mapboxgl_default()).supermap.RankSymbolThemeLayer = RankSymbolThemeLayer_RankSymbol;
  68680. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/UniqueTheme3DLayer.js
  68681. function UniqueTheme3DLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UniqueTheme3DLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UniqueTheme3DLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UniqueTheme3DLayer_typeof(obj); }
  68682. function UniqueTheme3DLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68683. function UniqueTheme3DLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68684. function UniqueTheme3DLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UniqueTheme3DLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UniqueTheme3DLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68685. function UniqueTheme3DLayer_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 } }); if (superClass) UniqueTheme3DLayer_setPrototypeOf(subClass, superClass); }
  68686. function UniqueTheme3DLayer_setPrototypeOf(o, p) { UniqueTheme3DLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UniqueTheme3DLayer_setPrototypeOf(o, p); }
  68687. function UniqueTheme3DLayer_createSuper(Derived) { var hasNativeReflectConstruct = UniqueTheme3DLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UniqueTheme3DLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UniqueTheme3DLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UniqueTheme3DLayer_possibleConstructorReturn(this, result); }; }
  68688. function UniqueTheme3DLayer_possibleConstructorReturn(self, call) { if (call && (UniqueTheme3DLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UniqueTheme3DLayer_assertThisInitialized(self); }
  68689. function UniqueTheme3DLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68690. function UniqueTheme3DLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68691. function UniqueTheme3DLayer_getPrototypeOf(o) { UniqueTheme3DLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UniqueTheme3DLayer_getPrototypeOf(o); }
  68692. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68693. * This program are made available under the terms of the Apache License, Version 2.0
  68694. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68695. /**
  68696. * @class mapboxgl.supermap.UniqueTheme3DLayer
  68697. * @category Visualization Theme
  68698. * @classdesc 三维单值专题图。
  68699. * @param {string} [id] - 专题图图层 id。默认使用 CommonUtil.createUniqueID("theme3DLayer") 创建专题图层 ID。
  68700. * @param {Object} layerOptions - 专题图图层配置项,参数继承自 Theme3DLayer。
  68701. * @param {number} [layerOptions.height] - 新增参数,如果数据指定的 heightField (默认为 height )没有可以表示高度的字段,可以为所有数据统一设置一个高度。
  68702. * @param {Array} layerOptions.colorStops - 新增参数,数据颜色分段数组。
  68703. */
  68704. var UniqueTheme3DLayer = /*#__PURE__*/function (_Theme3DLayer) {
  68705. UniqueTheme3DLayer_inherits(UniqueTheme3DLayer, _Theme3DLayer);
  68706. var _super = UniqueTheme3DLayer_createSuper(UniqueTheme3DLayer);
  68707. function UniqueTheme3DLayer(id, layerOptions) {
  68708. var _this;
  68709. UniqueTheme3DLayer_classCallCheck(this, UniqueTheme3DLayer);
  68710. _this = _super.call(this, id, layerOptions);
  68711. /**
  68712. * @member mapboxgl.supermap.UniqueTheme3DLayer.prototype.colorStops -{Array}
  68713. * @description 数据颜色数组,如[["绿地","#CD7054"],["道路","#AD1283"]]。
  68714. */
  68715. _this.colorStops = null;
  68716. _this._extend(UniqueTheme3DLayer_assertThisInitialized(_this), layerOptions);
  68717. return _this;
  68718. }
  68719. /**
  68720. * @function mapboxgl.supermap.UniqueTheme3DLayer.prototype.getLayerStyleOptions
  68721. * @description 获取图层样式。
  68722. * @returns {Object} Mapbox GL 样式对象。
  68723. */
  68724. UniqueTheme3DLayer_createClass(UniqueTheme3DLayer, [{
  68725. key: "getLayerStyleOptions",
  68726. value: function getLayerStyleOptions() {
  68727. var opacity = this.opacity == null ? 1 : this.opacity;
  68728. opacity = isNaN(parseFloat(opacity)) ? 1 : parseFloat(opacity);
  68729. var options = {
  68730. 'fill-extrusion-color': {
  68731. 'stops': this.colorStops,
  68732. 'property': this.themeField,
  68733. 'type': 'categorical'
  68734. },
  68735. 'fill-extrusion-opacity': opacity
  68736. };
  68737. if (this.height != null) {
  68738. options['fill-extrusion-height'] = this.height;
  68739. } else {
  68740. options['fill-extrusion-height'] = {
  68741. 'property': this.heightField || 'height',
  68742. 'type': 'categorical'
  68743. };
  68744. }
  68745. if (this.baseHeightField) {
  68746. options['fill-extrusion-base'] = {
  68747. 'property': this.baseHeightField,
  68748. 'type': 'identity'
  68749. };
  68750. }
  68751. return options;
  68752. }
  68753. /**
  68754. * @function mapboxgl.supermap.UniqueTheme3DLayer.prototype.getHighlightStyleOptions
  68755. * @description 获取高亮样式。
  68756. * @returns {Object} Mapbox GL 样式对象。
  68757. */
  68758. }, {
  68759. key: "getHighlightStyleOptions",
  68760. value: function getHighlightStyleOptions() {
  68761. var color = this.highlight && this.highlight.color != null ? this.highlight.color : '#ADA91E';
  68762. var paint = {
  68763. 'fill-extrusion-color': color,
  68764. 'fill-extrusion-height': {
  68765. "stops": this.heightStops,
  68766. "property": this.heightField,
  68767. 'type': 'categorical'
  68768. },
  68769. 'fill-extrusion-opacity': this.highlight && this.highlight.opacity || 0.6
  68770. };
  68771. if (this.height != null) {
  68772. paint['fill-extrusion-height'] = this.height || 0;
  68773. }
  68774. return paint;
  68775. }
  68776. }, {
  68777. key: "_createLegendElement",
  68778. value: function _createLegendElement() {
  68779. var legendListElement = "<ul>";
  68780. var len = this.colorStops && this.colorStops.length || 0;
  68781. for (var i = 0; i < len; i++) {
  68782. var text = this.colorStops[i][0];
  68783. var color = this.colorStops[i][1];
  68784. legendListElement += "<li><span style='background-color:" + color + ";'></span><span>" + text + "</span></li>";
  68785. }
  68786. legendListElement += "</ul>";
  68787. return legendListElement;
  68788. }
  68789. }]);
  68790. return UniqueTheme3DLayer;
  68791. }(Theme3DLayer);
  68792. (external_mapboxgl_default()).supermap.UniqueTheme3DLayer = UniqueTheme3DLayer;
  68793. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/UniqueThemeLayer.js
  68794. function UniqueThemeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { UniqueThemeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { UniqueThemeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return UniqueThemeLayer_typeof(obj); }
  68795. function UniqueThemeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68796. function UniqueThemeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  68797. function UniqueThemeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) UniqueThemeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) UniqueThemeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  68798. function UniqueThemeLayer_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 } }); if (superClass) UniqueThemeLayer_setPrototypeOf(subClass, superClass); }
  68799. function UniqueThemeLayer_setPrototypeOf(o, p) { UniqueThemeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return UniqueThemeLayer_setPrototypeOf(o, p); }
  68800. function UniqueThemeLayer_createSuper(Derived) { var hasNativeReflectConstruct = UniqueThemeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = UniqueThemeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = UniqueThemeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return UniqueThemeLayer_possibleConstructorReturn(this, result); }; }
  68801. function UniqueThemeLayer_possibleConstructorReturn(self, call) { if (call && (UniqueThemeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return UniqueThemeLayer_assertThisInitialized(self); }
  68802. function UniqueThemeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  68803. function UniqueThemeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  68804. function UniqueThemeLayer_getPrototypeOf(o) { UniqueThemeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return UniqueThemeLayer_getPrototypeOf(o); }
  68805. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68806. * This program are made available under the terms of the Apache License, Version 2.0
  68807. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68808. /**
  68809. * @class mapboxgl.supermap.UniqueThemeLayer
  68810. * @category Visualization Theme
  68811. * @classdesc 单值专题图层。
  68812. * @param {string} name - 图层名。
  68813. * @param {Object} opt_options - 参数。
  68814. * @param {string} opt_options.themeField - 指定创建专题图字段。
  68815. * @param {Object} opt_options.style - 专题图样式。
  68816. * @param {Object} opt_options.styleGroups - 各专题类型样式组。
  68817. * @param {mapboxgl.Map} opt_options.map - 当前 mapboxgl map 对象。
  68818. * @param {string} [opt_options.id] - 专题图层 ID。默认使用 CommonUtil.createUniqueID("themeLayer_") 创建专题图层 ID。
  68819. * @param {boolean} [opt_options.loadWhileAnimating=true] - 是否实时重绘。
  68820. * @param {number} [opt_options.opacity=1] - 图层透明度。
  68821. * @param {boolean} [opt_options.isHoverAble=false] - 是否开启 hover 事件。
  68822. * @param {Object} [opt_options.highlightStyle] - 开启 hover 事件后,触发的样式风格。
  68823. * @extends {mapboxgl.supermap.GeoFeatureThemeLayer}
  68824. */
  68825. var Unique = /*#__PURE__*/function (_GeoFeature) {
  68826. UniqueThemeLayer_inherits(Unique, _GeoFeature);
  68827. var _super = UniqueThemeLayer_createSuper(Unique);
  68828. function Unique(name, opt_options) {
  68829. var _this;
  68830. UniqueThemeLayer_classCallCheck(this, Unique);
  68831. _this = _super.call(this, name, opt_options);
  68832. _this.themeField = opt_options.themeField;
  68833. _this.style = opt_options.style;
  68834. _this.styleGroups = opt_options.styleGroups;
  68835. _this.isHoverAble = opt_options.isHoverAble;
  68836. _this.highlightStyle = opt_options.highlightStyle;
  68837. return _this;
  68838. }
  68839. /**
  68840. * @private
  68841. * @function mapboxgl.supermap.UniqueThemeLayer.prototype.createThematicFeature
  68842. * @description 创建专题图要素。
  68843. * @param {Object} feature - 要创建的专题图形要素。
  68844. */
  68845. UniqueThemeLayer_createClass(Unique, [{
  68846. key: "createThematicFeature",
  68847. value: function createThematicFeature(feature) {
  68848. //赋 style
  68849. var style = this.getStyleByData(feature); //创建专题要素时的可选参数
  68850. var options = {};
  68851. options.nodesClipPixel = this.nodesClipPixel;
  68852. options.isHoverAble = this.isHoverAble;
  68853. options.isMultiHover = this.isMultiHover;
  68854. options.isClickAble = this.isClickAble;
  68855. options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); //将数据转为专题要素(Vector)
  68856. var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); //直接添加图形到渲染器
  68857. for (var m = 0; m < thematicFeature.shapes.length; m++) {
  68858. this.renderer.addShape(thematicFeature.shapes[m]);
  68859. }
  68860. return thematicFeature;
  68861. }
  68862. /**
  68863. * @private
  68864. * @function mapboxgl.supermap.UniqueThemeLayer.prototype.getStyleByData
  68865. * @description 通过数据获取 style。
  68866. * @param {Object} fea - 要素数据。
  68867. */
  68868. }, {
  68869. key: "getStyleByData",
  68870. value: function getStyleByData(fea) {
  68871. var style = {};
  68872. var feature = fea;
  68873. style = Util.copyAttributesWithClip(style, this.style);
  68874. if (this.themeField && this.styleGroups && this.styleGroups.length > 0 && feature.attributes) {
  68875. var tf = this.themeField;
  68876. var Attrs = feature.attributes;
  68877. var Gro = this.styleGroups;
  68878. var isSfInAttrs = false; //指定的 themeField 是否是 feature 的属性字段之一
  68879. var attr = null; //属性值
  68880. for (var property in Attrs) {
  68881. if (tf === property) {
  68882. isSfInAttrs = true;
  68883. attr = Attrs[property];
  68884. break;
  68885. }
  68886. } //判断属性值是否属于styleGroups的某一个范围,以便对获取分组 style
  68887. if (isSfInAttrs) {
  68888. for (var i = 0, len = Gro.length; i < len; i++) {
  68889. if (attr.toString() === Gro[i].value.toString()) {
  68890. //feature.style = CommonUtil.copyAttributes(feature.style, this.defaultStyle);
  68891. var sty1 = Gro[i].style;
  68892. style = Util.copyAttributesWithClip(style, sty1);
  68893. }
  68894. }
  68895. }
  68896. }
  68897. if (feature.style && this.isAllowFeatureStyle === true) {
  68898. style = Util.copyAttributesWithClip(feature.style);
  68899. }
  68900. return style;
  68901. }
  68902. }]);
  68903. return Unique;
  68904. }(GeoFeature);
  68905. (external_mapboxgl_default()).supermap.UniqueThemeLayer = Unique;
  68906. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/graphic/Graphic.js
  68907. function Graphic_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  68908. 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); } }
  68909. function Graphic_createClass(Constructor, protoProps, staticProps) { if (protoProps) Graphic_defineProperties(Constructor.prototype, protoProps); if (staticProps) Graphic_defineProperties(Constructor, staticProps); return Constructor; }
  68910. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  68911. * This program are made available under the terms of the Apache License, Version 2.0
  68912. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  68913. /**
  68914. * @class mapboxgl.supermap.Graphic
  68915. * @classdesc 高效率点图层点要素类。
  68916. * @category Visualization Graphic
  68917. * @param {(Object|Array.<number>)} lngLat - 坐标。格式:经纬度数组或包含{lng,lat}格式对象。
  68918. * @param {Object} style - 图形参数。
  68919. * @param {Array.<number>} [style.color] - 点颜色。目前只支持 rgba 数组。
  68920. * @param {Object} [style.radius] - 点半径。
  68921. * @param {Object} [attributes] - 属性信息。
  68922. * @example
  68923. * var graphic = new mapboxgl.supermap.Graphic(
  68924. * {
  68925. * lng:116,
  68926. * lat:39
  68927. * },{
  68928. * color:[255,0,0],
  68929. * radius:30
  68930. * }
  68931. * });
  68932. */
  68933. var Graphic = /*#__PURE__*/function () {
  68934. function Graphic(lngLat, style, attributes) {
  68935. Graphic_classCallCheck(this, Graphic);
  68936. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  68937. lng: lngLat[0],
  68938. lat: lngLat[1]
  68939. } : lngLat;
  68940. this.style = core_Util_Util.extend({}, style);
  68941. this.attributes = attributes;
  68942. }
  68943. /**
  68944. * @function mapboxgl.supermap.Graphic.prototype.getId
  68945. * @description 获取当前 ID。
  68946. * @returns {string} id
  68947. */
  68948. Graphic_createClass(Graphic, [{
  68949. key: "getId",
  68950. value: function getId() {
  68951. return this.id;
  68952. }
  68953. /**
  68954. * @function mapboxgl.supermap.Graphic.prototype.setId
  68955. * @description 设置当前要素 ID。
  68956. * @param {string} id - 要素 ID。
  68957. */
  68958. }, {
  68959. key: "setId",
  68960. value: function setId(id) {
  68961. this.id = id;
  68962. }
  68963. /**
  68964. * @function mapboxgl.supermap.Graphic.prototype.getLngLat
  68965. * @description 获取经纬度坐标。
  68966. * @returns {Object} 经纬度坐标,数据格式{lng,lat}。
  68967. */
  68968. }, {
  68969. key: "getLngLat",
  68970. value: function getLngLat() {
  68971. return this.lngLat;
  68972. }
  68973. /**
  68974. * @function mapboxgl.supermap.Graphic.prototype.setLngLat
  68975. * @description 设置经纬度坐标。
  68976. * @param {Object} lngLat - 经纬度坐标,数据格式{lng,lat}。
  68977. */
  68978. }, {
  68979. key: "setLngLat",
  68980. value: function setLngLat(lngLat) {
  68981. this.lngLat = core_Util_Util.isArray(lngLat) ? {
  68982. lng: lngLat[0],
  68983. lat: lngLat[1]
  68984. } : lngLat;
  68985. }
  68986. /**
  68987. * @function mapboxgl.supermap.Graphic.prototype.setStyle
  68988. * @description 设置点样式。
  68989. * @param {Object} style -样式选项。
  68990. * @param {Array} [style.color] - 颜色。
  68991. * @param {number} [style.radius] - 半径。
  68992. */
  68993. }, {
  68994. key: "setStyle",
  68995. value: function setStyle(style) {
  68996. this.style = core_Util_Util.extend(this.style, style);
  68997. }
  68998. /**
  68999. * @function mapboxgl.supermap.Graphic.prototype.getStyle
  69000. * @description 获取样式。
  69001. * @returns {Object} 点样式。
  69002. */
  69003. }, {
  69004. key: "getStyle",
  69005. value: function getStyle() {
  69006. return this.style;
  69007. }
  69008. /**
  69009. * @function mapboxgl.supermap.Graphic.prototype.setAttributes
  69010. * @description 设置属性信息。
  69011. * @param {Object} [attributes] - 属性信息。
  69012. */
  69013. }, {
  69014. key: "setAttributes",
  69015. value: function setAttributes(attributes) {
  69016. this.attributes = core_Util_Util.extend({}, this.attributes, attributes);
  69017. }
  69018. /**
  69019. * @function mapboxgl.supermap.Graphic.prototype.getAttributes
  69020. * @description 获取属性信息。
  69021. * @returns {Object} 属性信息。
  69022. */
  69023. }, {
  69024. key: "getAttributes",
  69025. value: function getAttributes() {
  69026. return this.attributes;
  69027. }
  69028. }]);
  69029. return Graphic;
  69030. }();
  69031. (external_mapboxgl_default()).supermap.Graphic = Graphic;
  69032. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/graphic/index.js
  69033. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69034. * This program are made available under the terms of the Apache License, Version 2.0
  69035. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69036. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/GraphicLayer.js
  69037. function GraphicLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69038. function GraphicLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69039. function GraphicLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraphicLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraphicLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69040. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69041. * This program are made available under the terms of the Apache License, Version 2.0
  69042. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69043. var defaultProps = {
  69044. color: [0, 0, 0, 255],
  69045. opacity: 0.8,
  69046. radius: 10,
  69047. radiusScale: 1,
  69048. radiusMinPixels: 0,
  69049. radiusMaxPixels: Number.MAX_SAFE_INTEGER,
  69050. strokeWidth: 1,
  69051. outline: false
  69052. };
  69053. /**
  69054. * @class mapboxgl.supermap.GraphicLayer
  69055. * @category Visualization Graphic
  69056. * @classdesc 高效率点图层。
  69057. * @param {string} [id] - 图层id。默认使用 CommonUtil.createUniqueID("graphicLayer_") 创建专题图层 ID。
  69058. * @param {Object} options - 图层配置项。
  69059. * @param {Array.<mapboxgl.supermap.Graphic>} options.graphics - 点要素对象数组 。
  69060. * @param {Array.<number>} [options.color=[0, 0, 0, 255]] - 颜色,目前只支持 rgba 数组。
  69061. * @param {number} [options.radius=10] - 半径。
  69062. * @param {number} [options.opacity=0.8] - 不透明度。
  69063. * @param {Array.<number>} [options.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  69064. * @param {number} [options.radiusScale=1] - 点放大倍数。
  69065. * @param {number} [options.radiusMinPixels=0] - 半径最小值(像素)。
  69066. * @param {number} [options.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  69067. * @param {number} [options.strokeWidth=1] - 边框大小。
  69068. * @param {boolean} [options.outline=false] - 是否显示边框。
  69069. */
  69070. var GraphicLayer = /*#__PURE__*/function () {
  69071. function GraphicLayer(id, options) {
  69072. GraphicLayer_classCallCheck(this, GraphicLayer);
  69073. var opt = core_Util_Util.extend(this, defaultProps, options);
  69074. /**
  69075. * @member {string} mapboxgl.supermap.GraphicLayer.prototype.id
  69076. * @description 高效率点图层 id。
  69077. */
  69078. this.id = id || Util.createUniqueID("graphicLayer_");
  69079. /**
  69080. * @member {Array.<mapboxgl.supermap.Graphic>} mapboxgl.supermap.GraphicLayer.prototype.graphics
  69081. * @description 点要素对象数组。
  69082. */
  69083. this.graphics = [].concat(opt.graphics);
  69084. /**
  69085. * @member {boolean} [mapboxgl.supermap.GraphicLayer.prototype.visibility=true]
  69086. * @description 图层显示状态属性。
  69087. */
  69088. this.visibility = true;
  69089. }
  69090. /**
  69091. * @function mapboxgl.supermap.GraphicLayer.prototype.addTo
  69092. * @description 图层添加到地图,将在下个版本废弃,请使用 onAdd() 代替。
  69093. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  69094. * @returns this
  69095. */
  69096. GraphicLayer_createClass(GraphicLayer, [{
  69097. key: "addTo",
  69098. value: function addTo(map) {
  69099. this.onAdd(map);
  69100. }
  69101. /**
  69102. * @function mapboxgl.supermap.GraphicLayer.prototype.onAdd
  69103. * @description 图层添加到地图。
  69104. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  69105. * @returns {mapboxgl.supermap.GraphicLayer}
  69106. */
  69107. }, {
  69108. key: "onAdd",
  69109. value: function onAdd(map) {
  69110. this.map = map;
  69111. if (this.canvas) {
  69112. this.mapContainer = this.map.getCanvasContainer();
  69113. this.mapContainer.appendChild(this.canvas);
  69114. return this;
  69115. }
  69116. this._initContainer(); //当使用扩展的mapboxgl代码时有效
  69117. if (map.getCRS && map.getCRS() !== (external_mapboxgl_default()).CRS.EPSG3857) {
  69118. this.coordinateSystem = 3;
  69119. this.isGeographicCoordinateSystem = true;
  69120. }
  69121. var mapState = this.getState();
  69122. var data = mapState.data,
  69123. color = mapState.color,
  69124. radius = mapState.radius,
  69125. opacity = mapState.opacity,
  69126. highlightColor = mapState.highlightColor,
  69127. radiusScale = mapState.radiusScale,
  69128. radiusMinPixels = mapState.radiusMinPixels,
  69129. radiusMaxPixels = mapState.radiusMaxPixels,
  69130. strokeWidth = mapState.strokeWidth,
  69131. outline = mapState.outline;
  69132. var me = this;
  69133. var layerOptions = {
  69134. id: 'scatter-plot',
  69135. data: data,
  69136. pickable: Boolean(this.onClick) || Boolean(this.onHover),
  69137. autoHighlight: true,
  69138. color: color,
  69139. opacity: opacity,
  69140. radius: radius,
  69141. radiusScale: radiusScale,
  69142. highlightColor: highlightColor,
  69143. radiusMinPixels: radiusMinPixels,
  69144. radiusMaxPixels: radiusMaxPixels,
  69145. strokeWidth: strokeWidth,
  69146. outline: outline,
  69147. isGeographicCoordinateSystem: this.isGeographicCoordinateSystem,
  69148. coordinateSystem: this.coordinateSystem,
  69149. getPosition: function getPosition(point) {
  69150. if (!point) {
  69151. return [0, 0, 0];
  69152. }
  69153. var lngLat = point.getLngLat();
  69154. return lngLat && [lngLat.lng, lngLat.lat, 0];
  69155. },
  69156. getColor: function getColor(point) {
  69157. var style = point && point.getStyle();
  69158. return style && style.color || me.color;
  69159. },
  69160. getRadius: function getRadius(point) {
  69161. var style = point && point.getStyle();
  69162. return style && style.radius || me.radius;
  69163. },
  69164. updateTriggers: {
  69165. getColor: [color],
  69166. getRadius: [radius]
  69167. }
  69168. };
  69169. if (this.onClick) {
  69170. layerOptions.onClick = this.onClick;
  69171. }
  69172. if (this.onHover) {
  69173. layerOptions.onHover = this.onHover;
  69174. }
  69175. this.layer = new window.DeckGL.ScatterplotLayer(layerOptions);
  69176. var deckOptions = {};
  69177. for (var key in mapState) {
  69178. deckOptions[key] = mapState[key];
  69179. }
  69180. deckOptions.layers = [this.layer];
  69181. deckOptions.canvas = this.canvas;
  69182. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  69183. this.map.on('render', this._moveEvent.bind(this));
  69184. this.map.on('resize', this._resizeEvent.bind(this));
  69185. this.draw();
  69186. return this;
  69187. }
  69188. /**
  69189. * @function mapboxgl.supermap.GraphicLayer.prototype.setStyle
  69190. * @description 设置图层整体样式。
  69191. * @param {Object} styleOptions - 样式对象。
  69192. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  69193. * @param {number} [styleOptions.radius=10] - 点半径。
  69194. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  69195. * @param {Array} [styleOptions.highlightColor=[0, 0, 128, 128]] - 高亮颜色,目前只支持 rgba 数组。
  69196. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  69197. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  69198. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  69199. * @param {number} [styleOptions.strokeWidth=1] - 边框大小。
  69200. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  69201. */
  69202. }, {
  69203. key: "setStyle",
  69204. value: function setStyle(styleOptions) {
  69205. var styleOpt = {
  69206. color: this.color,
  69207. radius: this.radius,
  69208. opacity: this.opacity,
  69209. highlightColor: this.highlightColor,
  69210. radiusScale: this.radiusScale,
  69211. radiusMinPixels: this.radiusMinPixels,
  69212. radiusMaxPixels: this.radiusMaxPixels,
  69213. strokeWidth: this.strokeWidth,
  69214. outline: this.outline
  69215. };
  69216. core_Util_Util.extend(this, styleOpt, styleOptions);
  69217. this.update();
  69218. }
  69219. /**
  69220. * @function mapboxgl.supermap.GraphicLayer.prototype.setGraphics
  69221. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  69222. * @param {Array.<mapboxgl.supermap.Graphic>} graphics - 点要素对象数组。
  69223. */
  69224. }, {
  69225. key: "setGraphics",
  69226. value: function setGraphics(graphics) {
  69227. this.graphics = this.graphics || [];
  69228. this.graphics.length = 0;
  69229. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  69230. if (!this.layer.props.data) {
  69231. this.layer.props.data = [];
  69232. }
  69233. this.layer.props.data.length = 0;
  69234. for (var i = 0; i < sGraphics.length; i++) {
  69235. this.layer.props.data.push(sGraphics[i]);
  69236. }
  69237. this.update();
  69238. }
  69239. /**
  69240. * @function mapboxgl.supermap.GraphicLayer.prototype.addGraphics
  69241. * @description 添加点要素,不会覆盖之前的要素。
  69242. * @param {Array.<mapboxgl.supermap.Graphic>} graphics - 点要素对象数组。
  69243. */
  69244. }, {
  69245. key: "addGraphics",
  69246. value: function addGraphics(graphics) {
  69247. this.graphics = this.graphics || [];
  69248. var sGraphics = !core_Util_Util.isArray(graphics) ? [graphics] : [].concat(graphics); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  69249. if (!this.layer.props.data) {
  69250. this.layer.props.data = [];
  69251. }
  69252. for (var i = 0; i < sGraphics.length; i++) {
  69253. this.layer.props.data.push(sGraphics[i]);
  69254. }
  69255. this.update();
  69256. }
  69257. /**
  69258. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicBy
  69259. * @description 在 Vector 的要素数组 graphics 里面遍历每一个 graphic,当 graphic[property]===value 时,返回此 graphic(并且只返回第一个)。
  69260. * @param {string} property - graphic 的某个属性名称。
  69261. * @param {string} value - property 所对应的值。
  69262. * @returns {ol.Graphic} 一个匹配的 graphic。
  69263. */
  69264. }, {
  69265. key: "getGraphicBy",
  69266. value: function getGraphicBy(property, value) {
  69267. var graphic = null;
  69268. for (var index in this.graphics) {
  69269. if (this.graphics[index][property] === value) {
  69270. graphic = this.graphics[index];
  69271. break;
  69272. }
  69273. }
  69274. return graphic;
  69275. }
  69276. /**
  69277. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicById
  69278. * @description 通过给定一个 id,返回对应的矢量要素。
  69279. * @param {string} graphicId - 矢量要素的属性 id
  69280. * @returns {ol.Graphic} 一个匹配的 graphic。
  69281. */
  69282. }, {
  69283. key: "getGraphicById",
  69284. value: function getGraphicById(graphicId) {
  69285. return this.getGraphicBy("id", graphicId);
  69286. }
  69287. /**
  69288. * @function mapboxgl.supermap.GraphicLayer.prototype.getGraphicsByAttribute
  69289. * @description 通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。
  69290. * @param {string} attrName - graphic 的某个属性名称。
  69291. * @param {string} attrValue - property 所对应的值。
  69292. * @returns {Array.<ol.Graphic>} 一个匹配的 graphic 数组。
  69293. */
  69294. }, {
  69295. key: "getGraphicsByAttribute",
  69296. value: function getGraphicsByAttribute(attrName, attrValue) {
  69297. var graphic,
  69298. foundgraphics = [];
  69299. for (var index in this.graphics) {
  69300. graphic = this.graphics[index];
  69301. if (graphic && graphic.attributes) {
  69302. if (graphic.attributes[attrName] === attrValue) {
  69303. foundgraphics.push(graphic);
  69304. }
  69305. }
  69306. }
  69307. return foundgraphics;
  69308. }
  69309. /**
  69310. * @function mapboxgl.supermap.GraphicLayer.prototype.removeGraphics
  69311. * @description 删除要素数组,默认将删除所有要素
  69312. * @param {Array.<ol.Graphic>} [graphics=null] - 删除的 graphics 数组
  69313. */
  69314. }, {
  69315. key: "removeGraphics",
  69316. value: function removeGraphics() {
  69317. var graphics = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  69318. //当 graphics 为 null 、为空数组,或 === this.graphics,则清除所有要素
  69319. if (!graphics || graphics.length === 0 || graphics === this.graphics) {
  69320. this.graphics.length = 0;
  69321. if (this.layer.props.data) {
  69322. this.layer.props.data.length = 0;
  69323. }
  69324. this.update();
  69325. return;
  69326. }
  69327. if (!Util.isArray(graphics)) {
  69328. graphics = [graphics];
  69329. }
  69330. for (var i = graphics.length - 1; i >= 0; i--) {
  69331. var graphic = graphics[i]; //如果我们传入的grapchic在graphics数组中没有的话,则不进行删除,
  69332. //并将其放入未删除的数组中。
  69333. var findex = Util.indexOf(this.graphics, graphic);
  69334. if (findex === -1) {
  69335. continue;
  69336. }
  69337. this.graphics.splice(findex, 1);
  69338. } //删除完成后重新设置 setGraphics,以更新
  69339. this.update();
  69340. }
  69341. /**
  69342. * @function mapboxgl.supermap.GraphicLayer.prototype.update
  69343. * @description 更新图层。
  69344. */
  69345. }, {
  69346. key: "update",
  69347. value: function update() {
  69348. if (this.layer.lifecycle !== 'Awaiting state') {
  69349. this.layer.setChangeFlags({
  69350. dataChanged: true,
  69351. propsChanged: true,
  69352. viewportChanged: true,
  69353. updateTriggersChanged: true
  69354. });
  69355. var state = this.getState();
  69356. this.layer.setState(state);
  69357. }
  69358. }
  69359. /**
  69360. * @function mapboxgl.supermap.GraphicLayer.prototype.clear
  69361. * @description 释放图层资源。
  69362. */
  69363. }, {
  69364. key: "clear",
  69365. value: function clear() {
  69366. this.removeGraphics();
  69367. this.deckGL.finalize();
  69368. }
  69369. /**
  69370. * @function mapboxgl.supermap.GraphicLayer.prototype.remove
  69371. * @description 删除该图层。
  69372. */
  69373. }, {
  69374. key: "remove",
  69375. value: function remove() {
  69376. this.map.off('render', this._moveEvent.bind(this));
  69377. this.map.off('resize', this._resizeEvent.bind(this));
  69378. this.map.getCanvasContainer().removeChild(this.canvas);
  69379. }
  69380. /**
  69381. * @function mapboxgl.supermap.GraphicLayer.prototype.removeFromMap
  69382. * @deprecated
  69383. * @description 删除该图层。
  69384. */
  69385. }, {
  69386. key: "removeFromMap",
  69387. value: function removeFromMap() {
  69388. this.remove();
  69389. this.clear();
  69390. }
  69391. /**
  69392. * @function mapboxgl.supermap.GraphicLayer.prototype.moveTo
  69393. * @description 将图层移动到某个图层之前。
  69394. * @param {string} layerID - 待插入的图层 ID。
  69395. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  69396. */
  69397. }, {
  69398. key: "moveTo",
  69399. value: function moveTo(layerID, before) {
  69400. var layer = document.getElementById(this.id);
  69401. before = before !== undefined ? before : true;
  69402. if (before) {
  69403. var beforeLayer = document.getElementById(layerID);
  69404. if (layer && beforeLayer) {
  69405. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  69406. }
  69407. return;
  69408. }
  69409. var nextLayer = document.getElementById(layerID);
  69410. if (layer) {
  69411. if (nextLayer.nextSibling) {
  69412. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  69413. return;
  69414. }
  69415. nextLayer.parentNode.appendChild(layer);
  69416. }
  69417. }
  69418. /**
  69419. * @function mapboxgl.supermap.GraphicLayer.prototype.setVisibility
  69420. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  69421. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  69422. */
  69423. }, {
  69424. key: "setVisibility",
  69425. value: function setVisibility(visibility) {
  69426. if (this.canvas && visibility !== this.visibility) {
  69427. this.visibility = visibility;
  69428. this.canvas.style.display = visibility ? "block" : "none";
  69429. }
  69430. }
  69431. /**
  69432. * @function mapboxgl.supermap.GraphicLayer.prototype.getState
  69433. * @description 获取当前地图及图层状态。
  69434. * @returns {Object} 地图及图层状态,包含地图状态信息和本图层相关状态。
  69435. */
  69436. }, {
  69437. key: "getState",
  69438. value: function getState() {
  69439. var map = this.map;
  69440. var width = parseInt(this.canvas.style.width);
  69441. var height = parseInt(this.canvas.style.height);
  69442. var center = map.getCenter();
  69443. var longitude = center.lng;
  69444. var latitude = center.lat;
  69445. var zoom = map.getZoom();
  69446. var maxZoom = map.getMaxZoom();
  69447. var pitch = map.getPitch();
  69448. var bearing = map.getBearing();
  69449. var mapViewport = {
  69450. longitude: longitude,
  69451. latitude: latitude,
  69452. zoom: zoom,
  69453. maxZoom: maxZoom,
  69454. pitch: pitch,
  69455. bearing: bearing
  69456. };
  69457. var state = {};
  69458. for (var key in mapViewport) {
  69459. state[key] = mapViewport[key];
  69460. }
  69461. state.width = width;
  69462. state.height = height;
  69463. state.data = this.graphics;
  69464. state.color = this.color;
  69465. state.radius = this.radius;
  69466. state.opacity = this.opacity;
  69467. state.highlightColor = this.highlightColor;
  69468. state.radiusScale = this.radiusScale;
  69469. state.radiusMinPixels = this.radiusMinPixels;
  69470. state.radiusMaxPixels = this.radiusMaxPixels;
  69471. state.strokeWidth = this.strokeWidth;
  69472. state.outline = this.outline; //当使用扩展的mapboxgl代码时有效
  69473. if (map.getCRS && map.getCRS() !== (external_mapboxgl_default()).CRS.EPSG3857) {
  69474. state.coordinateSystem = this.coordinateSystem;
  69475. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  69476. }
  69477. return state;
  69478. }
  69479. /**
  69480. * @function mapboxgl.supermap.GraphicLayer.prototype.draw
  69481. * @description 绘制图层。
  69482. */
  69483. }, {
  69484. key: "draw",
  69485. value: function draw() {
  69486. var mapState = this.getState();
  69487. var deckOptions = {};
  69488. for (var key in mapState) {
  69489. deckOptions[key] = mapState[key];
  69490. }
  69491. deckOptions.layers = [this.layer];
  69492. deckOptions.canvas = this.canvas;
  69493. this.deckGL.setProps(deckOptions);
  69494. }
  69495. }, {
  69496. key: "_moveEvent",
  69497. value: function _moveEvent() {
  69498. this.draw();
  69499. }
  69500. }, {
  69501. key: "_resizeEvent",
  69502. value: function _resizeEvent() {
  69503. var canvas = this.canvas;
  69504. var map = this.map;
  69505. canvas.width = parseInt(map.getCanvas().style.width);
  69506. canvas.height = parseInt(map.getCanvas().style.height);
  69507. canvas.style.width = map.getCanvas().style.width;
  69508. canvas.style.height = map.getCanvas().style.height;
  69509. this.draw();
  69510. }
  69511. }, {
  69512. key: "_initContainer",
  69513. value: function _initContainer() {
  69514. this.canvas = this._createCanvas();
  69515. this.mapContainer = this.map.getCanvasContainer();
  69516. this.mapContainer.appendChild(this.canvas);
  69517. }
  69518. }, {
  69519. key: "_createCanvas",
  69520. value: function _createCanvas() {
  69521. var canvas = document.createElement('canvas');
  69522. if (this.id) {
  69523. canvas.id = this.id;
  69524. }
  69525. canvas.style.position = 'absolute';
  69526. canvas.style.top = 0 + "px";
  69527. canvas.style.left = 0 + "px";
  69528. canvas.style.cursor = "";
  69529. var map = this.map;
  69530. canvas.width = parseInt(map.getCanvas().style.width);
  69531. canvas.height = parseInt(map.getCanvas().style.height);
  69532. canvas.style.width = map.getCanvas().style.width;
  69533. canvas.style.height = map.getCanvas().style.height;
  69534. return canvas;
  69535. }
  69536. }]);
  69537. return GraphicLayer;
  69538. }();
  69539. (external_mapboxgl_default()).supermap.GraphicLayer = GraphicLayer;
  69540. ;// CONCATENATED MODULE: external "function(){try{return THREE}catch(e){return {}}}()"
  69541. var external_function_try_return_THREE_catch_e_return_namespaceObject = function(){try{return THREE}catch(e){return {}}}();
  69542. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/Transform.js
  69543. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69544. * This program are made available under the terms of the Apache License, Version 2.0
  69545. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69546. function wrap(source, min, max) {
  69547. if (source === max || source === min) {
  69548. return source;
  69549. }
  69550. var len = max - min;
  69551. return ((source - min) % len + len) % len + min;
  69552. }
  69553. function rad(angle) {
  69554. return angle * Math.PI / 180;
  69555. }
  69556. var Projection = {
  69557. R: 6378137,
  69558. minZoom: 0,
  69559. maxZoom: 22,
  69560. nativeMaxZoom: 19,
  69561. RAD: Math.PI / 180,
  69562. METERS_PER_DEGREE: 6378137 * Math.PI / 180,
  69563. MAX_LATITUDE: 85.0511287798,
  69564. project: function project(lngLat) {
  69565. var rad = this.RAD,
  69566. metersPerDegree = this.METERS_PER_DEGREE,
  69567. max = this.MAX_LATITUDE;
  69568. var ll = lngLat instanceof Array ? {
  69569. lng: lngLat[0],
  69570. lat: lngLat[1]
  69571. } : {
  69572. lng: lngLat.lng,
  69573. lat: lngLat.lat
  69574. };
  69575. var lng = ll.lng,
  69576. lat = Math.max(Math.min(max, ll.lat), -max);
  69577. var c;
  69578. if (lat === 0) {
  69579. c = 0;
  69580. } else {
  69581. c = Math.log(Math.tan((90 + lat) * rad / 2)) / rad;
  69582. }
  69583. return {
  69584. x: lng * metersPerDegree,
  69585. y: c * metersPerDegree
  69586. };
  69587. },
  69588. unproject: function unproject(point) {
  69589. var x = point.x,
  69590. y = point.y;
  69591. var rad = this.RAD,
  69592. metersPerDegree = this.METERS_PER_DEGREE;
  69593. var c;
  69594. if (y === 0) {
  69595. c = 0;
  69596. } else {
  69597. c = y / metersPerDegree;
  69598. c = (2 * Math.atan(Math.exp(c * rad)) - Math.PI / 2) / rad;
  69599. }
  69600. return {
  69601. lng: wrap(x / metersPerDegree, -180, 180),
  69602. lat: wrap(c, -this.MAX_LATITUDE, this.MAX_LATITUDE)
  69603. };
  69604. },
  69605. locate: function locate(lngLat, dx, dy) {
  69606. if (!lngLat) {
  69607. return null;
  69608. }
  69609. dx = !dx ? 0 : dx;
  69610. dy = !dy ? 0 : dy;
  69611. if (!dx && !dy) {
  69612. return lngLat;
  69613. }
  69614. var lng = lngLat.lng;
  69615. if (dx !== 0) {
  69616. var ndx = Math.abs(dx),
  69617. radLng = rad(lngLat.lng);
  69618. var sLng = 2 * Math.sqrt(Math.pow(Math.sin(ndx / (2 * this.R)), 2) / Math.pow(Math.cos(radLng), 2));
  69619. radLng = radLng + sLng * (ndx > 0 ? 1 : -1);
  69620. lng = wrap(radLng * 180 / Math.PI, -180, 180);
  69621. }
  69622. var lat = lngLat.lat;
  69623. if (dy !== 0) {
  69624. var ndy = Math.abs(dy),
  69625. radLat = rad(lngLat.lat);
  69626. var sLat = Math.sin(ndy / (2 * this.R)) * 2;
  69627. radLat = radLat + sLat * (ndy > 0 ? 1 : -1);
  69628. lat = wrap(radLat * 180 / Math.PI, -90, 90);
  69629. }
  69630. return {
  69631. lng: lng,
  69632. lat: lat
  69633. };
  69634. },
  69635. getResolution: function getResolution(zoom) {
  69636. if (!this.resolutions) {
  69637. var resolutions = [];
  69638. var d = 2 * 6378137 * Math.PI;
  69639. for (var i = 0; i <= this.maxZoom; i++) {
  69640. resolutions[i] = d / (256 * Math.pow(2, i));
  69641. }
  69642. this.resolutions = resolutions;
  69643. }
  69644. var z = zoom | 0,
  69645. length = this.resolutions.length;
  69646. z = z < 0 ? 0 : z > length - 1 ? length - 1 : z;
  69647. var res = this.resolutions[z];
  69648. if ((zoom | 0) !== zoom && z !== length - 1) {
  69649. var next = this.resolutions[z + 1];
  69650. return res + (next - res) * (zoom - z);
  69651. }
  69652. return res;
  69653. }
  69654. };
  69655. var Transform = {
  69656. matrix: [1, -1, 0, 0],
  69657. projection: Projection,
  69658. project: function project(lngLat) {
  69659. return this.projection.project(lngLat);
  69660. },
  69661. unproject: function unproject(point) {
  69662. return this.projection.unproject(point);
  69663. },
  69664. lngLatToPoint: function lngLatToPoint(lngLat, zoom) {
  69665. var pt = this.project(lngLat);
  69666. return this.transform(pt, this.projection.getResolution(zoom));
  69667. },
  69668. locate: function locate(lngLat, dx, dy) {
  69669. return this.projection.locate(lngLat, dx, dy);
  69670. },
  69671. transform: function transform(point, scale) {
  69672. return {
  69673. x: this.matrix[0] * (point.x - this.matrix[2]) / scale,
  69674. y: this.matrix[1] * (point.y - this.matrix[3]) / scale
  69675. };
  69676. }
  69677. };
  69678. (external_mapboxgl_default()).supermap.Transform = Transform;
  69679. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/ThreeLayerRenderer.js
  69680. function ThreeLayerRenderer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69681. function ThreeLayerRenderer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69682. function ThreeLayerRenderer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayerRenderer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayerRenderer_defineProperties(Constructor, staticProps); return Constructor; }
  69683. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69684. * This program are made available under the terms of the Apache License, Version 2.0
  69685. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69686. /**
  69687. * reference and modification
  69688. * maptalks.three
  69689. * (https://github.com/maptalks/maptalks.three)
  69690. * Apache Licene 2.0
  69691. * thanks maptalks
  69692. */
  69693. var projection = Transform.projection;
  69694. var ThreeLayerRenderer_Color = external_function_try_return_THREE_catch_e_return_namespaceObject.Color,
  69695. Scene = external_function_try_return_THREE_catch_e_return_namespaceObject.Scene,
  69696. WebGLRenderer = external_function_try_return_THREE_catch_e_return_namespaceObject.WebGLRenderer,
  69697. CanvasRenderer = external_function_try_return_THREE_catch_e_return_namespaceObject.CanvasRenderer,
  69698. PerspectiveCamera = external_function_try_return_THREE_catch_e_return_namespaceObject.PerspectiveCamera;
  69699. var RADIAN = Math.PI / 180;
  69700. var ThreeLayerRenderer_frame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
  69701. var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame;
  69702. /**
  69703. * @private
  69704. * @class ThreeLayerRenderer
  69705. * @category Visualization Three
  69706. * @classdesc Three图层渲染器
  69707. * @param {mapboxgl.supermap.ThreeLayer} layer - ThreeJs图层。</br>
  69708. * @param {string} [renderer="gl"] - 图层渲染方式(canvas或WebGL)。取值:"gl","canvas"。</br>
  69709. * @param {Object} options - threejs渲染器初始化参数对象。参数内容详见:
  69710. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  69711. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  69712. *
  69713. * @extends {mapboxgl.Evented}
  69714. * @fires mapboxgl.supermap.ThreeLayer#initialized
  69715. * @fires mapboxgl.supermap.ThreeLayer#draw
  69716. * @fires mapboxgl.supermap.ThreeLayer#rendererinitialized
  69717. */
  69718. var ThreeLayerRenderer = /*#__PURE__*/function () {
  69719. function ThreeLayerRenderer(layer, renderer, options) {
  69720. ThreeLayerRenderer_classCallCheck(this, ThreeLayerRenderer);
  69721. this._layer = layer;
  69722. this.renderer = renderer || "gl";
  69723. this.options = options;
  69724. }
  69725. ThreeLayerRenderer_createClass(ThreeLayerRenderer, [{
  69726. key: "setMap",
  69727. value: function setMap(map) {
  69728. this.map = map;
  69729. } //开始渲染
  69730. }, {
  69731. key: "render",
  69732. value: function render() {
  69733. if (!this._layer) {
  69734. return;
  69735. }
  69736. this.prepare();
  69737. /**
  69738. * @event mapboxgl.supermap.ThreeLayer#initialized
  69739. * @description three 初始化之后后触发。
  69740. */
  69741. this._layer.fire("initialized");
  69742. this._layer && this._layer.draw(this.context, this.scene, this.camera);
  69743. /**
  69744. * @event mapboxgl.supermap.ThreeLayer#draw
  69745. * @description draw 绘制事件, 调用提供给外部绘制的接口后触发
  69746. */
  69747. this._layer.fire("draw");
  69748. this.renderScene();
  69749. }
  69750. }, {
  69751. key: "update",
  69752. value: function update() {
  69753. this.remove();
  69754. this.render();
  69755. } //渲染场景(模型已经添加到图层)
  69756. }, {
  69757. key: "renderScene",
  69758. value: function renderScene() {
  69759. this.locationCamera();
  69760. this.animationFrame = this.renderFrame(function () {
  69761. this.animationFrame = null;
  69762. this.context && this.context.render(this.scene, this.camera);
  69763. }.bind(this));
  69764. }
  69765. }, {
  69766. key: "renderFrame",
  69767. value: function renderFrame(fn) {
  69768. var render = function render() {
  69769. fn && typeof fn === "function" && fn();
  69770. };
  69771. return ThreeLayerRenderer_frame(render);
  69772. }
  69773. }, {
  69774. key: "resize",
  69775. value: function resize() {
  69776. this._resetElementSize(this.container);
  69777. this._resetElementSize(this.canvas);
  69778. var width = this.canvas.width,
  69779. height = this.canvas.height;
  69780. var size = this.getMapSize();
  69781. this.camera.aspect = width / height;
  69782. this.camera.updateProjectionMatrix();
  69783. this.context.setSize(size.width, size.height);
  69784. this.renderScene();
  69785. } //创建画布、初始化渲染器、初始化相机等
  69786. }, {
  69787. key: "prepare",
  69788. value: function prepare() {
  69789. if (!this.map) {
  69790. return new Error("map object is necessary");
  69791. }
  69792. if (!this.canvas) {
  69793. this._initContainer();
  69794. this._initThreeRenderer();
  69795. /**
  69796. * @event mapboxgl.supermap.ThreeLayer#rendererinitialized
  69797. * @description rendererinitialized 事件,初始化 three 渲染器后触发
  69798. */
  69799. this._layer.fire("rendererinitialized");
  69800. } else {
  69801. this.clear(this.context);
  69802. }
  69803. }
  69804. }, {
  69805. key: "getMapSize",
  69806. value: function getMapSize() {
  69807. var container = this.map.getContainer();
  69808. return {
  69809. width: container.clientWidth,
  69810. height: container.clientHeight
  69811. };
  69812. }
  69813. }, {
  69814. key: "cancelFrame",
  69815. value: function cancelFrame() {
  69816. if (this.animationFrame != null) {
  69817. cancel(this.animationFrame);
  69818. }
  69819. }
  69820. }, {
  69821. key: "remove",
  69822. value: function remove() {
  69823. if (this.animationFrame != null) {
  69824. cancel(this.animationFrame);
  69825. }
  69826. this.container.removeChild(this.canvas);
  69827. this.container.parentNode.removeChild(this.container);
  69828. this.context = null;
  69829. this.canvas = null;
  69830. this.container = null;
  69831. } //清理画布内容
  69832. }, {
  69833. key: "clear",
  69834. value: function clear(context) {
  69835. context && context.clear && context.clear();
  69836. context && context.clearRect && context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  69837. } //计算缩放比例
  69838. }, {
  69839. key: "getScale",
  69840. value: function getScale(zoom) {
  69841. var map = this.map;
  69842. var z = zoom == null ? map.getZoom() : zoom;
  69843. var max = projection.getResolution(projection.nativeMaxZoom),
  69844. res = projection.getResolution(z);
  69845. return res / max;
  69846. }
  69847. }, {
  69848. key: "getCanvasContainer",
  69849. value: function getCanvasContainer() {
  69850. return this.container;
  69851. }
  69852. }, {
  69853. key: "getCanvas",
  69854. value: function getCanvas() {
  69855. return this.canvas;
  69856. } //重新设置相机位置
  69857. }, {
  69858. key: "locationCamera",
  69859. value: function locationCamera() {
  69860. var map = this.map;
  69861. var size = this.getMapSize();
  69862. var scale = map.transform.zoomScale(projection.nativeMaxZoom - map.getZoom() - 1);
  69863. var fovRatio = Math.tan(map.transform.fov / 2 * RADIAN);
  69864. var camera = this.camera; //倾斜时,相机位置低于Z轴
  69865. var pitch = map.getPitch() * RADIAN;
  69866. var pZ = -scale * size.height / 2 / fovRatio;
  69867. camera.position.z = pZ * Math.cos(pitch);
  69868. var centerPoint = Transform.lngLatToPoint(map.getCenter(), projection.nativeMaxZoom);
  69869. var distance = Math.sin(pitch) * pZ;
  69870. var bearing = map.getBearing() * RADIAN;
  69871. camera.position.x = centerPoint.x + distance * Math.sin(bearing);
  69872. camera.position.y = centerPoint.y - distance * Math.cos(bearing);
  69873. camera.up.set(Math.sin(bearing), -Math.cos(bearing), 0);
  69874. camera.lookAt(new external_function_try_return_THREE_catch_e_return_namespaceObject.Vector3(centerPoint.x, centerPoint.y, 0));
  69875. camera.updateProjectionMatrix();
  69876. }
  69877. }, {
  69878. key: "_initContainer",
  69879. value: function _initContainer() {
  69880. var canvas = this._createCanvas();
  69881. var container = this.container = document.createElement("div");
  69882. if (this._layer._layerId) {
  69883. container.id = this._layer._layerId;
  69884. }
  69885. container.className = "threejs-wrapper";
  69886. container.style.position = "absolute";
  69887. container.style.left = "0px";
  69888. container.style.top = "0px";
  69889. container.style.overflow = "hidden";
  69890. this._resetElementSize(container);
  69891. container.appendChild(canvas);
  69892. var mapContainer = this.map.getCanvasContainer();
  69893. mapContainer.appendChild(container);
  69894. }
  69895. }, {
  69896. key: "_createCanvas",
  69897. value: function _createCanvas() {
  69898. if (this.canvas) {
  69899. return;
  69900. }
  69901. var canvas = this.canvas = document.createElement('canvas');
  69902. canvas.className = "threejs-overlay";
  69903. canvas.style.outline = "none";
  69904. this._resetElementSize(canvas);
  69905. return canvas;
  69906. }
  69907. }, {
  69908. key: "_resetElementSize",
  69909. value: function _resetElementSize(element) {
  69910. if (!element) {
  69911. return;
  69912. }
  69913. var size = this.getMapSize();
  69914. var dpr = window.devicePixelRatio ? window.devicePixelRatio : 1;
  69915. var width = dpr * size.width;
  69916. var height = dpr * size.height;
  69917. element.width = width;
  69918. element.height = height;
  69919. element.style.width = size.width + 'px';
  69920. element.style.height = size.height + 'px';
  69921. }
  69922. }, {
  69923. key: "_initThreeRenderer",
  69924. value: function _initThreeRenderer() {
  69925. var map = this.map;
  69926. var size = this.getMapSize();
  69927. var renderer = this.renderer || 'gl';
  69928. var context;
  69929. if (renderer === 'gl') {
  69930. context = new WebGLRenderer({
  69931. 'canvas': this.canvas,
  69932. 'alpha': true,
  69933. 'antialias': true,
  69934. 'preserveDrawingBuffer': true
  69935. }, this.options);
  69936. context.autoClear = true;
  69937. context.clear();
  69938. } else {
  69939. context = new CanvasRenderer(Util.extend({
  69940. 'canvas': this.canvas,
  69941. 'alpha': true
  69942. }, this.options));
  69943. }
  69944. context.setClearColor(new ThreeLayerRenderer_Color(1, 1, 1), 0);
  69945. context.canvas = this.canvas;
  69946. this.context = context;
  69947. var fov = map.transform.fov;
  69948. var fovRatio = Math.tan(fov / 2 * RADIAN);
  69949. var maxScale = this.getScale(projection.minZoom) / this.getScale(projection.nativeMaxZoom);
  69950. var far = maxScale * size.height / 2 / fovRatio;
  69951. this.camera = new PerspectiveCamera(fov, size.width / size.height, 1, far);
  69952. this.scene = new Scene();
  69953. this.scene.add(this.camera);
  69954. }
  69955. }]);
  69956. return ThreeLayerRenderer;
  69957. }();
  69958. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/threejs/index.js
  69959. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69960. * This program are made available under the terms of the Apache License, Version 2.0
  69961. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69962. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/ThreeLayer.js
  69963. function ThreeLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ThreeLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { ThreeLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ThreeLayer_typeof(obj); }
  69964. function ThreeLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  69965. function ThreeLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  69966. function ThreeLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) ThreeLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) ThreeLayer_defineProperties(Constructor, staticProps); return Constructor; }
  69967. function ThreeLayer_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 } }); if (superClass) ThreeLayer_setPrototypeOf(subClass, superClass); }
  69968. function ThreeLayer_setPrototypeOf(o, p) { ThreeLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ThreeLayer_setPrototypeOf(o, p); }
  69969. function ThreeLayer_createSuper(Derived) { var hasNativeReflectConstruct = ThreeLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = ThreeLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = ThreeLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return ThreeLayer_possibleConstructorReturn(this, result); }; }
  69970. function ThreeLayer_possibleConstructorReturn(self, call) { if (call && (ThreeLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return ThreeLayer_assertThisInitialized(self); }
  69971. function ThreeLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  69972. function ThreeLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  69973. function ThreeLayer_getPrototypeOf(o) { ThreeLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ThreeLayer_getPrototypeOf(o); }
  69974. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  69975. * This program are made available under the terms of the Apache License, Version 2.0
  69976. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  69977. /**
  69978. * reference and modification
  69979. * maptalks.three
  69980. * (https://github.com/maptalks/maptalks.three)
  69981. * Apache Licene 2.0
  69982. * thanks maptalks
  69983. */
  69984. var Vector3 = external_function_try_return_THREE_catch_e_return_namespaceObject.Vector3,
  69985. ThreeLayer_Shape = external_function_try_return_THREE_catch_e_return_namespaceObject.Shape,
  69986. Mesh = external_function_try_return_THREE_catch_e_return_namespaceObject.Mesh,
  69987. BufferGeometry = external_function_try_return_THREE_catch_e_return_namespaceObject.BufferGeometry,
  69988. ExtrudeGeometry = external_function_try_return_THREE_catch_e_return_namespaceObject.ExtrudeGeometry;
  69989. /**
  69990. * @class mapboxgl.supermap.ThreeLayer
  69991. * @category Visualization Three
  69992. * @classdesc Three 图层。
  69993. * @param {string} id - 图层 ID。
  69994. * @param {string} [renderer="gl"] - 图层渲染方式( canvas 或 WebGL )。取值:"gl","canvas"。
  69995. * @param {Object} options - 初始化参数。
  69996. * @param {Object} options.threeOptions - threejs 渲染器初始化参数对象。参数内容详见:
  69997. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}
  69998. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  69999. *
  70000. * @extends {mapboxgl.Evented}
  70001. * @fires mapboxgl.supermap.ThreeLayer#render
  70002. * @fires mapboxgl.supermap.ThreeLayer#renderscene
  70003. * @example
  70004. * var threeLayer = new mapboxgl.supermap.ThreeLayer('three');
  70005. * //模型绘制
  70006. * threeLayer.on("initialized", draw);
  70007. * threeLayer.addTo(map);
  70008. *
  70009. * function draw() {
  70010. * var scene=threeLayer.getScene();
  70011. * camera=threeLayer.getCamera();
  70012. * var light = new THREE.PointLight(0xffffff);
  70013. * camera.add(light);
  70014. * var material = new THREE.MeshPhongMaterial({color: 0xff0000});
  70015. * //根据坐标点转换成模型
  70016. * var mesh = this.toThreeMesh(feature.geometry.coordinates, 10, material, true);
  70017. * //模型添加到3D场景
  70018. * scene.add(mesh);
  70019. * }
  70020. *
  70021. * 叠加模型可以通过两种方式:</br>
  70022. * 1.调用 threeLayer.toThreeMesh 直接将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑),然后添加到 3D 场景
  70023. * 2.使用 ThreeJS 的接口创建好 Mesh,然后调用 threeLayer.setPosition 设置地理位置,然后添加到 3D 场景
  70024. *
  70025. */
  70026. var ThreeLayer = /*#__PURE__*/function (_mapboxgl$Evented) {
  70027. ThreeLayer_inherits(ThreeLayer, _mapboxgl$Evented);
  70028. var _super = ThreeLayer_createSuper(ThreeLayer);
  70029. //options.threeOptions是初始化threejs renderer的参数对象
  70030. function ThreeLayer(id, renderer, options) {
  70031. var _this;
  70032. ThreeLayer_classCallCheck(this, ThreeLayer);
  70033. _this = _super.call(this);
  70034. _this._layerId = id;
  70035. _this.options = options;
  70036. var threeOptions = options && options.threeOptions;
  70037. _this.renderer = new ThreeLayerRenderer(ThreeLayer_assertThisInitialized(_this), renderer, threeOptions);
  70038. return _this;
  70039. }
  70040. /**
  70041. * @function mapboxgl.supermap.ThreeLayer.prototype.toThreeShape
  70042. * @description 创建 threejs shape 对象。
  70043. * @param {Array} coordinates - 坐标点数组。
  70044. * @returns THREE.Shape{@link https://threejs.org/docs/index.html#api/extras/core/Shape} threejs shape 对象。
  70045. */
  70046. ThreeLayer_createClass(ThreeLayer, [{
  70047. key: "toThreeShape",
  70048. value: function toThreeShape(coordinates) {
  70049. var _this2 = this;
  70050. if (!coordinates) {
  70051. return null;
  70052. }
  70053. var center = this.getCoordinatesCenter(coordinates);
  70054. var centerPoint = this.lngLatToPosition(center);
  70055. var outer = coordinates.map(function (coords) {
  70056. return _this2.lngLatToPosition({
  70057. lng: coords[0],
  70058. lat: coords[1]
  70059. }).sub(centerPoint);
  70060. });
  70061. return new ThreeLayer_Shape(outer);
  70062. }
  70063. /**
  70064. * @function mapboxgl.supermap.ThreeLayer.prototype.toThreeMesh
  70065. * @description 创建 threejs Mesh 对象。将地理坐标转换成 threejs 3D 模型(适用于挤压模型,如城市建筑)。
  70066. * @param {Array.<Object>} coordinates - 坐标点数组。
  70067. * @param {number} amount - 高度。
  70068. * @param {THREE.Material} material - Threejs 材质对象。参考:[THREE.Material]{@link https://threejs.org/docs/index.html#api/extras/core/Material}
  70069. * @param {boolean} [removeDuplicated] - 是否移除重复的坐标点。
  70070. * @returns {THREE.Mesh} threejs Mesh 对象。参考:[THREE.Mesh]{@link https://threejs.org/docs/index.html#api/objects/Mesh}
  70071. */
  70072. }, {
  70073. key: "toThreeMesh",
  70074. value: function toThreeMesh(coordinates, amount, material, removeDuplicated) {
  70075. if (!coordinates) {
  70076. return null;
  70077. }
  70078. var coords = coordinates;
  70079. if (removeDuplicated) {
  70080. coords = this.removeDuplicatedCoordinates(coordinates);
  70081. }
  70082. var targetAmount = this.distanceToThreeVector3(amount, amount).x;
  70083. var shape = this.toThreeShape(coords);
  70084. var geometry = new ExtrudeGeometry(shape, {
  70085. 'amount': targetAmount,
  70086. 'bevelEnabled': true
  70087. });
  70088. var bufferGeometry = new BufferGeometry().fromGeometry(geometry);
  70089. var mesh = new Mesh(bufferGeometry, material);
  70090. var center = this.lngLatToPosition(this.getCoordinatesCenter(coords));
  70091. mesh.position.set(center.x, center.y, -targetAmount);
  70092. return mesh;
  70093. }
  70094. /**
  70095. * @function mapboxgl.supermap.ThreeLayer.prototype.addObject
  70096. * @description 设置threejs 3D 对象的坐标(经纬度)。
  70097. * @param {THREE.Object3D} object3D - threejs 3D 对象。参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象。
  70098. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  70099. * @returns {this} this
  70100. */
  70101. }, {
  70102. key: "addObject",
  70103. value: function addObject(object3D, coordinate) {
  70104. if (coordinate && object3D) {
  70105. this.setPosition(object3D, coordinate);
  70106. }
  70107. this.renderer && this.renderer.scene.add(object3D);
  70108. }
  70109. /**
  70110. * @function mapboxgl.supermap.ThreeLayer.prototype.getScene
  70111. * @description 获取threejs 场景对象
  70112. * @returns {THREE.Scene} threejs 场景对象,参考:[THREE.Scene]{@link https://threejs.org/docs/index.html#api/scenes/Scene}
  70113. */
  70114. }, {
  70115. key: "getScene",
  70116. value: function getScene() {
  70117. return this.renderer.scene;
  70118. }
  70119. /**
  70120. * @function mapboxgl.supermap.ThreeLayer.prototype.getCamera
  70121. * @description 获取threejs 相机。
  70122. * @returns {THREE.Camera} threejs 相机。参考:[THREE.Camera]{@link https://threejs.org/docs/index.html#api/cameras/Camera}
  70123. */
  70124. }, {
  70125. key: "getCamera",
  70126. value: function getCamera() {
  70127. return this.renderer.camera;
  70128. }
  70129. /**
  70130. * @function mapboxgl.supermap.ThreeLayer.prototype.getThreeRenderer
  70131. * @description 获取 threejs renderer。
  70132. * @returns {THREE.WebGLRenderer|THREE.CanvasRenderer} threejs renderer。参考:
  70133. * [THREE.WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  70134. * [THREE.CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  70135. */
  70136. }, {
  70137. key: "getThreeRenderer",
  70138. value: function getThreeRenderer() {
  70139. return this.renderer.context;
  70140. } // /**
  70141. // * @function mapboxgl.supermap.ThreeLayer.prototype.getObject
  70142. // * @description 根据条件获取添加到场景中的对象
  70143. // * @return {THREE.Object3D} threejs 3D对象。参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象
  70144. // */
  70145. // getObject(conditions) {
  70146. // if(!conditions){
  70147. // return;
  70148. // }
  70149. // var scene = this.getScene();
  70150. // var objects = scene.children;
  70151. // for(let obj of objects ){
  70152. // for(let condition of conditions ){
  70153. // obj[condition]
  70154. // }
  70155. // }
  70156. // }
  70157. /**
  70158. * @function mapboxgl.supermap.ThreeLayer.prototype.clearMesh
  70159. * @description 清除所有 threejs mesh 对象。
  70160. * @returns {this} this 对象。
  70161. */
  70162. }, {
  70163. key: "clearMesh",
  70164. value: function clearMesh() {
  70165. var scene = this.renderer.scene;
  70166. if (!scene) {
  70167. return this;
  70168. }
  70169. for (var i = scene.children.length - 1; i >= 0; i--) {
  70170. if (scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_namespaceObject.Mesh) {
  70171. scene.remove(scene.children[i]);
  70172. }
  70173. }
  70174. return this;
  70175. }
  70176. /**
  70177. * @function mapboxgl.supermap.ThreeLayer.prototype.clearAll
  70178. * @description 清除所有 threejs 对象。
  70179. * @param {boolean} clearCamera - 是否同时清除相机。
  70180. * @returns {this} this 对象。
  70181. */
  70182. }, {
  70183. key: "clearAll",
  70184. value: function clearAll(clearCamera) {
  70185. var scene = this.renderer.scene;
  70186. if (!scene) {
  70187. return this;
  70188. }
  70189. for (var i = scene.children.length - 1; i >= 0; i--) {
  70190. if (!clearCamera && scene.children[i] instanceof external_function_try_return_THREE_catch_e_return_namespaceObject.Camera) {
  70191. continue;
  70192. }
  70193. scene.remove(scene.children[i]);
  70194. }
  70195. return this;
  70196. }
  70197. /**
  70198. * @function mapboxgl.supermap.ThreeLayer.prototype.setPosition
  70199. * @description 设置 threejs 3D 对象的坐标(经纬度)。
  70200. * @param {THREE.Object3D} object3D - threejs 3D 对象,参考:[THREE.Object3D]{@link https://threejs.org/docs/index.html#api/core/Object3D}及子类对象。
  70201. * @param {(Array.<number>|Object)} coordinate - 添加的 three 对象坐标(经纬度)。
  70202. * @returns {this} this 对象。
  70203. */
  70204. }, {
  70205. key: "setPosition",
  70206. value: function setPosition(object3D, coordinate) {
  70207. if (!object3D || !coordinate) {
  70208. return this;
  70209. }
  70210. var pos = this.lngLatToPosition(coordinate);
  70211. object3D.position.set(pos.x, pos.y, pos.z);
  70212. return this;
  70213. }
  70214. /**
  70215. * @function mapboxgl.supermap.ThreeLayer.prototype.lngLatToPosition
  70216. * @description 经纬度转threejs 3D 失量对象。
  70217. * @param {(Array.<number>|Object)} lngLat - 经纬度坐标。
  70218. * @returns {THREE.Vector3} threejs 3D 失量对象。参考:[THREE.Vector3]{@link https://threejs.org/docs/index.html#api/math/Vector3}
  70219. */
  70220. }, {
  70221. key: "lngLatToPosition",
  70222. value: function lngLatToPosition(lngLat) {
  70223. var zoom = Transform.projection.nativeMaxZoom;
  70224. var point = Transform.lngLatToPoint(lngLat, zoom);
  70225. return new Vector3(point.x, point.y, -0);
  70226. }
  70227. /**
  70228. * @function mapboxgl.supermap.ThreeLayer.prototype.distanceToThreeVector3
  70229. * @description 计算距离指定坐标给定距离的新坐标的 threejs 3D 失量对象。
  70230. * @param {number} x - x 轴距离,单位米。
  70231. * @param {number} y - y 轴距离,单位米。
  70232. * @param {(Array.<number>|Object)} lngLat - 源坐标。
  70233. * @returns {THREE.Vector3} 目标点的 threejs 3D 失量对象。参考:[THREE.Vector3]{@link https://threejs.org/docs/index.html#api/math/Vector3}
  70234. */
  70235. }, {
  70236. key: "distanceToThreeVector3",
  70237. value: function distanceToThreeVector3(x, y, lngLat) {
  70238. var map = this._map;
  70239. var center = lngLat || map.getCenter(),
  70240. maxZoom = Transform.projection.nativeMaxZoom,
  70241. targetLngLat = Transform.locate(center, x, y);
  70242. var point1 = Transform.lngLatToPoint(center, maxZoom),
  70243. point2 = Transform.lngLatToPoint(targetLngLat, maxZoom);
  70244. var targetX = Math.abs(point2.x - point1.x) * Math.sign(x);
  70245. var targetY = Math.abs(point2.y - point1.y) * Math.sign(y);
  70246. return new Vector3(targetX, targetY, 0);
  70247. }
  70248. /**
  70249. * @function mapboxgl.supermap.ThreeLayer.prototype.removeDuplicatedCoordinates
  70250. * @description 移除数组中的重复坐标。
  70251. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  70252. * @returns {(Array.<Array.<number>>)} 新的坐标数组。
  70253. */
  70254. }, {
  70255. key: "removeDuplicatedCoordinates",
  70256. value: function removeDuplicatedCoordinates(coordinates) {
  70257. function equals(point1, point2) {
  70258. return point1[0] === point2[0] && point1[1] === point2[1];
  70259. }
  70260. var coords = [].concat(coordinates);
  70261. var length = coords.length;
  70262. for (var i = length - 1; i >= 1; i--) {
  70263. if (equals(coords[i], coords[i - 1])) {
  70264. coords.splice(i, 1);
  70265. }
  70266. }
  70267. var isClose = equals(coords[0], coords[coords.length - 1]);
  70268. isClose && coords.splice(coords.length - 1, 1);
  70269. return coords;
  70270. }
  70271. /**
  70272. * @function mapboxgl.supermap.ThreeLayer.prototype.getCoordinatesCenter
  70273. * @description 获取给定坐标数组的中心坐标。
  70274. * @param {(Array.<Array.<number>>)} coordinates - 坐标数组。
  70275. * @returns {Object} 包含经纬度的坐标对象。
  70276. */
  70277. }, {
  70278. key: "getCoordinatesCenter",
  70279. value: function getCoordinatesCenter(coordinates) {
  70280. var sumX = 0,
  70281. sumY = 0,
  70282. count = 0;
  70283. var i = 0,
  70284. len = coordinates.length;
  70285. for (; i < len; i++) {
  70286. if (coordinates[i]) {
  70287. sumX += coordinates[i][0];
  70288. sumY += coordinates[i][1];
  70289. count++;
  70290. }
  70291. }
  70292. return {
  70293. lng: sumX / count,
  70294. lat: sumY / count
  70295. };
  70296. }
  70297. /**
  70298. * @function mapboxgl.supermap.ThreeLayer.prototype.addTo
  70299. * @description 添加图层到地图。
  70300. * @param {Object} map - 地图对象。
  70301. * @returns {this} this 对象。
  70302. */
  70303. }, {
  70304. key: "addTo",
  70305. value: function addTo(map) {
  70306. var me = this;
  70307. me._map = map;
  70308. me.renderer.setMap(map);
  70309. me.renderer.render(); //three mbgl 联动(仅联动相机,不执行重绘操作)
  70310. me._map.on('render', this._update.bind(me));
  70311. me._map.on('resize', this._resize.bind(me));
  70312. me.on('render', function () {
  70313. this.context && this.context.render(this.scene, this.camera);
  70314. }.bind(me.renderer));
  70315. return this;
  70316. }
  70317. /**
  70318. * @function mapboxgl.supermap.ThreeLayer.prototype.getCanvasContainer
  70319. * @description 获取 three 图层容器。
  70320. * @returns {HTMLElement} three 图层的容器。
  70321. */
  70322. }, {
  70323. key: "getCanvasContainer",
  70324. value: function getCanvasContainer() {
  70325. return this.renderer.getCanvasContainer();
  70326. }
  70327. /**
  70328. * @function mapboxgl.supermap.ThreeLayer.prototype.getCanvas
  70329. * @description 获取 three 图层画布。
  70330. * @returns {HTMLCanvasElement} three 图层画布。
  70331. */
  70332. }, {
  70333. key: "getCanvas",
  70334. value: function getCanvas() {
  70335. return this.renderer.getCanvas();
  70336. }
  70337. /**
  70338. * @function mapboxgl.supermap.ThreeLayer.prototype.remove
  70339. * @description 移除图层。
  70340. */
  70341. }, {
  70342. key: "remove",
  70343. value: function remove() {
  70344. var map = this._map,
  70345. me = this;
  70346. map.off('render', me._update.bind(me));
  70347. map.off('resize', me._resize.bind(me));
  70348. me.renderer.remove();
  70349. me._map = null;
  70350. }
  70351. /**
  70352. * @function mapboxgl.supermap.ThreeLayer.prototype.draw
  70353. * @description 提供给外部的 threejs 模型绘制接口。
  70354. * @param {THREE.WebGLRenderer|THREE.CanvasRenderer} gl - threejs 渲染器上下文 。详情请参考:</br>
  70355. * [WebGLRenderer]{@link https://threejs.org/docs/index.html#api/renderers/WebGLRenderer}/
  70356. * [CanvasRenderer]{@link https://threejs.org/docs/index.html#examples/renderers/CanvasRenderer}
  70357. * @param {THREE.Scene} scene - threejs 场景对象。详情请参考:[THREE.Scene]{@link https://threejs.org/docs/index.html#api/scenes/Scene}
  70358. * @param {THREE.Camera} camera - threejs 相机对象。详情请参考:[THREE.Camera]{@link https://threejs.org/docs/index.html#api/cameras/Camera}
  70359. * @returns {this} this对象。
  70360. * @example
  70361. * var threeLayer = new mapboxgl.supermap.ThreeLayer('three');
  70362. * //可以通过重写 draw 实现模型绘制
  70363. * threeLayer.draw = function (gl, scene, camera) {
  70364. * //TODO 绘制操作
  70365. * }
  70366. * threeLayer.addTo(map);
  70367. */
  70368. }, {
  70369. key: "draw",
  70370. value: function draw(gl, scene, camera) {
  70371. // eslint-disable-line no-unused-vars
  70372. return this;
  70373. }
  70374. /**
  70375. * @function mapboxgl.supermap.ThreeLayer.prototype.renderScene
  70376. * @description 渲染场景。
  70377. * @returns {this} this
  70378. */
  70379. }, {
  70380. key: "renderScene",
  70381. value: function renderScene() {
  70382. this.renderer.renderScene();
  70383. /**
  70384. * @event mapboxgl.supermap.ThreeLayer#renderscene
  70385. * @description renderScene 事件,场景渲染后触发。
  70386. */
  70387. this.fire("renderscene");
  70388. return this;
  70389. }
  70390. }, {
  70391. key: "_resize",
  70392. value: function _resize() {
  70393. this.renderer.resize();
  70394. }
  70395. }, {
  70396. key: "_update",
  70397. value: function _update() {
  70398. /**
  70399. * @event mapboxgl.supermap.ThreeLayer#render
  70400. * @description render 事件,地图渲染时(地图状态改变时)触发。
  70401. */
  70402. this.renderScene();
  70403. this.fire('render');
  70404. return this;
  70405. }
  70406. }]);
  70407. return ThreeLayer;
  70408. }((external_mapboxgl_default()).Evented);
  70409. (external_mapboxgl_default()).supermap.ThreeLayer = ThreeLayer;
  70410. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/HeatMapLayer.js
  70411. function HeatMapLayer_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { HeatMapLayer_typeof = function _typeof(obj) { return typeof obj; }; } else { HeatMapLayer_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return HeatMapLayer_typeof(obj); }
  70412. function HeatMapLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  70413. function HeatMapLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  70414. function HeatMapLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) HeatMapLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) HeatMapLayer_defineProperties(Constructor, staticProps); return Constructor; }
  70415. function HeatMapLayer_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 } }); if (superClass) HeatMapLayer_setPrototypeOf(subClass, superClass); }
  70416. function HeatMapLayer_setPrototypeOf(o, p) { HeatMapLayer_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return HeatMapLayer_setPrototypeOf(o, p); }
  70417. function HeatMapLayer_createSuper(Derived) { var hasNativeReflectConstruct = HeatMapLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = HeatMapLayer_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = HeatMapLayer_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return HeatMapLayer_possibleConstructorReturn(this, result); }; }
  70418. function HeatMapLayer_possibleConstructorReturn(self, call) { if (call && (HeatMapLayer_typeof(call) === "object" || typeof call === "function")) { return call; } return HeatMapLayer_assertThisInitialized(self); }
  70419. function HeatMapLayer_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  70420. function HeatMapLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  70421. function HeatMapLayer_getPrototypeOf(o) { HeatMapLayer_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return HeatMapLayer_getPrototypeOf(o); }
  70422. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  70423. * This program are made available under the terms of the Apache License, Version 2.0
  70424. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  70425. /**
  70426. * @class mapboxgl.supermap.HeatMapLayer
  70427. * @classdesc 热力图层类。
  70428. * @category Visualization HeatMap
  70429. * @param {string} name - 图层名称。
  70430. * @param {Object} options - 构造参数。
  70431. * @param {mapboxgl.Map} options.map - mapboxgl map 对象。
  70432. * @param {string} options.featureWeight - 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  70433. * @param {string} [options.id] - 专题图层ID。默认使用 CommonUtil.createUniqueID("HeatMapLayer_") 创建专题图层 ID。
  70434. * @param {number} [options.radius=50] - 热点渲染的最大半径(热点像素半径),单位为 px,当 useGeoUnit参数 为 true 时,单位使用当前图层地理坐标单位。热点显示的时候以精确点为中心点开始往四周辐射衰减,其衰减半径和权重值成比列。
  70435. * @param {boolean} [options.loadWhileAnimating=true] - 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  70436. * @param {number} [options.opacity=1] - 图层透明度。
  70437. * @param {Array.<string>} [options.colors=['blue','cyan','lime','yellow','red']] - 颜色线性渐变数组,颜色值必须为canvas所支。
  70438. * @param {boolean} [options.useGeoUnit=false] - 使用地理单位,即默认热点半径默认使用像素单位。 当设置为 true 时,热点半径和图层地理坐标保持一致。
  70439. * @extends {mapboxgl.Evented}
  70440. * @fires mapboxgl.supermap.HeatMapLayer#featuresadded
  70441. * @fires mapboxgl.supermap.HeatMapLayer#changelayer
  70442. * @fires mapboxgl.supermap.HeatMapLayer#featuresremoved
  70443. *
  70444. */
  70445. var HeatMapLayer = /*#__PURE__*/function (_mapboxgl$Evented) {
  70446. HeatMapLayer_inherits(HeatMapLayer, _mapboxgl$Evented);
  70447. var _super = HeatMapLayer_createSuper(HeatMapLayer);
  70448. function HeatMapLayer(name, options) {
  70449. var _this;
  70450. HeatMapLayer_classCallCheck(this, HeatMapLayer);
  70451. _this = _super.call(this);
  70452. var _options = options ? options : {};
  70453. /**
  70454. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.name
  70455. * @description 图层名字。
  70456. */
  70457. _this.name = name;
  70458. /**
  70459. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.id
  70460. * @description 热力图图层 id。
  70461. */
  70462. _this.id = _options.id ? _options.id : Util.createUniqueID("HeatMapLayer_");
  70463. /**
  70464. * @member {mapboxgl.Map} mapboxgl.supermap.HeatMapLayer.prototype.map
  70465. * @description 热力图图层 map。
  70466. */
  70467. _this.map = _options.map ? _options.map : null;
  70468. /**
  70469. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.loadWhileAnimating=true]
  70470. * @description 是否实时重绘。(当绘制大数据量要素的情况下会出现卡顿,建议把该参数设为false)。
  70471. */
  70472. _this.loadWhileAnimating = _options.loadWhileAnimating === undefined ? true : _options.loadWhileAnimating;
  70473. /**
  70474. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.visibility=true]
  70475. * @description 图层显示状态属性。
  70476. */
  70477. _this.visibility = true;
  70478. /**
  70479. * @member {number} [mapboxgl.supermap.HeatMapLayer.prototype.opacity=1]
  70480. * @description 图层透明度,取值范围[0,1]。
  70481. */
  70482. _this.opacity = _options.opacity ? _options.opacity : 1;
  70483. /**
  70484. * @member {Array.<string>} [mapboxgl.supermap.HeatMapLayer.prototype.colors=['blue','cyan','lime','yellow','red']]
  70485. * @description 颜色线性渐变数组,颜色值必须为 canvas 所支。
  70486. */
  70487. _this.colors = _options.colors ? _options.colors : ['blue', 'cyan', 'lime', 'yellow', 'red'];
  70488. /**
  70489. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.useGeoUnit=false]
  70490. * @description 使用地理单位,即默认热点半径默认使用像素单位。 当设置为 true 时,热点半径和图层地理坐标保持一致。
  70491. */
  70492. _this.useGeoUnit = _options.useGeoUnit ? _options.useGeoUnit : false;
  70493. /**
  70494. * @member {number} [mapboxgl.supermap.HeatMapLayer.prototype.radius=50]
  70495. * @description 热点渲染的最大半径(热点像素半径),
  70496. * 热点显示的时候以精确点为中心点开始往四周辐射衰减,
  70497. * 其衰减半径和权重值成比列。
  70498. */
  70499. _this.radius = _options.radius ? _options.radius : 50;
  70500. /**
  70501. * @member {string} mapboxgl.supermap.HeatMapLayer.prototype.featureWeight
  70502. * @description 对应 feature 属性中的热点权重字段名称,权重值类型为 float。
  70503. * @example
  70504. * //feature.attributes中表示权重的字段为 height,则在 HeatMapLayer 的 featureWeight 参数赋值为 "height"。
  70505. * feature1.attributes.height = 7.0;
  70506. * feature2.attributes.height = 6.0;
  70507. * var heatMapLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  70508. * heatMapLayer.addFeatures([feature1,feature2]);
  70509. */
  70510. _this.featureWeight = _options.featureWeight ? _options.featureWeight : null;
  70511. /**
  70512. * @member {Array.<SuperMap.Feature.Vector>} mapboxgl.supermap.HeatMapLayer.prototype.features
  70513. * @description 热点信息数组,记录存储图层上添加的所有热点信息。
  70514. */
  70515. _this.features = [];
  70516. /**
  70517. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxWeight
  70518. * @description 设置权重最大值。如果不设置此属性,将按照当前屏幕范围内热点所拥有的权重最大值绘制热点图。
  70519. */
  70520. _this.maxWeight = null;
  70521. /**
  70522. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.minWeight
  70523. * @description 设置权重最小值。如果不设置此属性,将按照当前屏幕范围内热点所拥有的权重最小值绘制热点图。
  70524. */
  70525. _this.minWeight = null;
  70526. /**
  70527. * @member mapboxgl.supermap.HeatMapLayer.prototype.EVENT_TYPES
  70528. * @description 监听一个自定义事件可用如下方式:
  70529. * 热点图自定义事件信息,事件调用时的属性与具体事件类型相对应。
  70530. *
  70531. * All event objects have at least the following properties:
  70532. * {Object} object - A reference to layer.events.object.
  70533. * {DOMElement} element - A reference to layer.events.element.
  70534. *
  70535. * 支持的事件如下 (另外包含 <SuperMap.Layer 中定义的其他事件>):
  70536. * featuresadded - 热点添加完成时触发。传递参数为添加的热点信息数组和操作成功与否信息。
  70537. * 参数类型:{features: features, succeed: succeed}
  70538. * featuresremoved - 热点被删除时触发。传递参数为删除的热点信息数组和操作成功与否信息。
  70539. * 参数类型:{features: features, succeed: succeed}
  70540. * featuresdrawcompleted - 热点图渲染完成时触发,没有额外属性。
  70541. */
  70542. _this.EVENT_TYPES = ["featuresadded", "featuresremoved", "featuresdrawcompleted"];
  70543. /**
  70544. * @member {boolean} [mapboxgl.supermap.HeatMapLayer.prototype.supported=false]
  70545. * @description 当前浏览器是否支持 canvas 绘制,
  70546. * 决定了热点图是否可用,内部判断使用。
  70547. */
  70548. _this.supported = false;
  70549. /**
  70550. * @member {Object} mapboxgl.supermap.HeatMapLayer.prototype.rootCanvas
  70551. * @description 热点图主绘制面板。
  70552. */
  70553. _this.rootCanvas = null;
  70554. /**
  70555. * @member {Object} mapboxgl.supermap.HeatMapLayer.prototype.canvasContext
  70556. * @description 热点图主绘制对象。
  70557. */
  70558. _this.canvasContext = null;
  70559. /**
  70560. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxWidth
  70561. * @description 当前绘制面板宽度。和当前 map 窗口宽度一致。
  70562. */
  70563. _this.maxWidth = null;
  70564. /**
  70565. * @member {number} mapboxgl.supermap.HeatMapLayer.prototype.maxHeight
  70566. * @description 当前绘制面板宽度。和当前 map 窗口高度一致。
  70567. */
  70568. _this.maxHeight = null;
  70569. return _this;
  70570. }
  70571. /**
  70572. * @function mapboxgl.supermap.HeatMapLayer.prototype.onAdd
  70573. * @description 向底图添加该图层
  70574. */
  70575. HeatMapLayer_createClass(HeatMapLayer, [{
  70576. key: "onAdd",
  70577. value: function onAdd(map) {
  70578. this.map = map;
  70579. if (this.features.length === 0) {
  70580. return;
  70581. } //创建热力图绘制容器
  70582. this._createCanvasContainer(); //绑定图层事件与Map同步
  70583. this.map.on('resize', this._resizeEvent.bind(this));
  70584. this.map.on('zoomstart', this._zoomStartEvent.bind(this));
  70585. this.map.on('zoomend', this._zoomEndEvent.bind(this));
  70586. this.map.on('rotatestart', this._rotateStartEvent.bind(this));
  70587. this.map.on('rotate', this._rotateEvent.bind(this));
  70588. this.map.on('rotateend', this._rotateEndEvent.bind(this));
  70589. this.map.on('dragend', this._dragEndEvent.bind(this));
  70590. this.map.on('movestart', this._moveStartEvent.bind(this));
  70591. this.map.on('move', this._moveEvent.bind(this));
  70592. this.map.on('moveend', this._moveEndEvent.bind(this));
  70593. this.map.on('remove', this.removeFromMap.bind(this));
  70594. this.refresh();
  70595. }
  70596. /**
  70597. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeFromMap
  70598. * @description 从底图删除该图层。
  70599. */
  70600. }, {
  70601. key: "removeFromMap",
  70602. value: function removeFromMap() {
  70603. this.removeAllFeatures();
  70604. this.map.getCanvasContainer().removeChild(this.rootCanvas);
  70605. }
  70606. /**
  70607. * @function mapboxgl.supermap.HeatMapLayer.prototype._createCanvasContainer
  70608. * @description 创建热力图绘制容器。
  70609. * @private
  70610. */
  70611. }, {
  70612. key: "_createCanvasContainer",
  70613. value: function _createCanvasContainer() {
  70614. this.supported = true; //构建绘图面板
  70615. this.mapContainer = this.map.getCanvasContainer(); //热点图要求使用canvas绘制,判断是否支持
  70616. this.rootCanvas = document.createElement("canvas");
  70617. this.rootCanvas.id = this.id;
  70618. var mapCanvas = this.map.getCanvas();
  70619. this.rootCanvas.width = this.maxWidth = parseInt(mapCanvas.width);
  70620. this.rootCanvas.height = this.maxHeight = parseInt(mapCanvas.height);
  70621. Util.modifyDOMElement(this.rootCanvas, null, null, null, "absolute", null, null, this.opacity);
  70622. this.canvasContext = this.rootCanvas.getContext('2d');
  70623. this.mapContainer.appendChild(this.rootCanvas);
  70624. }
  70625. /**
  70626. * @function mapboxgl.supermap.HeatMapLayer.prototype.addFeatures
  70627. * @description 添加热点信息。
  70628. * @param {GeoJSONObject} features - 待添加的要素数组。
  70629. *
  70630. * @example
  70631. * var geojson = {
  70632. * "type": "FeatureCollection",
  70633. * "features": [
  70634. * {
  70635. * "type": "feature",
  70636. * "geometry": {
  70637. * "type": "Point", //只支持point类型
  70638. * "coordinates": [0, 0]
  70639. * },
  70640. * "properties": {
  70641. * "height": Math.random()*9,
  70642. * "geoRadius": useGeoRadius?radius:null
  70643. * }
  70644. * }
  70645. * ]
  70646. * };
  70647. * var heatMapLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"}); pLayer = new mapboxgl.supermap.HeatMapLayer("heatmaplayer",{"featureWeight":"height"});
  70648. * heatMapLayer.addFeatures(geojson);
  70649. * map.addLayer(heatMapLayer);
  70650. */
  70651. }, {
  70652. key: "addFeatures",
  70653. value: function addFeatures(features) {
  70654. this.features = this.toiClientFeature(features);
  70655. /**
  70656. * @event mapboxgl.supermap.HeatMapLayer#featuresadded
  70657. * @description 要素添加完成之后触发。
  70658. * @property {GeoJSONObject} features - 被添加的要素。
  70659. * @property {boolean} succeed - 要素是否成功添加。
  70660. */
  70661. this.fire(this.EVENT_TYPES[0], {
  70662. features: features,
  70663. succeed: true
  70664. }); //支持更新features,刷新底图
  70665. this.refresh();
  70666. }
  70667. /**
  70668. * @function mapboxgl.supermap.HeatMapLayer.prototype.refresh
  70669. * @description 强制刷新当前热点显示,在图层热点数组发生变化后调用,更新显示。
  70670. */
  70671. }, {
  70672. key: "refresh",
  70673. value: function refresh() {
  70674. if (this.features.length === 0) {
  70675. return;
  70676. }
  70677. if (this.map) {
  70678. var extent = this.map.getBounds();
  70679. this.updateHeatPoints(extent);
  70680. }
  70681. }
  70682. /**
  70683. * @function mapboxgl.supermap.HeatMapLayer.prototype.setOpacity
  70684. * @description 设置图层的不透明度,取值[0-1]之间。
  70685. * @param {number} [opacity] - 透明度。
  70686. */
  70687. }, {
  70688. key: "setOpacity",
  70689. value: function setOpacity(opacity) {
  70690. if (opacity !== this.opacity) {
  70691. this.opacity = opacity;
  70692. Util.modifyDOMElement(this.rootCanvas, null, null, null, null, null, null, opacity);
  70693. if (this.map !== null) {
  70694. /**
  70695. * @event mapboxgl.supermap.HeatMapLayer#changelayer
  70696. * @description 图层属性改变之后触发。
  70697. * @property {Object} layer - 图层。
  70698. * @property {string} property - 被改变的图层属性。
  70699. */
  70700. this.fire('changelayer', {
  70701. layer: this,
  70702. property: "opacity"
  70703. });
  70704. }
  70705. }
  70706. }
  70707. /**
  70708. * @function mapboxgl.supermap.HeatMapLayer.prototype.updateHeatPoints
  70709. * @description 刷新热点图显示。
  70710. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  70711. */
  70712. }, {
  70713. key: "updateHeatPoints",
  70714. value: function updateHeatPoints(bounds) {
  70715. if (this.features && this.features.length > 0) {
  70716. this.convertFastToPixelPoints(bounds);
  70717. } else {
  70718. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxWidth);
  70719. }
  70720. }
  70721. /**
  70722. * @function mapboxgl.supermap.HeatMapLayer.prototype.convertFastToPixelPoints
  70723. * @description 过滤位于当前显示范围内的热点,并转换其为当前分辨率下的像素坐标。
  70724. * @param {mapboxgl.LngLatBounds} bounds - 当前显示范围。
  70725. * @private
  70726. */
  70727. }, {
  70728. key: "convertFastToPixelPoints",
  70729. value: function convertFastToPixelPoints(bounds) {
  70730. var data = [],
  70731. x,
  70732. y,
  70733. k,
  70734. resolution,
  70735. maxTemp,
  70736. minTemp,
  70737. maxWeightTemp; //获取当前像素下的地理范围
  70738. var dw = bounds.getEast() - bounds.getWest();
  70739. var dh = bounds.getNorth() - bounds.getSouth();
  70740. var mapCanvas = this.map.getCanvas();
  70741. if (dw / mapCanvas.width > dh / mapCanvas.height) {
  70742. resolution = dw / mapCanvas.width;
  70743. } else {
  70744. resolution = dh / mapCanvas.height;
  70745. } //热点半径
  70746. this.useRadius = this.useGeoUnit ? parseInt(this.radius / resolution) : this.radius;
  70747. for (var i = 0; i < this.features.length; i++) {
  70748. var feature = this.features[i];
  70749. var point = feature.geometry; //可通过bounds过滤需绘制的features以优化性能,但mapboxgl旋转获取得bounds不适
  70750. var pixelPoint = this.getPixelXY(new LonLat(point.x, point.y));
  70751. if (this.featureWeight) {
  70752. pixelPoint.weight = feature.attributes[this.featureWeight]; //point.value;
  70753. if (!this.maxWeight) {
  70754. //找出最大最小权重值
  70755. maxTemp = maxTemp ? maxTemp : pixelPoint.weight;
  70756. minTemp = minTemp ? minTemp : pixelPoint.weight;
  70757. maxTemp = Math.max(maxTemp, pixelPoint.weight);
  70758. minTemp = Math.min(minTemp, pixelPoint.weight);
  70759. }
  70760. } else {
  70761. pixelPoint.weight = 1;
  70762. }
  70763. x = Math.floor(pixelPoint.x);
  70764. y = Math.floor(pixelPoint.y);
  70765. k = pixelPoint.weight;
  70766. data.push([x, y, k]);
  70767. } //无最大权重设置
  70768. if (!this.maxWeight) {
  70769. if (maxTemp && minTemp) {
  70770. maxWeightTemp = (maxTemp + minTemp) / 2;
  70771. } else {
  70772. maxWeightTemp = 1;
  70773. }
  70774. this.draw(data, maxWeightTemp);
  70775. } else {
  70776. this.draw(data, this.maxWeight);
  70777. }
  70778. }
  70779. /**
  70780. * @function mapboxgl.supermap.HeatMapLayer.prototype.draw
  70781. * @description 绘制热点图。
  70782. * @param {Array} data - convertToPixelPoints方法计算出的点。
  70783. * @private
  70784. */
  70785. }, {
  70786. key: "draw",
  70787. value: function draw(data, maxWeight) {
  70788. if (this.maxHeight > 0 && this.maxWidth > 0) {
  70789. //清空
  70790. var ctx = this.canvasContext;
  70791. this.canvasContext.clearRect(0, 0, this.maxWidth, this.maxHeight);
  70792. this.drawCircle(this.useRadius);
  70793. this.createGradient();
  70794. for (var i = 0; i < data.length; i++) {
  70795. var p = data[i];
  70796. this.canvasContext.globalAlpha = Math.max(p[2] / maxWeight, 0.05);
  70797. this.canvasContext.drawImage(this.circle, p[0] - this.useRadius, p[1] - this.useRadius);
  70798. }
  70799. var colored = ctx.getImageData(0, 0, this.maxWidth, this.maxHeight);
  70800. this.colorize(colored.data, this.grad);
  70801. ctx.putImageData(colored, 0, 0);
  70802. } else {
  70803. return false;
  70804. }
  70805. }
  70806. /**
  70807. * @function mapboxgl.supermap.HeatMapLayer.prototype.colorize
  70808. * @description 根据渐变色重置热点图rgb值。
  70809. * @param {Array} pixels - 像素 RGBA 值。
  70810. * @param {Array} gradient - 渐变 canvas.getImageData.data。
  70811. * @private
  70812. */
  70813. }, {
  70814. key: "colorize",
  70815. value: function colorize(pixels, gradient) {
  70816. for (var i = 0, j; i < pixels.length; i += 4) {
  70817. j = pixels[i + 3] * 4;
  70818. if (j) {
  70819. pixels[i] = gradient[j];
  70820. pixels[i + 1] = gradient[j + 1];
  70821. pixels[i + 2] = gradient[j + 2];
  70822. }
  70823. }
  70824. }
  70825. /**
  70826. * @function mapboxgl.supermap.HeatMapLayer.drawCircle
  70827. * @description 绘制热点半径圆。
  70828. * @param {number} r - 热点半径。
  70829. * @private
  70830. */
  70831. }, {
  70832. key: "drawCircle",
  70833. value: function drawCircle(r) {
  70834. var blur = r / 2;
  70835. var circle = this.circle = document.createElement('canvas'),
  70836. ctx = circle.getContext("2d");
  70837. circle.height = 2 * r;
  70838. circle.width = 2 * r;
  70839. ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
  70840. ctx.shadowBlur = blur;
  70841. ctx.shadowColor = "#000000";
  70842. ctx.beginPath();
  70843. ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
  70844. ctx.closePath();
  70845. ctx.fill();
  70846. }
  70847. /**
  70848. * @function mapboxgl.supermap.HeatMapLayer.createGradient
  70849. * @description 根据 this.colors 设置渐变并 getImageData。
  70850. * @private
  70851. */
  70852. }, {
  70853. key: "createGradient",
  70854. value: function createGradient() {
  70855. var colors = this.colors;
  70856. var canvas = document.createElement('canvas'),
  70857. ctx = canvas.getContext("2d"),
  70858. gradient = ctx.createLinearGradient(0, 0, 0, 256);
  70859. canvas.height = 256;
  70860. canvas.width = 1;
  70861. var index = 1;
  70862. for (var i = 0, len = colors.length; i < len; i++) {
  70863. gradient.addColorStop(index / len, colors[i]);
  70864. index++;
  70865. }
  70866. ctx.fillStyle = gradient;
  70867. ctx.fillRect(0, 0, 1, 256);
  70868. this.grad = ctx.getImageData(0, 0, 1, 256).data;
  70869. }
  70870. /**
  70871. * @function mapboxgl.supermap.HeatMapLayer.prototype.getPixelXY
  70872. * @description 转换地理坐标为相对于当前窗口左上角的像素坐标。
  70873. * @param {number} x - 热点的像素 x 坐标。
  70874. * @param {number} y - 热点的像素 y 坐标。
  70875. */
  70876. }, {
  70877. key: "getPixelXY",
  70878. value: function getPixelXY(coordinate) {
  70879. var pixelP,
  70880. map = this.map;
  70881. if (coordinate instanceof Point || coordinate instanceof GeoText) {
  70882. var tempPoint = map.project(new (external_mapboxgl_default()).LngLat(coordinate.x, coordinate.y));
  70883. pixelP = {
  70884. x: parseInt(tempPoint.x),
  70885. y: parseInt(tempPoint.y)
  70886. };
  70887. }
  70888. if (coordinate instanceof LonLat) {
  70889. var _tempPoint = map.project(new (external_mapboxgl_default()).LngLat(coordinate.lon, coordinate.lat));
  70890. pixelP = {
  70891. x: parseInt(_tempPoint.x),
  70892. y: parseInt(_tempPoint.y)
  70893. };
  70894. }
  70895. return pixelP;
  70896. }
  70897. /**
  70898. * @function mapboxgl.supermap.HeatMapLayer.prototype.toiClientFeature
  70899. * @description 转为 iClient 要素。
  70900. * @param {GeoJSONObject} features - 待添加的要素数组。
  70901. */
  70902. }, {
  70903. key: "toiClientFeature",
  70904. value: function toiClientFeature(features) {
  70905. if (!Util.isArray(features)) {
  70906. features = [features];
  70907. }
  70908. var featuresTemp = [];
  70909. for (var i = 0; i < features.length; i++) {
  70910. if (features[i] instanceof Vector) {
  70911. // 若是 GeometryVector 直接返回
  70912. featuresTemp.push(features[i]);
  70913. } else if (["FeatureCollection", "Feature", "Geometry"].indexOf(features[i].type) != -1) {
  70914. //GeoJSON 规范数据类型
  70915. var format = new GeoJSON();
  70916. featuresTemp = featuresTemp.concat(format.read(features[i]));
  70917. } else if (features[i].geometry && features[i].geometry.parts) {
  70918. //iServer服务器返回数据格式
  70919. featuresTemp.push(ServerFeature.fromJson(features[i]).toFeature());
  70920. } else {
  70921. throw new Error("Features[".concat(i, "]'s type does not match, please check."));
  70922. }
  70923. }
  70924. return featuresTemp;
  70925. }
  70926. /**
  70927. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeFeatures
  70928. * @description 移除指定的热点信息。
  70929. * @param {Array.<SuperMap.Feature.Vector>} features - 热点信息数组。
  70930. */
  70931. }, {
  70932. key: "removeFeatures",
  70933. value: function removeFeatures(features) {
  70934. if (!features || features.length === 0 || !this.features || this.features.length === 0) {
  70935. return;
  70936. }
  70937. if (features === this.features) {
  70938. return this.removeAllFeatures();
  70939. }
  70940. if (!Util.isArray(features)) {
  70941. features = [features];
  70942. }
  70943. var heatPoint,
  70944. index,
  70945. heatPointsFailedRemoved = [];
  70946. for (var i = 0, len = features.length; i < len; i++) {
  70947. heatPoint = features[i];
  70948. index = Util.indexOf(this.features, heatPoint); //找不到视为删除失败
  70949. if (index === -1) {
  70950. heatPointsFailedRemoved.push(heatPoint);
  70951. continue;
  70952. } //删除热点
  70953. this.features.splice(index, 1);
  70954. }
  70955. var succeed = heatPointsFailedRemoved.length == 0 ? true : false; //派发删除features成功的事件
  70956. /**
  70957. * @event mapboxgl.supermap.HeatMapLayer#featuresremoved
  70958. * @description 要素删除之后触发。
  70959. * @property {Array.<SuperMap.Feature.Vector>} features - 需要被删除的要素。
  70960. * @property {boolean} succeed - 要素删除成功与否。
  70961. */
  70962. this.fire(this.EVENT_TYPES[1], {
  70963. features: heatPointsFailedRemoved,
  70964. succeed: succeed
  70965. });
  70966. this.refresh();
  70967. }
  70968. /**
  70969. * @function mapboxgl.supermap.HeatMapLayer.prototype.removeAllFeatures
  70970. * @description 移除全部的热点信息。
  70971. */
  70972. }, {
  70973. key: "removeAllFeatures",
  70974. value: function removeAllFeatures() {
  70975. this.features = [];
  70976. this.refresh();
  70977. }
  70978. /**
  70979. * @function mapboxgl.supermap.HeatMapLayer.prototype.moveTo
  70980. * @description 将图层移动到某个图层之前。
  70981. * @param {string} layerID - 待插入的图层ID。
  70982. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  70983. */
  70984. }, {
  70985. key: "moveTo",
  70986. value: function moveTo(layerID, before) {
  70987. var layer = document.getElementById(this.rootCanvas.id);
  70988. before = before !== undefined ? before : true;
  70989. if (before) {
  70990. var beforeLayer = document.getElementById(layerID);
  70991. if (layer && beforeLayer) {
  70992. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  70993. }
  70994. return;
  70995. }
  70996. var nextLayer = document.getElementById(layerID);
  70997. if (layer) {
  70998. if (nextLayer.nextSibling) {
  70999. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  71000. return;
  71001. }
  71002. nextLayer.parentNode.appendChild(layer);
  71003. }
  71004. }
  71005. /**
  71006. * @function mapboxgl.supermap.HeatMapLayer.prototype.setVisibility
  71007. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  71008. * @param {boolean} [visibility] - 是否显示图层(当前地图的resolution在最大最小resolution之间)。
  71009. */
  71010. }, {
  71011. key: "setVisibility",
  71012. value: function setVisibility(visibility) {
  71013. if (this.rootCanvas && visibility !== this.visibility) {
  71014. this.visibility = visibility;
  71015. this.rootCanvas.style.display = visibility ? "block" : "none";
  71016. }
  71017. } //事件绑定
  71018. }, {
  71019. key: "_resizeEvent",
  71020. value: function _resizeEvent() {
  71021. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71022. var canvas = this.map.getCanvas();
  71023. this.rootCanvas.style.width = canvas.style.width;
  71024. this.rootCanvas.style.height = canvas.style.height;
  71025. this.rootCanvas.width = this.maxWidth = parseInt(canvas.width);
  71026. this.rootCanvas.height = this.maxHeight = parseInt(canvas.height);
  71027. var devicePixelRatio = window.devicePixelRatio || 1;
  71028. devicePixelRatio !== 1 && this.canvasContext && this.canvasContext.scale(devicePixelRatio, devicePixelRatio);
  71029. this.refresh();
  71030. }
  71031. }, {
  71032. key: "_zoomStartEvent",
  71033. value: function _zoomStartEvent() {
  71034. if (this.loadWhileAnimating || !this.visibility) {
  71035. return;
  71036. }
  71037. this.zooming = true;
  71038. this._hide();
  71039. }
  71040. }, {
  71041. key: "_zoomEndEvent",
  71042. value: function _zoomEndEvent() {
  71043. if (this.loadWhileAnimating || !this.visibility) {
  71044. return;
  71045. }
  71046. this.zooming = false;
  71047. this._show();
  71048. }
  71049. }, {
  71050. key: "_rotateStartEvent",
  71051. value: function _rotateStartEvent() {
  71052. if (this.loadWhileAnimating || !this.visibility) {
  71053. return;
  71054. }
  71055. this.rotating = true;
  71056. }
  71057. }, {
  71058. key: "_rotateEvent",
  71059. value: function _rotateEvent() {
  71060. if (this.loadWhileAnimating || !this.visibility) {
  71061. return;
  71062. }
  71063. if (this.map.getPitch() !== 0) {
  71064. this._hide();
  71065. }
  71066. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71067. var tPitch = this.map.getPitch() - this.startPitch;
  71068. var tBearing = -this.map.getBearing() + this.startBearing;
  71069. this.rootCanvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)';
  71070. }
  71071. }, {
  71072. key: "_rotateEndEvent",
  71073. value: function _rotateEndEvent() {
  71074. if (this.loadWhileAnimating || !this.visibility) {
  71075. return;
  71076. }
  71077. this.rotating = false;
  71078. this._show();
  71079. }
  71080. }, {
  71081. key: "_dragEndEvent",
  71082. value: function _dragEndEvent() {
  71083. if (this.loadWhileAnimating || !this.visibility) {
  71084. return;
  71085. }
  71086. this._hide();
  71087. }
  71088. }, {
  71089. key: "_moveEndEvent",
  71090. value: function _moveEndEvent() {
  71091. if (this.loadWhileAnimating || !this.visibility) {
  71092. return;
  71093. }
  71094. this.rootCanvas.style.transform = '';
  71095. this.refresh();
  71096. this._show();
  71097. }
  71098. }, {
  71099. key: "_moveStartEvent",
  71100. value: function _moveStartEvent() {
  71101. if (this.loadWhileAnimating || !this.visibility) {
  71102. return;
  71103. }
  71104. this.startPitch = this.map.getPitch();
  71105. this.startBearing = this.map.getBearing();
  71106. var startMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  71107. this.startMoveX = startMovePoint.x;
  71108. this.startMoveY = startMovePoint.y;
  71109. }
  71110. }, {
  71111. key: "_moveEvent",
  71112. value: function _moveEvent() {
  71113. if (this.loadWhileAnimating || !this.visibility) {
  71114. this.refresh();
  71115. return;
  71116. }
  71117. if (this.rotating || this.zooming) {
  71118. return;
  71119. }
  71120. if (this.map.getPitch() !== 0) {
  71121. this._hide();
  71122. }
  71123. this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
  71124. var tPitch = this.map.getPitch() - this.startPitch;
  71125. var tBearing = -this.map.getBearing() + this.startBearing;
  71126. var endMovePoint = this.map.project(new (external_mapboxgl_default()).LngLat(0, 0));
  71127. var tMoveX = endMovePoint.x - this.startMoveX;
  71128. var tMoveY = endMovePoint.y - this.startMoveY;
  71129. this.rootCanvas.style.transform = 'rotateX(' + tPitch + 'deg)' + ' rotateZ(' + tBearing + 'deg)' + ' translate3d(' + tMoveX + 'px, ' + tMoveY + 'px, 0px)';
  71130. }
  71131. }, {
  71132. key: "_hide",
  71133. value: function _hide() {
  71134. this.rootCanvas.style.display = 'none';
  71135. }
  71136. }, {
  71137. key: "_show",
  71138. value: function _show() {
  71139. this.rootCanvas.style.display = 'block';
  71140. }
  71141. }]);
  71142. return HeatMapLayer;
  71143. }((external_mapboxgl_default()).Evented);
  71144. (external_mapboxgl_default()).supermap.HeatMapLayer = HeatMapLayer;
  71145. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/DeckglLayer.js
  71146. function DeckglLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71147. function DeckglLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71148. function DeckglLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) DeckglLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) DeckglLayer_defineProperties(Constructor, staticProps); return Constructor; }
  71149. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  71150. * This program are made available under the terms of the Apache License, Version 2.0
  71151. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71152. /**
  71153. * @class mapboxgl.supermap.DeckglLayer
  71154. * @category Visualization DeckGL
  71155. * @classdesc Deckgl 高效率图层,该图图层为综合图层,通过该图层可创建 高效率点图层、路径图层(线图层)、高效率面图层、曲线图层、
  71156. * 正六边形图层(蜂巢图层)、网格图层,只需给定相依配置,因此,在创建图层之前,请仔细阅读参数配置。
  71157. * @param {string} layerTypeID - 高效率图层类型 ID,包括 "scatter-plot" 高效率点图层、"path-layer" 路径图层(线图层)、
  71158. * "polygon-layer" 高效率面图层、 "arc-layer" 曲线图层、"hexagon-layer" 正六边形图层(蜂巢图层)、"screen-grid-layer" 网格图层。
  71159. * @param {Object} options - 图层配置项,包括以下参数:
  71160. * @param {Array.<GeoJSONObject>} options.data - 图层数据,支持 GeoJSON 规范数据类型。
  71161. * @param {Object} options.callback - deckgl 图层回调函数配置项。
  71162. * @param {Object} options.props - deckgl 图层配置项, 在该参数下配置图层配置项:
  71163. * @param {boolean} options.props.coverage - "hexagon-layer" 配置项:六边形半径乘数,介于0 - 1之间。六边形的最终半径通过覆盖半径计算。 注意:覆盖范围不会影响分数的分配方式。 分配方式的半径仅由半径属性确定;
  71164. * @param {boolean} options.props.hexagonAggregator - "hexagon-layer" 配置项:* @param {boolean}
  71165. * options.props.lightSettings - 公共配置项:光照,包含以下几个配置;
  71166. * @param {Array} options.props.lightSettings.lightsPosition - 光照配置项:指定为`[x,y,z]`的光在平面阵列中的位置`, 在一个平面阵列。 长度应该是 `3 x numberOfLights`。
  71167. * @param {Array} options.props.lightSettings.lightsStrength - 光照配置项:平面阵列中指定为“[x,y]`的灯的强度。 长度应该是`2 x numberOfLights`。
  71168. * @param {number} [options.props.lightSettings.numberOfLights=1] - 光照配置项:光照值,最大值为 `5`。
  71169. * @param {number} [options.props.lightSettings.coordinateSystem=COORDINATE_SYSTEM.LNGLAT] - 光照配置项:指定灯位置的坐标系。
  71170. * @param {number} [options.props.lightSettings.coordinateOrigin=[0, 0, 0]] - 光照配置项:指定灯位置的坐标原点。
  71171. * @param {number} [options.props.lightSettings.modelMatrix] - 光照配置项:光位置的变换矩阵。
  71172. * @param {number} [options.props.lightSettings.ambientRatio=0.4] - 光照配置项:光照的环境比例。
  71173. * @param {number} [options.props.lightSettings.diffuseRatio=0.6] - 光照配置项:光的漫反射率。
  71174. * @param {number} [options.props.lightSettings.specularRatio=0.8] - 光照配置项:光的镜面反射率。
  71175. * @param {Object} [options.layerId] - DeckglLayer 图层 Dom 元素 ID。默认使用 CommonUtil.createUniqueID("graphicLayer_" + this.layerTypeID + "_") 创建专题图层 ID。
  71176. * @param {number} [options.props.opacity=1] - 公共配置项:图层透明度。
  71177. * @param {boolean} [options.props.pickable=false] - 公共配置项:是否响应鼠标事件(鼠标点击,鼠标滑动)。
  71178. * @param {function} [options.props.autoHighlight=false] - 公共配置项:鼠标滑动高亮要素。
  71179. * @param {function} [options.props.highlightColor=[0, 0, 128, 128]] - 公共配置项:鼠标滑动高亮颜色。
  71180. * @param {function} [options.props.onClick] - 公共配置项:鼠标点击事件。
  71181. * @param {function} [options.props.onHover] - 公共配置项:鼠标滑动事件。
  71182. * @param {number} [options.props.radiusScale=1] - "scatter-plot" 配置项:散点半径比例。
  71183. * @param {boolean} [options.props.outline=false] - "scatter-plot" 配置项:是否边线显示。
  71184. * @param {number} [options.props.strokeWidth=1] - "scatter-plot" 配置项:边线宽度。
  71185. * @param {number} [options.props.radiusMinPixels=0] - "scatter-plot" 配置项:半径最小像素值。
  71186. * @param {number} [options.props.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - "scatter-plot" 配置项:半径最大像素值。
  71187. * @param {boolean} [options.props.fp64=false] - "scatter-plot" 配置项:否应以高精度64位模式呈现图层。
  71188. * @param {number} [options.props.widthScale=1] - "path-layer" 配置项:线宽比例。
  71189. * @param {number} [options.props.widthMinPixels=0] - "path-layer" 配置项:线宽最小像素值。
  71190. * @param {number} [options.props.widthMaxPixels=Number.MAX_SAFE_INTEGER] - "path-layer" 配置项:线宽最大像素值。
  71191. * @param {boolean} [options.props.rounded=false] - "path-layer" 配置项:节点是否绘制为弧形。
  71192. * @param {number} [options.props.miterLimit=4] - "path-layer" 配置项:节点相对于线宽的最大范围,仅在 rounded 为 false 时有效;
  71193. * @param {boolean} [options.props.fp64=false] - "path-layer" 配置项:否应以高精度64位模式呈现图层。
  71194. * @param {boolean} [options.props.dashJustified=false] - "path-layer" 配置项:是否虚线形式显示,仅在 getDashArray() 回调函数被指定时有效。
  71195. * @param {boolean} [options.props.filled=true] - "polygon-layer" 配置项:是否填充面。
  71196. * @param {boolean} [options.props.stroked=true] - "polygon-layer" 配置项:是否绘制边线。
  71197. * @param {boolean} [options.props.extruded=false] - "polygon-layer" 配置项:是否拉伸建筑。
  71198. * @param {boolean} [options.props.wireframe=false] - "polygon-layer" 配置项:当面被拉伸为建筑时,是否描绘建筑物边线。
  71199. * @param {boolean} [options.props.elevationScale=1] - "polygon-layer" 配置项:海拔比例。
  71200. * @param {boolean} [options.props.lineWidthScale=1] - "polygon-layer" 配置项:线宽比例。
  71201. * @param {boolean} [options.props.lineWidthMinPixels=0] - "polygon-layer" 配置项:线宽最小像素值。
  71202. * @param {boolean} [options.props.lineWidthMaxPixels=Number.MAX_SAFE_INTEGER] - "polygon-layer" 配置项:线宽最大像素值。
  71203. * @param {boolean} [options.props.lineJointRounded=false] - "polygon-layer" 配置项:节点是否绘制为弧形。
  71204. * @param {boolean} [options.props.lineMiterLimit=4] - "polygon-layer" 配置项:节点相对于线宽的最大范围,仅在 lineJointRounded 为 false 时有效。
  71205. * @param {boolean} [options.props.lineDashJustified=false] - "polygon-layer" 配置项:是否虚线形式显示,仅在 getLineDashArray() 回调函数被指定时有效。
  71206. * @param {boolean} [options.props.fp64=false] - "polygon-layer" 配置项:否应以高精度64位模式呈现图层。
  71207. * @param {boolean} [options.props.fp64=false] - "arc-layer" 配置项:否应以高精度64位模式呈现图层。
  71208. * @param {boolean} [options.props.strokeWidth=1] - "arc-layer" 配置项:线宽。
  71209. * @param {boolean} [options.props.radius=1000] - "hexagon-layer" 配置项:六边形半径值。
  71210. * @param {boolean} [options.props.extruded=false] - "hexagon-layer" 配置项:是否拉伸要素。
  71211. * @param {boolean} [options.props.upperPercentile=100] - "hexagon-layer" 配置项:筛选箱并通过upperPercentile重新计算颜色。 颜色值大于upperPercentile的六边形将被隐藏。
  71212. * @param {boolean} [options.props.elevationScale=1] - "hexagon-layer" 配置项:高程乘数,实际海拔高度由 elevationScale * getElevation(d)计算。 elevationScale是一个方便的属性,可以在不更新数据的情况下缩放所有六边形。
  71213. * @param {boolean} [options.props.colorDomain=false] - "hexagon-layer" 配置项:色阶。
  71214. * @param {boolean} [options.props.colorRange=[[255,255,178,255],[254,217,118,255],[254,178,76,255],[253,141,60,255],[240,59,32,255],[189,0,38,255]]] - "hexagon-layer" 配置项:色带。
  71215. */
  71216. var DeckglLayer = /*#__PURE__*/function () {
  71217. function DeckglLayer(layerTypeID, options) {
  71218. DeckglLayer_classCallCheck(this, DeckglLayer);
  71219. // Util.extend(defaultProps, options);
  71220. /**
  71221. * @member {string} mapboxgl.supermap.DeckglLayer.prototype.id
  71222. * @description 高效率点图层 id。
  71223. */
  71224. this.layerTypeID = layerTypeID;
  71225. /**
  71226. * @member {Array.<mapboxgl.supermap.Graphic>} mapboxgl.supermap.DeckglLayer.prototype.graphics
  71227. * @description 点要素对象数组。
  71228. */
  71229. this.data = [].concat(options.data);
  71230. this.props = options.props ? options.props : {};
  71231. this.callback = options.callback ? options.callback : {};
  71232. this.id = options.layerId ? options.layerId : Util.createUniqueID('graphicLayer_' + this.layerTypeID + '_');
  71233. /**
  71234. * @member {boolean} [mapboxgl.supermap.DeckglLayer.prototype.visibility=true]
  71235. * @description 图层显示状态属性。
  71236. */
  71237. this.visibility = true;
  71238. }
  71239. /**
  71240. * @function mapboxgl.supermap.DeckglLayer.prototype.onAdd
  71241. * @param {mapboxgl.Map} map - Mapbox GL 地图对象。
  71242. * @returns {mapboxgl.supermap.DeckglLayer}
  71243. */
  71244. DeckglLayer_createClass(DeckglLayer, [{
  71245. key: "onAdd",
  71246. value: function onAdd(map) {
  71247. this.map = map;
  71248. if (this.canvas) {
  71249. this.mapContainer = this.map.getCanvasContainer();
  71250. this.mapContainer.appendChild(this.canvas);
  71251. return this;
  71252. } //当使用扩展的mapboxgl代码时有效
  71253. if (map.getCRS && map.getCRS() !== (external_mapboxgl_default()).CRS.EPSG3857) {
  71254. this.coordinateSystem = 3;
  71255. this.isGeographicCoordinateSystem = true;
  71256. } //创建图层容器
  71257. this._initContainer(); //创建 deckgl 图层
  71258. this._createLayerByLayerTypeID();
  71259. var mapState = this._getState();
  71260. var deckOptions = {};
  71261. for (var key in mapState) {
  71262. deckOptions[key] = mapState[key];
  71263. }
  71264. deckOptions.layers = [this.layer];
  71265. deckOptions.canvas = this.canvas;
  71266. this.deckGL = new window.DeckGL.experimental.DeckGLJS(deckOptions);
  71267. this.map.on('render', this._moveEvent.bind(this));
  71268. this.map.on('resize', this._resizeEvent.bind(this));
  71269. this._draw();
  71270. return this;
  71271. }
  71272. /**
  71273. * @function mapboxgl.supermap.DeckglLayer.prototype.remove
  71274. * @description 删除该图层。
  71275. */
  71276. }, {
  71277. key: "remove",
  71278. value: function remove() {
  71279. this.map.off('render', this._moveEvent.bind(this));
  71280. this.map.off('resize', this._resizeEvent.bind(this));
  71281. this.map.getCanvasContainer().removeChild(this.canvas);
  71282. }
  71283. /**
  71284. * @function mapboxgl.supermap.DeckglLayer.prototype.removeFromMap
  71285. * @deprecated
  71286. * @description 删除该图层。
  71287. */
  71288. }, {
  71289. key: "removeFromMap",
  71290. value: function removeFromMap() {
  71291. this.remove();
  71292. this.clear();
  71293. }
  71294. /**
  71295. * @function mapboxgl.supermap.DeckglLayer.prototype.moveTo
  71296. * @description 将图层移动到某个图层之前。
  71297. * @param {string} layerID - 待插入的图层 ID。
  71298. * @param {boolean} [before=true] - 是否将本图层插入到图层 id 为 layerID 的图层之前(如果为 false 则将本图层插入到图层 id 为 layerID 的图层之后)。
  71299. */
  71300. }, {
  71301. key: "moveTo",
  71302. value: function moveTo(layerID, before) {
  71303. var layer = document.getElementById(this.id);
  71304. before = before !== undefined ? before : true;
  71305. if (before) {
  71306. var beforeLayer = document.getElementById(layerID);
  71307. if (layer && beforeLayer) {
  71308. beforeLayer.parentNode.insertBefore(layer, beforeLayer);
  71309. }
  71310. return;
  71311. }
  71312. var nextLayer = document.getElementById(layerID);
  71313. if (layer) {
  71314. if (nextLayer.nextSibling) {
  71315. nextLayer.parentNode.insertBefore(layer, nextLayer.nextSibling);
  71316. return;
  71317. }
  71318. nextLayer.parentNode.appendChild(layer);
  71319. }
  71320. }
  71321. /**
  71322. * @function mapboxgl.supermap.DeckglLayer.prototype.setVisibility
  71323. * @description 设置图层可见性,设置图层的隐藏,显示,重绘的相应的可见标记。
  71324. * @param {boolean} [visibility] - 是否显示图层(当前地图的 resolution 在最大最小 resolution 之间)。
  71325. */
  71326. }, {
  71327. key: "setVisibility",
  71328. value: function setVisibility(visibility) {
  71329. if (this.canvas && visibility !== this.visibility) {
  71330. this.visibility = visibility;
  71331. this.canvas.style.display = visibility ? 'block' : 'none';
  71332. }
  71333. }
  71334. /**
  71335. * @function mapboxgl.supermap.DeckglLayer.prototype.setStyle
  71336. * @description 设置图层整体样式。
  71337. * @param {Object} styleOptions - 样式对象。
  71338. * @param {Array.<number>} [styleOptions.color=[0, 0, 0, 255]] - 点颜色。
  71339. * @param {number} [styleOptions.radius=10] - 点半径。
  71340. * @param {number} [styleOptions.opacity=0.8] - 不透明度。
  71341. * @param {Array} [styleOptions.highlightColor] - 高亮颜色,目前只支持 rgba 数组。
  71342. * @param {number} [styleOptions.radiusScale=1] - 点放大倍数。
  71343. * @param {number} [styleOptions.radiusMinPixels=0] - 半径最小值(像素)。
  71344. * @param {number} [styleOptions.radiusMaxPixels=Number.MAX_SAFE_INTEGER] - 半径最大值(像素)。
  71345. * @param {number} [styleOptions.strokeWidth=12] - 边框大小。
  71346. * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
  71347. */
  71348. }, {
  71349. key: "setStyle",
  71350. value: function setStyle(styleOptions) {
  71351. core_Util_Util.extend(this.props, styleOptions);
  71352. this._createLayerByLayerTypeID();
  71353. this.update();
  71354. }
  71355. /**
  71356. * @function mapboxgl.supermap.DeckglLayer.prototype.setData
  71357. * @description 设置绘制的点要素数据,会覆盖之前的所有要素。
  71358. * @param {Array.<Object>} data - 点要素对象数组。
  71359. */
  71360. }, {
  71361. key: "setData",
  71362. value: function setData(data) {
  71363. this.data = this.data || [];
  71364. this.data.length = 0;
  71365. var dataTemp = !core_Util_Util.isArray(data) ? [data] : [].concat(data); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  71366. if (!this.layer.props.data) {
  71367. this.layer.props.data = [];
  71368. }
  71369. this.layer.props.data.length = 0;
  71370. for (var i = 0; i < dataTemp.length; i++) {
  71371. this.layer.props.data.push(dataTemp[i]);
  71372. }
  71373. this.data = this.layer.props.data;
  71374. this.update();
  71375. }
  71376. /**
  71377. * @function mapboxgl.supermap.DeckglLayer.prototype.addData
  71378. * @description 添加点要素,不会覆盖之前的要素。
  71379. * @param {Array.<Object>} data - 点要素对象数组。
  71380. */
  71381. }, {
  71382. key: "addData",
  71383. value: function addData(data) {
  71384. this.data = this.data || [];
  71385. var dataTemp = !core_Util_Util.isArray(data) ? [data] : [].concat(data); //this.layer.props.data不能被重新赋值,只能在原数组上进行操作
  71386. if (!this.layer.props.data) {
  71387. this.layer.props.data = [];
  71388. }
  71389. for (var i = 0; i < dataTemp.length; i++) {
  71390. this.layer.props.data.push(dataTemp[i]);
  71391. }
  71392. this.update();
  71393. }
  71394. /**
  71395. * @function mapboxgl.supermap.DeckglLayer.prototype.update
  71396. * @description 更新图层。
  71397. */
  71398. }, {
  71399. key: "update",
  71400. value: function update() {
  71401. if (this.layer.lifecycle !== 'Awaiting state') {
  71402. var changeFlags = {
  71403. dataChanged: true,
  71404. propsChanged: true,
  71405. viewportChanged: true,
  71406. updateTriggersChanged: true
  71407. };
  71408. this.layer.setChangeFlags(changeFlags);
  71409. }
  71410. this._draw();
  71411. }
  71412. /**
  71413. * @function mapboxgl.supermap.DeckglLayer.prototype.clear
  71414. * @description 释放图层资源。
  71415. */
  71416. // todo 还有哪些资源应该被释放?
  71417. }, {
  71418. key: "clear",
  71419. value: function clear() {
  71420. this.removeData();
  71421. this.deckGL.finalize();
  71422. }
  71423. /**
  71424. * @function mapboxgl.supermap.DeckglLayer.prototype.removeData
  71425. * @description 移除所有要素。
  71426. */
  71427. }, {
  71428. key: "removeData",
  71429. value: function removeData() {
  71430. this.data.length = 0;
  71431. if (this.layer.props.data) {
  71432. this.layer.props.data.length = 0;
  71433. }
  71434. this.update();
  71435. }
  71436. }, {
  71437. key: "_draw",
  71438. value: function _draw() {
  71439. var deckOptions = this._getState();
  71440. deckOptions.layers = [this.layer];
  71441. deckOptions.canvas = this.canvas; // this.deckGL.updateLayers();
  71442. this.deckGL.setProps(deckOptions);
  71443. }
  71444. }, {
  71445. key: "_getState",
  71446. value: function _getState() {
  71447. //获取地图信息构建state
  71448. var map = this.map;
  71449. var width = parseInt(this.canvas.style.width);
  71450. var height = parseInt(this.canvas.style.height);
  71451. var center = map.getCenter();
  71452. var longitude = center.lng;
  71453. var latitude = center.lat;
  71454. var zoom = map.getZoom();
  71455. var maxZoom = map.getMaxZoom();
  71456. var pitch = map.getPitch();
  71457. var bearing = map.getBearing();
  71458. var mapViewport = {
  71459. width: width,
  71460. height: height,
  71461. longitude: longitude,
  71462. latitude: latitude,
  71463. zoom: zoom,
  71464. maxZoom: maxZoom,
  71465. pitch: pitch,
  71466. bearing: bearing
  71467. };
  71468. var state = {}; //克隆 mapViewport
  71469. for (var key in mapViewport) {
  71470. state[key] = mapViewport[key];
  71471. } //克隆 props
  71472. for (var _key in this.props) {
  71473. state[_key] = this.props[_key];
  71474. } //当使用扩展的mapboxgl代码时有效
  71475. if (map.getCRS && map.getCRS() !== (external_mapboxgl_default()).CRS.EPSG3857) {
  71476. state.coordinateSystem = this.coordinateSystem;
  71477. state.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  71478. } //更行数据
  71479. state.data = this.data;
  71480. return state;
  71481. }
  71482. /**
  71483. * @function mapboxgl.supermap.DeckglLayer.prototype._createLayerByLayerTypeID
  71484. * @description 判别当前创建图层类型。
  71485. * @private
  71486. */
  71487. }, {
  71488. key: "_createLayerByLayerTypeID",
  71489. value: function _createLayerByLayerTypeID() {
  71490. //统一处理公共属性:
  71491. this.props.data = this.data;
  71492. this.props.isGeographicCoordinateSystem = this.isGeographicCoordinateSystem;
  71493. this.props.coordinateSystem = this.coordinateSystem; //添加事件监听
  71494. this.props.pickable = Boolean(this.props.onClick) || Boolean(this.props.onHover); //各类型各自从 defaultProps 取出相形的参数:
  71495. if (this.layerTypeID === 'scatter-plot') {
  71496. this.props.id = 'scatter-plot';
  71497. this._createScatterPlotLayer();
  71498. } else if (this.layerTypeID === 'path-layer') {
  71499. this.props.id = 'path-layer';
  71500. this._createPathLayer();
  71501. } else if (this.layerTypeID === 'polygon-layer') {
  71502. this.props.id = 'polygon-layer';
  71503. this._createPolygonLayer();
  71504. } else if (this.layerTypeID === 'arc-layer') {
  71505. this.props.id = 'arc-layer';
  71506. this._createArcLineLayer();
  71507. } else if (this.layerTypeID === 'hexagon-layer') {
  71508. this.props.id = 'hexagon-layer';
  71509. this._createHexagonLayer();
  71510. } else {
  71511. throw new Error(this.layerTypeID + ' does not support');
  71512. }
  71513. }
  71514. /**
  71515. * @description scatter-plot
  71516. * @private
  71517. */
  71518. }, {
  71519. key: "_createScatterPlotLayer",
  71520. value: function _createScatterPlotLayer() {
  71521. //处理回调
  71522. /* this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  71523. if (!point) {
  71524. return [0, 0, 0];
  71525. }
  71526. return point.geometry.coordinates;
  71527. };*/
  71528. var me = this;
  71529. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (point) {
  71530. if (!point) {
  71531. return [0, 0, 0];
  71532. }
  71533. var lngLat = point.getLngLat();
  71534. return lngLat && [lngLat.lng, lngLat.lat, 0];
  71535. };
  71536. if (this.callback.getColor) {
  71537. this.props.getColor = this.callback.getColor ? this.callback.getColor : function (point) {
  71538. var style = point && point.getStyle();
  71539. return style && style.color || me.props.color;
  71540. };
  71541. }
  71542. if (this.callback.getRadius) {
  71543. this.props.getRadius = this.callback.getRadius ? this.callback.getRadius : function (point) {
  71544. var style = point && point.getStyle();
  71545. return style && style.radius || me.props.radius;
  71546. };
  71547. }
  71548. if (this.props.color || this.props.radius) {
  71549. this.props.updateTriggers = {};
  71550. if (this.props.radius) {
  71551. this.props.updateTriggers.getRadius = [this.props.radius];
  71552. }
  71553. if (this.props.color) {
  71554. this.props.updateTriggers.getColor = [this.props.color];
  71555. }
  71556. }
  71557. this.layer = new window.DeckGL.ScatterplotLayer(this.props);
  71558. }
  71559. /**
  71560. * @description path-layer
  71561. * @private
  71562. */
  71563. }, {
  71564. key: "_createPathLayer",
  71565. value: function _createPathLayer() {
  71566. this.props.getPath = this.callback.getPath ? this.callback.getPath : function (feature) {
  71567. return feature.geometry.coordinates;
  71568. }; //以下几个函数也可走默认值
  71569. if (this.callback.getColor) {
  71570. this.props.getColor = this.callback.getColor;
  71571. }
  71572. if (this.callback.getWidth) {
  71573. this.props.getWidth = this.callback.getWidth;
  71574. }
  71575. if (this.callback.getDashArray) {
  71576. this.props.getDashArray = this.callback.getDashArray;
  71577. }
  71578. this.layer = new window.DeckGL.PathLayer(this.props);
  71579. }
  71580. /**
  71581. * @description polygon-layer
  71582. * @private
  71583. */
  71584. }, {
  71585. key: "_createPolygonLayer",
  71586. value: function _createPolygonLayer() {
  71587. this.props.getPolygon = this.callback.getPolygon ? this.callback.getPolygon : function (feature) {
  71588. return feature.geometry.coordinates;
  71589. }; //todo 思考下真的让用户配这么多回调么,或者先判断下数据属性里面有没有配置的属性值?
  71590. if (this.callback.getElevation) {
  71591. this.props.getElevation = this.callback.getElevation;
  71592. }
  71593. if (this.callback.getFillColor) {
  71594. this.props.getFillColor = this.callback.getFillColor;
  71595. }
  71596. if (this.callback.getLineColor) {
  71597. this.props.getLineColor = this.callback.getLineColor;
  71598. }
  71599. if (this.callback.getLineWidth) {
  71600. this.props.getLineWidth = this.callback.getLineWidth;
  71601. }
  71602. this.props.updateTriggers = {};
  71603. this.props.updateTriggers.getColor = this.props.color ? this.props.color : [0, 0, 128, 128];
  71604. this.layer = new window.DeckGL.PolygonLayer(this.props);
  71605. }
  71606. /**
  71607. * @description arc-layer
  71608. * @private
  71609. */
  71610. }, {
  71611. key: "_createArcLineLayer",
  71612. value: function _createArcLineLayer() {
  71613. //todo ArcLineLayer geojson coordinates数组中只能有一个线段
  71614. this.props.getSourcePosition = this.callback.getSourcePosition ? this.callback.getSourcePosition : function (feature) {
  71615. if (!feature) {
  71616. return [0, 0, 0];
  71617. }
  71618. return feature.geometry.coordinates[0];
  71619. };
  71620. this.props.getTargetPosition = this.callback.getTargetPosition ? this.callback.getTargetPosition : function (feature) {
  71621. if (!feature) {
  71622. return [0, 0, 0];
  71623. }
  71624. return feature.geometry.coordinates[1];
  71625. };
  71626. if (this.callback.getStrokeWidth) {
  71627. this.props.getStrokeWidth = this.callback.getStrokeWidth;
  71628. }
  71629. if (this.callback.getSourceColor) {
  71630. this.props.getSourceColor = this.callback.getSourceColor;
  71631. }
  71632. if (this.callback.getTargetColor) {
  71633. this.props.getTargetColor = this.callback.getTargetColor;
  71634. }
  71635. this.layer = new window.DeckGL.ArcLayer(this.props);
  71636. }
  71637. /**
  71638. * @description hexagon-layer
  71639. * @private
  71640. */
  71641. }, {
  71642. key: "_createHexagonLayer",
  71643. value: function _createHexagonLayer() {
  71644. this.props.getPosition = this.callback.getPosition ? this.callback.getPosition : function (feature) {
  71645. if (!feature) {
  71646. return [0, 0, 0];
  71647. }
  71648. return feature.geometry.coordinates;
  71649. };
  71650. if (this.callback.getColorValue) {
  71651. this.props.getColorValue = this.callback.getColorValue;
  71652. }
  71653. if (this.callback.getElevationValue) {
  71654. this.props.getElevationValue = this.callback.getElevationValue;
  71655. }
  71656. this.layer = new window.DeckGL.HexagonLayer(this.props);
  71657. }
  71658. }, {
  71659. key: "_initContainer",
  71660. value: function _initContainer() {
  71661. this.canvas = this._createCanvas();
  71662. this.mapContainer = this.map.getCanvasContainer();
  71663. this.mapContainer.appendChild(this.canvas);
  71664. }
  71665. }, {
  71666. key: "_createCanvas",
  71667. value: function _createCanvas() {
  71668. var canvas = document.createElement('canvas');
  71669. canvas.id = this.id;
  71670. canvas.style.position = 'absolute';
  71671. canvas.style.top = 0 + 'px';
  71672. canvas.style.left = 0 + 'px';
  71673. canvas.style.cursor = '';
  71674. var map = this.map;
  71675. canvas.width = parseInt(map.getCanvas().style.width);
  71676. canvas.height = parseInt(map.getCanvas().style.height);
  71677. canvas.style.width = map.getCanvas().style.width;
  71678. canvas.style.height = map.getCanvas().style.height;
  71679. return canvas;
  71680. }
  71681. }, {
  71682. key: "_moveEvent",
  71683. value: function _moveEvent() {
  71684. this._draw();
  71685. }
  71686. }, {
  71687. key: "_resizeEvent",
  71688. value: function _resizeEvent() {
  71689. var canvas = this.canvas;
  71690. var map = this.map;
  71691. canvas.width = parseInt(map.getCanvas().style.width);
  71692. canvas.height = parseInt(map.getCanvas().style.height);
  71693. canvas.style.width = map.getCanvas().style.width;
  71694. canvas.style.height = map.getCanvas().style.height;
  71695. this._draw();
  71696. }
  71697. }]);
  71698. return DeckglLayer;
  71699. }();
  71700. (external_mapboxgl_default()).supermap.DeckglLayer = DeckglLayer;
  71701. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/GraticuleLayer.js
  71702. function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || GraticuleLayer_unsupportedIterableToArray(arr) || _nonIterableSpread(); }
  71703. 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."); }
  71704. function GraticuleLayer_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return GraticuleLayer_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 GraticuleLayer_arrayLikeToArray(o, minLen); }
  71705. function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
  71706. function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return GraticuleLayer_arrayLikeToArray(arr); }
  71707. function GraticuleLayer_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; }
  71708. function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
  71709. function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
  71710. 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; }
  71711. function GraticuleLayer_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  71712. function GraticuleLayer_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  71713. function GraticuleLayer_createClass(Constructor, protoProps, staticProps) { if (protoProps) GraticuleLayer_defineProperties(Constructor.prototype, protoProps); if (staticProps) GraticuleLayer_defineProperties(Constructor, staticProps); return Constructor; }
  71714. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  71715. * This program are made available under the terms of the Apache License, Version 2.0
  71716. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  71717. /**
  71718. * reference and modification
  71719. * dereklieu/cool-grid, cloudybay/leaflet.latlng-graticule
  71720. * (https://github.com/dereklieu/cool-grid, https://github.com/cloudybay/leaflet.latlng-graticule)
  71721. * Apache Licene 2.0
  71722. * thanks dereklieu, cloudybay
  71723. */
  71724. /**
  71725. * @class mapboxgl.supermap.GraticuleLayer
  71726. * @category Visualization GraticuleLayer
  71727. * @classdesc 经纬网。
  71728. * @version 10.1.1
  71729. * @param {Object} options -经纬网参数。
  71730. * @param {string} [options.layerID] - 图层 ID。默认使用 CommonUtil.createUniqueID("graticuleLayer_") 创建图层 ID。
  71731. * @param {boolean} [options.visible=true] - 是否显示经纬网。
  71732. * @param {boolean} [options.showLabel=true] - 是否显示标签。
  71733. * @param {number} [options.opacity=1] - 画布透明度。
  71734. * @param {number|Function} [options.interval = 10] - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  71735. * @param {mapboxgl.LngLatBounds} [options.extent] - 经纬网渲染的边界范围([minx, miny, maxx, maxy]),不传为整个地图范围。
  71736. * @param {number} [options.minZoom] - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  71737. * @param {number} [options.maxZoom] - 该图层可见的最大视图缩放级别(含)。
  71738. * @param {Function} [options.lngLabelFormatter = null] - 经度标签转换函数。
  71739. * @param {Function} [options.latLabelFormatter = null] - 纬度标签转换函数。
  71740. * @param {mapboxgl.supermap.GraticuleLayer.LabelStyle} [options.lngLabelStyle] - 经度标签样式。
  71741. * @param {mapboxgl.supermap.GraticuleLayer.LabelStyle} [options.latLabelStyle] - 纬度标签样式。
  71742. * @param {mapboxgl.supermap.GraticuleLayer.StrokeStyle} [options.strokeStyle] - 绘制经纬线的样式。
  71743. */
  71744. /**
  71745. * @typedef {Object} mapboxgl.supermap.GraticuleLayer.LabelStyle - 标签样式
  71746. * @property {Array.<string>} [textFont = ['Calibri','sans-serif']] - 字体样式。
  71747. * @property {string} [textSize = '12px'] - 字体大小。
  71748. * @property {string} [textColor ='rgba(0,0,0,1)'] - 字体颜色
  71749. * @property {string} [textHaloColor ='rgba(255,255,255,1)'] - 描边颜色
  71750. * @property {number} [textHaloWidth = 1] - 描边宽度
  71751. * @property {string} [textAnchor = 'bottom'] - 字体基线: "center", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right"
  71752. */
  71753. /**
  71754. * @typedef {Object} mapboxgl.supermap.GraticuleLayer.StrokeStyle - 线样式
  71755. * @property {string} [lineColor = 'red'] - 线颜色。
  71756. * @property {string} [lineCap = 'round'] - 线端点风格:butt, round, square。
  71757. * @property {string} [lineJoin = round] - 线连接样式:bevel, round, miter。
  71758. * @property {Array.<number>} [lindDasharray = [0.5,4]] - 虚线样式。
  71759. * @property {number} [lineWidth = 1] - 线宽。
  71760. */
  71761. var defaultTextStyle = {
  71762. textSize: '12px',
  71763. textFont: ['12px Calibri', 'sans-serif'],
  71764. textAnchor: 'bottom',
  71765. textColor: 'rgba(0,0,0,1)',
  71766. textHaloColor: 'rgba(255,255,255,1)',
  71767. textHaloWidth: 1
  71768. };
  71769. var defaultStrokeStyle = {
  71770. lineColor: 'red',
  71771. lineCap: 'round',
  71772. // butt, round, square
  71773. lineJoin: 'round',
  71774. // bevel, round, miter
  71775. lindDasharray: [0.4, 5],
  71776. // 数组|function
  71777. lineDashOffset: 0,
  71778. lineWidth: 1 // 数字|function
  71779. };
  71780. var defaultOptions = {
  71781. showLabel: true,
  71782. opacity: 1,
  71783. visible: true,
  71784. interval: 10,
  71785. // function|number
  71786. extent: null,
  71787. minZoom: 0,
  71788. maxZoom: 50,
  71789. wrapX: true,
  71790. strokeStyle: defaultStrokeStyle,
  71791. lngLabelFormatter: null,
  71792. latLabelFormatter: null,
  71793. lngLabelStyle: defaultTextStyle,
  71794. latLabelStyle: defaultTextStyle
  71795. };
  71796. var GraticuleLayer = /*#__PURE__*/function () {
  71797. function GraticuleLayer(options) {
  71798. GraticuleLayer_classCallCheck(this, GraticuleLayer);
  71799. this.id = options && options.layerID ? options.layerID : Util.createUniqueID('graticuleLayer_');
  71800. this.sourceId = this.id + '_line';
  71801. this.canvasId = this.id;
  71802. this.options = options;
  71803. this.resetEvent = this._reset.bind(this);
  71804. this.styleDataEevent = this._setLayerTop.bind(this);
  71805. this.resizeEvent = this._resizeCallback.bind(this);
  71806. this.zoomendEvent = this.setVisibility.bind(this);
  71807. }
  71808. GraticuleLayer_createClass(GraticuleLayer, [{
  71809. key: "onAdd",
  71810. value: function onAdd() {
  71811. var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.map;
  71812. this.map = map;
  71813. this._initialize();
  71814. this._createCanvas();
  71815. this._bindEvent();
  71816. this._drawCanvas();
  71817. this._addGraticuleLayer();
  71818. this.setVisibility();
  71819. }
  71820. /**
  71821. * @function mapboxgl.supermap.GraticuleLayer.prototype.removeFromMap
  71822. * @description 移除图层。
  71823. */
  71824. }, {
  71825. key: "removeFromMap",
  71826. value: function removeFromMap() {
  71827. this.mapContainer.removeChild(this.canvas);
  71828. this.canvas = null;
  71829. this._unbindEvent();
  71830. }
  71831. /**
  71832. * @function mapboxgl.supermap.GraticuleLayer.prototype.setVisibility
  71833. * @description 设置是否可见。
  71834. * @param {boolean} visible - 是否可见。
  71835. */
  71836. }, {
  71837. key: "setVisibility",
  71838. value: function setVisibility(visible) {
  71839. var zoom = this.map && this.map.getZoom();
  71840. this.options.visible = typeof visible === 'boolean' ? visible : this.options.visible;
  71841. this.visible = typeof visible === 'boolean' ? visible : this.options.visible && zoom >= this.options.minZoom && zoom <= this.options.maxZoom;
  71842. if (this.map.getLayer(this.sourceId)) {
  71843. this.map.setLayoutProperty(this.sourceId, 'visibility', this.visible ? 'visible' : 'none');
  71844. }
  71845. this._drawLabel();
  71846. }
  71847. /**
  71848. * @function mapboxgl.supermap.GraticuleLayer.prototype.setMinZoom
  71849. * @description 设置最小视图缩放级别。
  71850. * @param {number} minZoom - 最小视图缩放级别(不包括此级别),在该级别之上,该层将可见。
  71851. */
  71852. }, {
  71853. key: "setMinZoom",
  71854. value: function setMinZoom(minZoom) {
  71855. this.options.minZoom = minZoom;
  71856. this.setVisibility();
  71857. }
  71858. /**
  71859. * @function mapboxgl.supermap.GraticuleLayer.prototype.setMaxZoom
  71860. * @description 该图层可见的最大视图缩放级别。
  71861. * @param {number} maxZoom - 该图层可见的最大视图缩放级别(含)。
  71862. */
  71863. }, {
  71864. key: "setMaxZoom",
  71865. value: function setMaxZoom(maxZoom) {
  71866. this.options.maxZoom = maxZoom;
  71867. this.setVisibility();
  71868. }
  71869. /**
  71870. * @function mapboxgl.supermap.GraticuleLayer.prototype.setShowLabel
  71871. * @description 设置显示标签。
  71872. * @param {boolean} showLabel - 是否显示标签。
  71873. */
  71874. }, {
  71875. key: "setShowLabel",
  71876. value: function setShowLabel(showLabel) {
  71877. this.options.showLabel = showLabel;
  71878. this._drawLabel();
  71879. }
  71880. /**
  71881. * @function mapboxgl.supermap.GraticuleLayer.prototype.setExtent
  71882. * @description 设置经纬网渲染的边界范围。
  71883. * @param {mapboxgl.LngLatBounds} extent - 经纬网渲染的边界范围。
  71884. */
  71885. }, {
  71886. key: "setExtent",
  71887. value: function setExtent(extent) {
  71888. this.options.extent = this._getDefaultExtent(extent, this.map);
  71889. this.features = this._getGraticuleFeatures();
  71890. this._updateGraticuleLayer();
  71891. this._drawLabel();
  71892. }
  71893. /**
  71894. * @function mapboxgl.supermap.GraticuleLayer.prototype.setStrokeStyle
  71895. * @description 设置经纬线样式。
  71896. * @param {mapboxgl.supermap.GraticuleLayer.StrokeStyle} strokeStyle - 经纬线样式。
  71897. */
  71898. }, {
  71899. key: "setStrokeStyle",
  71900. value: function setStrokeStyle(strokeStyle) {
  71901. if (!this.map || !this.map.getLayer(this.sourceId)) {
  71902. return;
  71903. }
  71904. this.options.strokeStyle = strokeStyle;
  71905. var _this$_transformStrok = this._transformStrokeStyle(strokeStyle),
  71906. layout = _this$_transformStrok.layout,
  71907. paint = _this$_transformStrok.paint;
  71908. for (var key in layout) {
  71909. this.map.setLayoutProperty(this.sourceId, key, layout[key]);
  71910. }
  71911. for (var _key in paint) {
  71912. this.map.setPaintProperty(this.sourceId, _key, paint[_key]);
  71913. }
  71914. }
  71915. /**
  71916. * @function mapboxgl.supermap.GraticuleLayer.prototype.setLngLabelStyle
  71917. * @description 设置经度标签样式。
  71918. * @param {mapboxgl.supermap.GraticuleLayer.LabelStyle} labelStyle - 标签样式。
  71919. */
  71920. }, {
  71921. key: "setLngLabelStyle",
  71922. value: function setLngLabelStyle(labelStyle) {
  71923. this.options.lngLabelStyle = labelStyle;
  71924. this._drawLabel();
  71925. }
  71926. /**
  71927. * @function mapboxgl.supermap.GraticuleLayer.prototype.setLatLabelStyle
  71928. * @description 设置纬度标签样式。
  71929. * @param {mapboxgl.supermap.GraticuleLayer.LabelStyle} labelStyle - 标签样式。
  71930. */
  71931. }, {
  71932. key: "setLatLabelStyle",
  71933. value: function setLatLabelStyle(labelStyle) {
  71934. this.options.latLabelStyle = labelStyle;
  71935. this._drawLabel();
  71936. }
  71937. /**
  71938. * @function mapboxgl.supermap.GraticuleLayer.prototype.setIntervals
  71939. * @description 设置经纬度的间隔(以度为单位)
  71940. * @param {number|Function} interval - 经纬度的间隔(以度为单位),可以是数字,也可以是函数,参数是map。
  71941. */
  71942. }, {
  71943. key: "setIntervals",
  71944. value: function setIntervals(interval) {
  71945. this.options.interval = interval;
  71946. this._calcInterval();
  71947. this.features = this._getGraticuleFeatures();
  71948. this._updateGraticuleLayer();
  71949. this._drawLabel();
  71950. }
  71951. }, {
  71952. key: "_bindEvent",
  71953. value: function _bindEvent() {
  71954. this.map.on('move', this.resetEvent);
  71955. this.map.on('moveend', this.resetEvent);
  71956. this.map.on('styledata', this.styleDataEevent);
  71957. this.map.on('resize', this.resizeEvent);
  71958. this.map.on('zoomend', this.zoomendEvent);
  71959. }
  71960. }, {
  71961. key: "_unbindEvent",
  71962. value: function _unbindEvent() {
  71963. this.map.off('move', this.resetEvent);
  71964. this.map.off('moveend', this.resetEvent);
  71965. this.map.off('styledata', this.styleDataEevent);
  71966. this.map.off('resize', this.resizeEvent);
  71967. this.map.off('zoomend', this.zoomendEvent);
  71968. }
  71969. }, {
  71970. key: "_initialize",
  71971. value: function _initialize() {
  71972. var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.map;
  71973. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.options;
  71974. options = options || {};
  71975. options.strokeStyle = _objectSpread(_objectSpread({}, defaultStrokeStyle), options.strokeStyle || {});
  71976. options.lngLabelStyle = _objectSpread(_objectSpread({}, defaultTextStyle), options.lngLabelStyle || {});
  71977. options.latLabelStyle = _objectSpread(_objectSpread({}, defaultTextStyle), options.latLabelStyle || {});
  71978. this.options = _objectSpread(_objectSpread(_objectSpread({}, defaultOptions), options), {}, {
  71979. extent: this._getDefaultExtent(options.extent, map),
  71980. wrapX: typeof options.wrapX === 'boolean' ? options.wrapX : map.getRenderWorldCopies()
  71981. });
  71982. this.oldExtent = this.options.extent;
  71983. this._calcInterval();
  71984. this.isRotate = false;
  71985. this.visible = true;
  71986. this.features = this._getGraticuleFeatures();
  71987. }
  71988. }, {
  71989. key: "_createCanvas",
  71990. value: function _createCanvas() {
  71991. if (this.canvas) {
  71992. return;
  71993. }
  71994. this.canvas = document.createElement('canvas');
  71995. this.canvas.id = this.canvasId;
  71996. this.canvas.style.position = 'absolute';
  71997. this.canvas.style.top = 0 + 'px';
  71998. this.canvas.style.left = 0 + 'px';
  71999. var global$2 = typeof window === 'undefined' ? {} : window;
  72000. var devicePixelRatio = global$2.devicePixelRatio || 1;
  72001. this.canvas.width = parseInt(this.map.getCanvas().style.width) * devicePixelRatio;
  72002. this.canvas.height = parseInt(this.map.getCanvas().style.height) * devicePixelRatio;
  72003. this.canvas.style.width = this.map.getCanvas().style.width;
  72004. this.canvas.style.height = this.map.getCanvas().style.height;
  72005. this.canvas.globalAlpha = this.options.opacity;
  72006. this.mapContainer = this.map.getCanvasContainer();
  72007. this.mapContainer.appendChild(this.canvas);
  72008. }
  72009. }, {
  72010. key: "_drawCanvas",
  72011. value: function _drawCanvas() {
  72012. if (!this.canvas) {
  72013. this._createCanvas();
  72014. }
  72015. this.setVisibility();
  72016. this._reset();
  72017. }
  72018. }, {
  72019. key: "_resizeCallback",
  72020. value: function _resizeCallback() {
  72021. this.mapContainer && this.mapContainer.removeChild(this.canvas);
  72022. this.canvas = null;
  72023. this._drawCanvas();
  72024. }
  72025. }, {
  72026. key: "_reset",
  72027. value: function _reset() {
  72028. this._updateRotate();
  72029. this._updateExtent();
  72030. this._calcInterval();
  72031. this._drawLabel();
  72032. }
  72033. }, {
  72034. key: "_setLayerTop",
  72035. value: function _setLayerTop() {
  72036. var _this = this;
  72037. var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.map;
  72038. if (!map) {
  72039. return;
  72040. }
  72041. var layersOnMap = map.getStyle && map.getStyle().layers;
  72042. if (layersOnMap && layersOnMap.length && layersOnMap.findIndex(function (item) {
  72043. return item.id === _this.sourceId;
  72044. }) !== layersOnMap.length - 1) {
  72045. if (map.getLayer(this.sourceId)) {
  72046. map.removeLayer(this.sourceId);
  72047. this._addGraticuleLayer();
  72048. }
  72049. }
  72050. }
  72051. }, {
  72052. key: "_getDefaultExtent",
  72053. value: function _getDefaultExtent(extent) {
  72054. var map = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.map;
  72055. var crs = map.getCRS && map.getCRS() || {};
  72056. var crsExtent = crs.extent;
  72057. if (!crsExtent) {
  72058. crsExtent = [-180, -85.05119, 180, 85.05119];
  72059. }
  72060. if (!extent || extent.length === 0) {
  72061. return crsExtent;
  72062. }
  72063. var _mapboxgl$LngLatBound = external_mapboxgl_default().LngLatBounds.convert(extent),
  72064. _sw = _mapboxgl$LngLatBound._sw,
  72065. _ne = _mapboxgl$LngLatBound._ne;
  72066. extent = [_sw.lng, _sw.lat, _ne.lng, _ne.lat];
  72067. extent = [Math.max(crsExtent[0], extent[0]), Math.max(crsExtent[1], extent[1]), Math.min(crsExtent[2], extent[2]), Math.min(crsExtent[3], extent[3])];
  72068. return extent;
  72069. }
  72070. }, {
  72071. key: "_updateRotate",
  72072. value: function _updateRotate() {
  72073. var bearing = this.map.getBearing();
  72074. this.isRotate = bearing > -180 && bearing <= -90 || bearing >= 90 && bearing < 180;
  72075. }
  72076. }, {
  72077. key: "_updateExtent",
  72078. value: function _updateExtent() {
  72079. if (this.options.wrapX && !this.oldExtent) {
  72080. var _this$map$getBounds = this.map.getBounds(),
  72081. _ne = _this$map$getBounds._ne,
  72082. _sw = _this$map$getBounds._sw;
  72083. this.options.extent = [_sw.lng, _sw.lat, _ne.lng, _ne.lat];
  72084. }
  72085. }
  72086. }, {
  72087. key: "_calcInterval",
  72088. value: function _calcInterval() {
  72089. var interval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.interval;
  72090. if (typeof interval === 'function') {
  72091. interval = interval(this.map);
  72092. this._currLngInterval = interval;
  72093. this._currLatInterval = interval;
  72094. } else {
  72095. this._currLngInterval = interval;
  72096. this._currLatInterval = interval;
  72097. }
  72098. }
  72099. }, {
  72100. key: "_formatLat",
  72101. value: function _formatLat(lat) {
  72102. if (this.options.latFormatTickLabel) {
  72103. return this.options.latLabelFormatter(lat);
  72104. }
  72105. if (lat < 0) {
  72106. return '' + conversionDegree(lat * -1) + 'S';
  72107. } else if (lat > 0) {
  72108. return '' + conversionDegree(lat) + 'N';
  72109. }
  72110. return '' + conversionDegree(lat);
  72111. }
  72112. }, {
  72113. key: "_formatLng",
  72114. value: function _formatLng(lng) {
  72115. if (this.options.lngLabelFormatter) {
  72116. return this.options.lngLabelFormatter(lng);
  72117. }
  72118. lng = getWrapNum(lng);
  72119. if (lng > 0 && lng <= 180) {
  72120. return '' + conversionDegree(lng) + 'E';
  72121. } else if (lng < 0 && lng >= -180) {
  72122. return '' + conversionDegree(lng * -1) + 'W';
  72123. }
  72124. return '' + conversionDegree(lng);
  72125. }
  72126. }, {
  72127. key: "_parsePxToInt",
  72128. value: function _parsePxToInt(txt) {
  72129. if (txt.length > 2) {
  72130. if (txt.charAt(txt.length - 2) === 'p') {
  72131. txt = txt.substr(0, txt.length - 2);
  72132. }
  72133. }
  72134. try {
  72135. return parseInt(txt, 10);
  72136. } catch (e) {
  72137. console.log(e);
  72138. }
  72139. return 0;
  72140. }
  72141. }, {
  72142. key: "_drawLabel",
  72143. value: function _drawLabel() {
  72144. var _this2 = this;
  72145. var visible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.visible;
  72146. var canvas = this.canvas;
  72147. var ctx = canvas.getContext('2d');
  72148. if (!visible || !this.options.showLabel) {
  72149. ctx.clearRect(0, 0, canvas.width, canvas.height);
  72150. return;
  72151. }
  72152. if (this.map) {
  72153. if (!this._currLngInterval || !this._currLatInterval) {
  72154. this._calcInterval();
  72155. }
  72156. ctx.clearRect(0, 0, canvas.width, canvas.height);
  72157. var _this$options = this.options,
  72158. lngLabelStyle = _this$options.lngLabelStyle,
  72159. latLabelStyle = _this$options.latLabelStyle;
  72160. var _this$_getGridiculePo = this._getGridiculePoints(),
  72161. lngPoints = _this$_getGridiculePo.lngPoints,
  72162. latPonits = _this$_getGridiculePo.latPonits;
  72163. lngPoints.forEach(function (point) {
  72164. _this2._drawLng(ctx, point[0], point[1], point[2], lngLabelStyle);
  72165. });
  72166. latPonits.forEach(function (point) {
  72167. _this2._drawLat(ctx, point[0], point[1], point[2], latLabelStyle);
  72168. });
  72169. }
  72170. }
  72171. }, {
  72172. key: "_drawLat",
  72173. value: function _drawLat(ctx, latTick, bb, isIntersect, latLabelStyle) {
  72174. ctx = this._setLabelStyle(ctx, latLabelStyle);
  72175. var ww = this.canvas.width;
  72176. var txtHeight = 12;
  72177. try {
  72178. var fontSize = ctx.font.split(' ')[0];
  72179. txtHeight = this._parsePxToInt(fontSize);
  72180. } catch (e) {
  72181. console.log(e);
  72182. }
  72183. if (!isIntersect) {
  72184. var lngR = latTick;
  72185. latTick = bb;
  72186. bb = this.map.project([lngR, latTick]);
  72187. }
  72188. var latstr = this._formatLat(latTick);
  72189. var txtWidth = ctx.measureText(latstr).width;
  72190. ctx.strokeText(latstr, (isIntersect ? ww : bb.x) - txtWidth, (isIntersect ? bb : bb.y) + txtHeight / 2);
  72191. ctx.fillText(latstr, (isIntersect ? ww : bb.x) - txtWidth, (isIntersect ? bb : bb.y) + txtHeight / 2);
  72192. }
  72193. }, {
  72194. key: "_drawLng",
  72195. value: function _drawLng(ctx, lngTick, bb, isIntersect, lngLabelStyle) {
  72196. ctx = this._setLabelStyle(ctx, lngLabelStyle);
  72197. var hh = this.canvas.height;
  72198. if (!isIntersect) {
  72199. var latTick = bb;
  72200. bb = this.map.project([lngTick, latTick]);
  72201. }
  72202. var lngstr = this._formatLng(lngTick);
  72203. var txtWidth = ctx.measureText(lngstr).width;
  72204. ctx.strokeText(lngstr, (isIntersect ? bb : bb.x) - txtWidth / 2, isIntersect ? hh : bb.y);
  72205. ctx.fillText(lngstr, (isIntersect ? bb : bb.x) - txtWidth / 2, isIntersect ? hh : bb.y);
  72206. }
  72207. }, {
  72208. key: "_getLatPoints",
  72209. value: function _getLatPoints() {
  72210. var _this3 = this;
  72211. var lngRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-180, 180];
  72212. var firstLng = arguments.length > 1 ? arguments[1] : undefined;
  72213. var lastLng = arguments.length > 2 ? arguments[2] : undefined;
  72214. var features = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.features;
  72215. if (!features) {
  72216. return;
  72217. }
  72218. if (this.options.wrapX && lngRange[0] === -180 && lngRange[1] === 180) {
  72219. return [];
  72220. }
  72221. var points = [];
  72222. features.forEach(function (feature) {
  72223. var lat = feature.geometry.coordinates[0][1];
  72224. var isLatFeature = feature.geometry.coordinates[1][1] === lat;
  72225. if (isLatFeature) {
  72226. var lng = typeof lastLng === 'number' ? lastLng : lngRange[1];
  72227. if (_this3.isRotate) {
  72228. lng = typeof firstLng === 'number' ? firstLng : lngRange[0];
  72229. }
  72230. if (_this3.options.wrapX) {
  72231. points = points.concat(_this3._getWrapPoints(lng, lat, [lng, lng]));
  72232. }
  72233. points.push([lng, lat]);
  72234. }
  72235. });
  72236. return points;
  72237. }
  72238. }, {
  72239. key: "_getLngPoints",
  72240. value: function _getLngPoints() {
  72241. var _this4 = this;
  72242. var latRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [-90, 90];
  72243. var firstLat = arguments.length > 1 ? arguments[1] : undefined;
  72244. var lastLat = arguments.length > 2 ? arguments[2] : undefined;
  72245. var features = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.features;
  72246. if (!features) {
  72247. return;
  72248. }
  72249. var lat = typeof firstLat === 'number' ? firstLat : latRange[0];
  72250. if (this.isRotate) {
  72251. lat = typeof lastLat === 'number' ? lastLat : latRange[1];
  72252. }
  72253. var points = [];
  72254. features.forEach(function (feature) {
  72255. var lng = feature.geometry.coordinates[0][0];
  72256. var isLngFeature = feature.geometry.coordinates[1][0] === lng;
  72257. if (isLngFeature) {
  72258. points.push([lng, lat]);
  72259. if (_this4.options.wrapX) {
  72260. points = points.concat(_this4._getWrapPoints(lng, lat));
  72261. }
  72262. }
  72263. });
  72264. return points;
  72265. }
  72266. }, {
  72267. key: "_getWrapPoints",
  72268. value: function _getWrapPoints(lng, lat) {
  72269. var extent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.oldExtent;
  72270. var points = [];
  72271. var _this$map$getBounds2 = this.map.getBounds(),
  72272. _ne = _this$map$getBounds2._ne,
  72273. _sw = _this$map$getBounds2._sw;
  72274. var lastLng = extent.length > 2 ? extent[2] : extent[1];
  72275. while (lng >= _sw.lng) {
  72276. var wrapNum = getWrapNum(lng, lastLng === 180, extent[0] === -180);
  72277. if (!extent || wrapNum >= extent[0] && wrapNum <= lastLng) {
  72278. points.push([lng, lat]);
  72279. }
  72280. lng -= 360;
  72281. }
  72282. while (lng <= _ne.lng) {
  72283. var _wrapNum = getWrapNum(lng, lastLng === 180, extent[0] === -180);
  72284. if (!extent || _wrapNum >= extent[0] && _wrapNum <= lastLng) {
  72285. points.push([lng, lat]);
  72286. }
  72287. lng += 360;
  72288. }
  72289. return points;
  72290. }
  72291. }, {
  72292. key: "_getGridiculePoints",
  72293. value: function _getGridiculePoints() {
  72294. var intersectLatPoints = this._getEdgeLat();
  72295. var intersectLngPoints = this._getEdgeLng();
  72296. var _this$_getRange = this._getRange(),
  72297. latRange = _this$_getRange.latRange,
  72298. lngRange = _this$_getRange.lngRange,
  72299. firstLat = _this$_getRange.firstLat,
  72300. firstLng = _this$_getRange.firstLng,
  72301. lastLat = _this$_getRange.lastLat,
  72302. lastLng = _this$_getRange.lastLng;
  72303. var latPonits = this._getUniquePoint(this._getLatPoints(lngRange, firstLng, lastLng), intersectLatPoints, 1);
  72304. var lngPoints = this._getUniquePoint(this._getLngPoints(latRange, firstLat, lastLat), intersectLngPoints, 0);
  72305. return {
  72306. latPonits: latPonits,
  72307. lngPoints: lngPoints
  72308. };
  72309. }
  72310. }, {
  72311. key: "_getEdgeLat",
  72312. value: function _getEdgeLat() {
  72313. var _currLatInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._currLatInterval;
  72314. var map = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.map;
  72315. var latPoints = [];
  72316. var latCoordinates = [];
  72317. var firstLat;
  72318. var ww = this.canvas.width;
  72319. var hh = this.canvas.height;
  72320. var _this$_getRange2 = this._getRange(),
  72321. extent = _this$_getRange2.extent;
  72322. var _this$map$getBounds3 = this.map.getBounds(),
  72323. _ne = _this$map$getBounds3._ne;
  72324. if (this.options.wrapX && getWrapNum(_ne.lng) > extent[2]) {
  72325. return [];
  72326. }
  72327. var countDecimals = this._countDecimals(_currLatInterval);
  72328. for (var i = 0; i <= hh; i++) {
  72329. var point = map.unproject([ww, i]);
  72330. var wrapNum = getWrapNum(point.lng);
  72331. var lngEdge = this.options.wrapX ? wrapNum >= extent[0] && wrapNum <= extent[2] : point.lng >= extent[0] && point.lng <= extent[2];
  72332. if (lngEdge && point.lat >= extent[1] && point.lat <= extent[3]) {
  72333. latPoints.push([point.lat, i]);
  72334. latCoordinates.push(point.lat);
  72335. if (firstLat === undefined && point.lat.toFixed(countDecimals) % _currLatInterval === 0) {
  72336. firstLat = Number(point.lat.toFixed(countDecimals));
  72337. }
  72338. }
  72339. }
  72340. var _this$_getIntersectRa = this._getIntersectRange(firstLat, latCoordinates, latPoints, _currLatInterval),
  72341. first = _this$_getIntersectRa.first,
  72342. last = _this$_getIntersectRa.last,
  72343. coordinates = _this$_getIntersectRa.coordinates,
  72344. points = _this$_getIntersectRa.points;
  72345. firstLat = Math.min(Math.max(first, -90), 90);
  72346. var lastLat = Math.max(Math.min(Math.round(last), 90), -90);
  72347. if (firstLat !== -90 || lastLat !== -90) {
  72348. return this._getClosestCoordinate(firstLat, lastLat, coordinates, points, _currLatInterval);
  72349. }
  72350. return [];
  72351. }
  72352. }, {
  72353. key: "_getEdgeLng",
  72354. value: function _getEdgeLng() {
  72355. var _currLngInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._currLngInterval;
  72356. var map = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.map;
  72357. var lngPoints = [];
  72358. var lngCoordinates = [];
  72359. var firstLng;
  72360. var ww = this.canvas.width;
  72361. var hh = this.canvas.height;
  72362. var extent = this.options.extent;
  72363. var countDecimals = this._countDecimals(_currLngInterval);
  72364. var _this$map$getBounds4 = this.map.getBounds(),
  72365. _sw = _this$map$getBounds4._sw;
  72366. if (this.options.wrapX && getWrapNum(_sw.lat) > extent[3]) {
  72367. return [];
  72368. }
  72369. for (var i = 0; i <= ww; i++) {
  72370. var point = map.unproject([i, hh]);
  72371. var wrapNum = getWrapNum(point.lng);
  72372. var lngEdge = this.options.wrapX ? wrapNum >= extent[0] && wrapNum <= extent[2] : point.lng >= extent[0] && point.lng <= extent[2];
  72373. if (lngEdge && point.lat >= extent[1] && point.lat <= extent[3]) {
  72374. lngPoints.push([point.lng, i]);
  72375. lngCoordinates.push(point.lng);
  72376. if (firstLng === undefined && point.lng.toFixed(countDecimals) % _currLngInterval === 0) {
  72377. firstLng = Number(point.lng.toFixed(countDecimals));
  72378. }
  72379. }
  72380. }
  72381. var _this$_getIntersectRa2 = this._getIntersectRange(firstLng, lngCoordinates, lngPoints, _currLngInterval),
  72382. first = _this$_getIntersectRa2.first,
  72383. lastLng = _this$_getIntersectRa2.last,
  72384. coordinates = _this$_getIntersectRa2.coordinates,
  72385. points = _this$_getIntersectRa2.points;
  72386. firstLng = first;
  72387. return this._getClosestCoordinate(firstLng, lastLng, coordinates, points, _currLngInterval);
  72388. }
  72389. }, {
  72390. key: "_getIntersectRange",
  72391. value: function _getIntersectRange(first, coordinates, points, interval) {
  72392. var last = coordinates[coordinates.length - 1];
  72393. if (first > last) {
  72394. last = first;
  72395. coordinates.reverse();
  72396. points.reverse();
  72397. var countDecimals = this._countDecimals(interval);
  72398. for (var i = 0; i <= coordinates.length; i++) {
  72399. var point = coordinates[i];
  72400. if (point.toFixed(countDecimals) % interval === 0) {
  72401. first = Number(point.toFixed(countDecimals));
  72402. break;
  72403. }
  72404. }
  72405. }
  72406. return {
  72407. first: first,
  72408. last: last,
  72409. coordinates: coordinates,
  72410. points: points
  72411. };
  72412. }
  72413. }, {
  72414. key: "_getClosestCoordinate",
  72415. value: function _getClosestCoordinate(first, last, coordinates, points, interval) {
  72416. var result = [];
  72417. var graticule = first;
  72418. while (graticule <= last) {
  72419. var index = this._getClosestNumberIndex(graticule, coordinates);
  72420. var point = points[index];
  72421. result.push([Math.round(point[0]), point[1], true]);
  72422. graticule += interval;
  72423. coordinates = coordinates.slice(index);
  72424. points = points.slice(index);
  72425. }
  72426. return result;
  72427. }
  72428. }, {
  72429. key: "_getClosestNumberIndex",
  72430. value: function _getClosestNumberIndex(num, arr) {
  72431. var index = 0;
  72432. var diffValue = Number.MAX_VALUE;
  72433. for (var i = 0; i < arr.length; i++) {
  72434. var newDiffValue = Math.abs(arr[i] - num);
  72435. if (newDiffValue <= diffValue) {
  72436. if (newDiffValue === diffValue && arr[i] < arr[index]) {
  72437. continue;
  72438. }
  72439. index = i;
  72440. diffValue = newDiffValue;
  72441. }
  72442. }
  72443. return index;
  72444. }
  72445. }, {
  72446. key: "_getUniquePoint",
  72447. value: function _getUniquePoint(points, intersectPoints) {
  72448. var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  72449. if (this.options.wrapX) {
  72450. return points.concat(intersectPoints);
  72451. }
  72452. if (!intersectPoints || intersectPoints.length === 0) {
  72453. return points;
  72454. }
  72455. var tmp = intersectPoints;
  72456. var width = this.canvas.width;
  72457. var height = this.canvas.height;
  72458. for (var i in points) {
  72459. var edgePoint = this.map.project(points[i]);
  72460. var intersetIndex = tmp.findIndex(function (item) {
  72461. return item[0] === points[i][index];
  72462. });
  72463. if (intersetIndex <= -1) {
  72464. tmp.push(points[i]);
  72465. } else if (edgePoint && edgePoint.x >= 0 && edgePoint.x <= width && edgePoint.y >= 0 && edgePoint.y <= height) {
  72466. tmp[intersetIndex] = points[i];
  72467. }
  72468. }
  72469. return tmp;
  72470. }
  72471. }, {
  72472. key: "_countDecimals",
  72473. value: function _countDecimals(value) {
  72474. if (Math.floor(value) !== value) {
  72475. return value.toString().split('.')[1].length || 0;
  72476. }
  72477. return 0;
  72478. }
  72479. }, {
  72480. key: "_addGraticuleLayer",
  72481. value: function _addGraticuleLayer() {
  72482. var features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.features;
  72483. if (!this.map.getSource(this.sourceId)) {
  72484. var source = {
  72485. type: 'geojson',
  72486. data: {
  72487. type: 'FeatureCollection',
  72488. features: features
  72489. }
  72490. };
  72491. this.map.addSource(this.sourceId, source);
  72492. }
  72493. if (!this.map.getLayer(this.sourceId)) {
  72494. this.map.addLayer(_objectSpread({
  72495. id: this.sourceId,
  72496. type: 'line',
  72497. source: this.sourceId
  72498. }, this._transformStrokeStyle()));
  72499. }
  72500. }
  72501. }, {
  72502. key: "_updateGraticuleLayer",
  72503. value: function _updateGraticuleLayer() {
  72504. var features = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.features;
  72505. if (this.map.getSource(this.sourceId)) {
  72506. var geoJSONData = {
  72507. type: 'FeatureCollection',
  72508. features: features
  72509. };
  72510. this.map.getSource(this.sourceId).setData(geoJSONData);
  72511. }
  72512. this._addGraticuleLayer();
  72513. }
  72514. }, {
  72515. key: "_getGraticuleFeatures",
  72516. value: function _getGraticuleFeatures() {
  72517. var _currLngInterval = this._currLngInterval || 10;
  72518. var _currLatInterval = this._currLatInterval || 10;
  72519. var features = [];
  72520. var _this$_getRange3 = this._getRange(),
  72521. latRange = _this$_getRange3.latRange,
  72522. lngRange = _this$_getRange3.lngRange,
  72523. firstLat = _this$_getRange3.firstLat,
  72524. firstLng = _this$_getRange3.firstLng,
  72525. lastLat = _this$_getRange3.lastLat,
  72526. lastLng = _this$_getRange3.lastLng;
  72527. if (this.options.wrapX && !this.oldExtent) {
  72528. latRange = [-90, 90];
  72529. lngRange = [-180, 180];
  72530. firstLat = firstLng = lastLat = lastLng = null;
  72531. }
  72532. if (typeof firstLng === 'number') {
  72533. features.unshift(this._makeLineFeature(this._makeLineCoords(firstLng, latRange, firstLat, lastLat)));
  72534. }
  72535. if (typeof lastLng === 'number') {
  72536. features.unshift(this._makeLineFeature(this._makeLineCoords(lastLng, latRange, firstLat, lastLat)));
  72537. }
  72538. for (var lng = lngRange[0]; lng <= lngRange[1]; lng += _currLngInterval) {
  72539. features.unshift(this._makeLineFeature(this._makeLineCoords(lng, latRange, firstLat, lastLat)));
  72540. }
  72541. if (typeof firstLat === 'number') {
  72542. features.unshift(this._makeLineFeature(this._makeLineCoords(firstLat, lngRange, firstLng, lastLng, 'lat')));
  72543. }
  72544. if (typeof lastLat === 'number') {
  72545. features.unshift(this._makeLineFeature(this._makeLineCoords(lastLat, lngRange, firstLng, lastLng, 'lat')));
  72546. }
  72547. for (var lat = latRange[0]; lat <= latRange[1]; lat += _currLatInterval) {
  72548. features.unshift(this._makeLineFeature(this._makeLineCoords(lat, lngRange, firstLng, lastLng, 'lat')));
  72549. }
  72550. return features;
  72551. }
  72552. }, {
  72553. key: "_getRange",
  72554. value: function _getRange() {
  72555. var extent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.extent && _toConsumableArray(this.options.extent);
  72556. if (!extent || extent.length === 0) {
  72557. extent = this._getDefaultExtent();
  72558. }
  72559. extent = extent.map(function (item) {
  72560. return Number(item.toFixed(6));
  72561. });
  72562. var realExtent = {};
  72563. if (extent[1] % this._currLatInterval !== 0) {
  72564. realExtent.firstLat = extent[1];
  72565. var intNumber = Math.ceil(extent[1] / this._currLatInterval);
  72566. extent[1] = intNumber * this._currLatInterval;
  72567. }
  72568. if (extent[3] % this._currLatInterval !== 0) {
  72569. realExtent.lastLat = extent[3];
  72570. var _intNumber = Math.floor(extent[3] / this._currLatInterval);
  72571. extent[3] = _intNumber * this._currLatInterval;
  72572. }
  72573. if (extent[0] % this._currLngInterval !== 0) {
  72574. realExtent.firstLng = extent[0];
  72575. var _intNumber2 = Math.ceil(extent[0] / this._currLngInterval);
  72576. extent[0] = _intNumber2 * this._currLngInterval;
  72577. }
  72578. if (extent[2] % this._currLngInterval !== 0) {
  72579. realExtent.lastLng = extent[2];
  72580. var _intNumber3 = Math.floor(extent[2] / this._currLngInterval);
  72581. extent[2] = _intNumber3 * this._currLngInterval;
  72582. }
  72583. return _objectSpread({
  72584. latRange: [extent[1], extent[3]],
  72585. lngRange: [extent[0], extent[2]],
  72586. extent: extent
  72587. }, realExtent);
  72588. }
  72589. }, {
  72590. key: "_makeLineCoords",
  72591. value: function _makeLineCoords(fixedDegree) {
  72592. var range = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [-90, 90];
  72593. var first = arguments.length > 2 ? arguments[2] : undefined;
  72594. var last = arguments.length > 3 ? arguments[3] : undefined;
  72595. var type = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'lng';
  72596. fixedDegree = type === 'lng' ? this._lngFix(fixedDegree) : fixedDegree;
  72597. first = typeof first === 'number' ? first : range[0];
  72598. last = typeof last === 'number' ? last : range[1];
  72599. var interval = Math.abs(first - last);
  72600. var coords = [];
  72601. for (var changedDegree = first; changedDegree <= last; changedDegree += interval) {
  72602. if (type === 'lng') {
  72603. coords.push([fixedDegree, changedDegree]);
  72604. } else {
  72605. coords.push([changedDegree, fixedDegree]);
  72606. }
  72607. }
  72608. return coords;
  72609. }
  72610. }, {
  72611. key: "_makeLineFeature",
  72612. value: function _makeLineFeature(coordinates) {
  72613. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'LineString';
  72614. return {
  72615. type: 'Feature',
  72616. geometry: {
  72617. type: type,
  72618. coordinates: coordinates
  72619. }
  72620. };
  72621. }
  72622. }, {
  72623. key: "_lngFix",
  72624. value: function _lngFix(lng) {
  72625. if (lng >= 180) {
  72626. return 180;
  72627. }
  72628. if (lng <= -180) {
  72629. return -180;
  72630. }
  72631. return lng;
  72632. }
  72633. }, {
  72634. key: "_transformStrokeStyle",
  72635. value: function _transformStrokeStyle() {
  72636. var strokeStyle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.strokeStyle;
  72637. if (!strokeStyle || typeof strokeStyle === 'string') {
  72638. return {
  72639. paint: {
  72640. 'line-color': strokeStyle || 'rgba(0,0,0,0.2)'
  72641. }
  72642. };
  72643. }
  72644. var layout = {
  72645. visibility: this.visible ? 'visible' : 'none',
  72646. 'line-join': strokeStyle.lineJoin || 'round',
  72647. 'line-cap': strokeStyle.lineCap || 'round'
  72648. };
  72649. var paint = {
  72650. 'line-color': strokeStyle.lineColor || 'rgba(0,0,0,0.2)',
  72651. 'line-width': strokeStyle.lineWidth || 1,
  72652. 'line-offset': strokeStyle.lineDashOffset || 0,
  72653. 'line-translate-anchor': 'viewport'
  72654. };
  72655. if (strokeStyle.lineWidth) {
  72656. if (typeof strokeStyle.lineWidth === 'function') {
  72657. paint['line-width'] = strokeStyle.lineWidth(this.map);
  72658. } else {
  72659. paint['line-width'] = strokeStyle.lineWidth;
  72660. }
  72661. }
  72662. if (strokeStyle.lindDasharray) {
  72663. if (typeof strokeStyle.lindDasharray === 'function') {
  72664. paint['line-dasharray'] = strokeStyle.lindDasharray(this.map);
  72665. } else {
  72666. paint['line-dasharray'] = strokeStyle.lindDasharray;
  72667. }
  72668. }
  72669. return {
  72670. layout: layout,
  72671. paint: paint
  72672. };
  72673. }
  72674. }, {
  72675. key: "_setLabelStyle",
  72676. value: function _setLabelStyle(ctx, labelStyle) {
  72677. if (labelStyle.textColor) {
  72678. ctx.fillStyle = labelStyle.textColor;
  72679. }
  72680. if (labelStyle.textSize) {
  72681. ctx.font = labelStyle.textSize + ' ' + (labelStyle.textFont || ['Calibri', 'sans-serif']).join(',');
  72682. }
  72683. if (labelStyle.textHaloColor) {
  72684. ctx.strokeStyle = labelStyle.textHaloColor;
  72685. ctx.lineWidth = labelStyle.textHaloWidth || 1;
  72686. }
  72687. if (labelStyle.textAnchor) {
  72688. ctx.textBaseline = this._getTxetBaseline(labelStyle.textAnchor);
  72689. ctx.textAligin = this._getTxetAlign(labelStyle.textAligin);
  72690. }
  72691. return ctx;
  72692. }
  72693. }, {
  72694. key: "_getTxetBaseline",
  72695. value: function _getTxetBaseline(textAnchor) {
  72696. if (!textAnchor) {
  72697. return 'bottom';
  72698. }
  72699. var textStyle = textAnchor.split('-');
  72700. if (textStyle.includes('bottom')) {
  72701. return 'bottom';
  72702. }
  72703. if (textStyle.includes('top')) {
  72704. return 'top';
  72705. }
  72706. if (textStyle.includes('center')) {
  72707. return 'middle';
  72708. }
  72709. }
  72710. }, {
  72711. key: "_getTxetAlign",
  72712. value: function _getTxetAlign(textAnchor) {
  72713. if (!textAnchor) {
  72714. return 'center';
  72715. }
  72716. var textStyle = textAnchor.split('-');
  72717. if (textStyle.includes('left')) {
  72718. return 'left';
  72719. }
  72720. if (textStyle.includes('right')) {
  72721. return 'right';
  72722. }
  72723. if (textStyle.includes('center')) {
  72724. return 'center';
  72725. }
  72726. }
  72727. }]);
  72728. return GraticuleLayer;
  72729. }();
  72730. (external_mapboxgl_default()).supermap.GraticuleLayer = GraticuleLayer;
  72731. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapvDataSet.js
  72732. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72733. * This program are made available under the terms of the Apache License, Version 2.0
  72734. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72735. var MapvDataSet = {
  72736. /**
  72737. * 返回mapv点数据集
  72738. */
  72739. getPoint: function getPoint(center) {
  72740. if (center && center instanceof Array) {
  72741. return new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet([{
  72742. geometry: {
  72743. type: 'Point',
  72744. coordinates: center
  72745. }
  72746. }]);
  72747. }
  72748. },
  72749. /**
  72750. * 返回mapv多点数据集
  72751. */
  72752. getPoints: function getPoints(points) {
  72753. if (points && points instanceof Array) {
  72754. var mPoints = [];
  72755. points.map(function (data) {
  72756. mPoints.push({
  72757. geometry: {
  72758. type: 'Point',
  72759. coordinates: data.geometry.coordinates
  72760. }
  72761. });
  72762. return data;
  72763. });
  72764. return new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet(mPoints);
  72765. }
  72766. },
  72767. /**
  72768. * 返回mapv弧形线数据集
  72769. */
  72770. getCurveLines: function getCurveLines(startPoint, LinePoints) {
  72771. if (startPoint && startPoint instanceof Array && LinePoints && LinePoints instanceof Array) {
  72772. var lineData = [];
  72773. LinePoints.map(function (data) {
  72774. var coords = data.geometry && data.geometry.coordinates;
  72775. var toCenter = {
  72776. lng: coords[0],
  72777. lat: coords[1]
  72778. };
  72779. var fromCenter = {
  72780. lng: startPoint[0],
  72781. lat: startPoint[1]
  72782. };
  72783. var cv = external_function_try_return_mapv_catch_e_return_namespaceObject.utilCurve.getPoints([fromCenter, toCenter]);
  72784. lineData.push({
  72785. geometry: {
  72786. type: 'LineString',
  72787. coordinates: cv
  72788. }
  72789. });
  72790. return data;
  72791. });
  72792. return new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet(lineData);
  72793. }
  72794. },
  72795. /**
  72796. * 返回mapv弧形动态点数据集
  72797. */
  72798. getCurveDynamicPoints: function getCurveDynamicPoints(center, endPoints) {
  72799. if (center && center instanceof Array && endPoints && endPoints instanceof Array) {
  72800. var timeData = [];
  72801. endPoints.map(function (data) {
  72802. var coords = data.geometry && data.geometry.coordinates;
  72803. var toCenter = {
  72804. lng: coords[0],
  72805. lat: coords[1]
  72806. };
  72807. var fromCenter = {
  72808. lng: center[0],
  72809. lat: center[1]
  72810. };
  72811. var cv = external_function_try_return_mapv_catch_e_return_namespaceObject.utilCurve.getPoints([fromCenter, toCenter]);
  72812. for (var j = 0; j < cv.length; j++) {
  72813. timeData.push({
  72814. geometry: {
  72815. type: 'Point',
  72816. coordinates: cv[j]
  72817. },
  72818. time: j
  72819. });
  72820. }
  72821. return data;
  72822. });
  72823. return new external_function_try_return_mapv_catch_e_return_namespaceObject.DataSet(timeData);
  72824. }
  72825. }
  72826. };
  72827. (external_mapboxgl_default()).supermap.MapvDataSet = MapvDataSet;
  72828. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/MapExtend.js
  72829. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72830. * This program are made available under the terms of the Apache License, Version 2.0
  72831. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72832. (external_mapboxgl_default()).supermap = (external_mapboxgl_default()).supermap || {};
  72833. (external_mapboxgl_default()).supermap.map = (external_mapboxgl_default()).supermap.map || {};
  72834. var getDefaultVectorTileStyle = function getDefaultVectorTileStyle(urlTemplate, options) {
  72835. options = options || {};
  72836. var defaultOptions = {};
  72837. defaultOptions.version = options.version || 8;
  72838. defaultOptions.layers = options.layers || [];
  72839. defaultOptions.light = options.light || {
  72840. "anchor": "viewport",
  72841. "color": "#fcf6ef",
  72842. "intensity": 0.5,
  72843. "position": [1.15, 201, 20]
  72844. };
  72845. var style = {
  72846. "version": defaultOptions.version,
  72847. "sources": {
  72848. "vector-tiles": {
  72849. "type": "vector",
  72850. "tiles": [urlTemplate]
  72851. }
  72852. },
  72853. "layers": defaultOptions.layers,
  72854. "light": defaultOptions.light
  72855. };
  72856. if (options.sprite != null) {
  72857. style.sprite = options.sprite;
  72858. }
  72859. if (options.glyphs != null) {
  72860. style.glyphs = options.glyphs;
  72861. }
  72862. return style;
  72863. };
  72864. var setBackground = function setBackground(map, color) {
  72865. if (color && map) {
  72866. map.addLayer({
  72867. "id": "background",
  72868. "type": "background",
  72869. "paint": {
  72870. "background-color": color
  72871. }
  72872. }, "background");
  72873. }
  72874. };
  72875. var setPaintProperty = function setPaintProperty(map, layerIds, type, paint, source, sourceLayers) {
  72876. if (layerIds && map) {
  72877. if (Object.prototype.toString.call(layerIds) !== '[object Array]') {
  72878. layerIds = [layerIds];
  72879. }
  72880. for (var i = 0; i < layerIds.length; i++) {
  72881. var sourceLayer = sourceLayers ? sourceLayers[i] : null;
  72882. var layer = getLayer(layerIds[i], type, source, sourceLayer, paint);
  72883. map.addLayer(layer, layerIds[i]);
  72884. map.moveLayer(layerIds[i]);
  72885. }
  72886. }
  72887. };
  72888. function getLayer(id, type, source, sourceLayer, paint) {
  72889. var sourceType = source || "vector-tiles";
  72890. var sLayer = sourceLayer || id;
  72891. var layer = {
  72892. "id": id,
  72893. "type": type,
  72894. "source": sourceType,
  72895. "source-layer": sLayer,
  72896. "paint": paint
  72897. };
  72898. return layer;
  72899. }
  72900. (external_mapboxgl_default()).supermap.map.getDefaultVectorTileStyle = getDefaultVectorTileStyle;
  72901. (external_mapboxgl_default()).supermap.map.setBackground = setBackground;
  72902. (external_mapboxgl_default()).supermap.map.setPaintProperty = setPaintProperty;
  72903. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/mapv/index.js
  72904. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72905. * This program are made available under the terms of the Apache License, Version 2.0
  72906. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72907. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/theme/index.js
  72908. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72909. * This program are made available under the terms of the Apache License, Version 2.0
  72910. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72911. ;// CONCATENATED MODULE: ./src/mapboxgl/overlay/index.js
  72912. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72913. * This program are made available under the terms of the Apache License, Version 2.0
  72914. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72915. ;// CONCATENATED MODULE: ./src/mapboxgl/services/ServiceBase.js
  72916. function ServiceBase_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ServiceBase_typeof = function _typeof(obj) { return typeof obj; }; } else { ServiceBase_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ServiceBase_typeof(obj); }
  72917. function ServiceBase_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72918. 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 } }); if (superClass) ServiceBase_setPrototypeOf(subClass, superClass); }
  72919. function ServiceBase_setPrototypeOf(o, p) { ServiceBase_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ServiceBase_setPrototypeOf(o, p); }
  72920. 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); }; }
  72921. function ServiceBase_possibleConstructorReturn(self, call) { if (call && (ServiceBase_typeof(call) === "object" || typeof call === "function")) { return call; } return ServiceBase_assertThisInitialized(self); }
  72922. function ServiceBase_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72923. function ServiceBase_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  72924. function ServiceBase_getPrototypeOf(o) { ServiceBase_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ServiceBase_getPrototypeOf(o); }
  72925. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72926. * This program are made available under the terms of the Apache License, Version 2.0
  72927. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72928. /**
  72929. * @class mapboxgl.supermap.ServiceBase
  72930. * @category iServer
  72931. * @description mapboxgl.supermap 服务基类。
  72932. * @param {string} url - 与客户端交互的服务地址。
  72933. * @param {Object} options - 可选参数。
  72934. * @param {string} [options.proxy] - 服务代理地址。
  72935. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  72936. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  72937. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72938. * @param {Object} [options.headers] - 请求头。
  72939. * @fires mapboxgl.supermap.ServiceBase#initialized
  72940. */
  72941. var ServiceBase = /*#__PURE__*/function (_mapboxgl$Evented) {
  72942. ServiceBase_inherits(ServiceBase, _mapboxgl$Evented);
  72943. var _super = ServiceBase_createSuper(ServiceBase);
  72944. function ServiceBase(url, options) {
  72945. var _this;
  72946. ServiceBase_classCallCheck(this, ServiceBase);
  72947. _this = _super.call(this);
  72948. _this.options = options || {};
  72949. _this.url = url;
  72950. /**
  72951. * @event mapboxgl.supermap.ServiceBase#initialized
  72952. * @description 构造函数构造成功之后触发。
  72953. * @property {Object} this - this 对象。
  72954. */
  72955. _this.fire('initialized', ServiceBase_assertThisInitialized(_this));
  72956. return _this;
  72957. }
  72958. return ServiceBase;
  72959. }((external_mapboxgl_default()).Evented);
  72960. (external_mapboxgl_default()).supermap.ServiceBase = ServiceBase;
  72961. ;// CONCATENATED MODULE: ./src/mapboxgl/services/AddressMatchService.js
  72962. function services_AddressMatchService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_AddressMatchService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_AddressMatchService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_AddressMatchService_typeof(obj); }
  72963. function services_AddressMatchService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  72964. 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); } }
  72965. function services_AddressMatchService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_AddressMatchService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_AddressMatchService_defineProperties(Constructor, staticProps); return Constructor; }
  72966. 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 } }); if (superClass) services_AddressMatchService_setPrototypeOf(subClass, superClass); }
  72967. function services_AddressMatchService_setPrototypeOf(o, p) { services_AddressMatchService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_AddressMatchService_setPrototypeOf(o, p); }
  72968. 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); }; }
  72969. function services_AddressMatchService_possibleConstructorReturn(self, call) { if (call && (services_AddressMatchService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_AddressMatchService_assertThisInitialized(self); }
  72970. function services_AddressMatchService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  72971. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  72972. function services_AddressMatchService_getPrototypeOf(o) { services_AddressMatchService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_AddressMatchService_getPrototypeOf(o); }
  72973. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  72974. * This program are made available under the terms of the Apache License, Version 2.0
  72975. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  72976. /**
  72977. * @class mapboxgl.supermap.AddressMatchService
  72978. * @category iServer AddressMatch
  72979. * @classdesc 地址匹配服务。
  72980. * @example
  72981. * new mapboxgl.supermap.AddressMatchService(url,options)
  72982. * .code(function(result){
  72983. * //doSomething
  72984. * })
  72985. * @param {string} url - 与客户端交互的服务地址。
  72986. * @param {Object} options - 交互时所需可选参数。
  72987. * @param {string} [options.proxy] - 服务代理地址。
  72988. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  72989. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  72990. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  72991. * @param {Object} [options.headers] - 请求头。
  72992. * @extends {mapboxgl.supermap.ServiceBase}
  72993. */
  72994. var AddressMatchService = /*#__PURE__*/function (_ServiceBase) {
  72995. services_AddressMatchService_inherits(AddressMatchService, _ServiceBase);
  72996. var _super = services_AddressMatchService_createSuper(AddressMatchService);
  72997. function AddressMatchService(url, options) {
  72998. services_AddressMatchService_classCallCheck(this, AddressMatchService);
  72999. return _super.call(this, url, options);
  73000. }
  73001. /**
  73002. * @function mapboxgl.supermap.AddressMatchService.prototype.code
  73003. * @description 获取正向地址匹配结果。
  73004. * @param {Object} params - 正向匹配参数。
  73005. * @param {RequestCallback} callback - 请求结果的回调函数。
  73006. */
  73007. services_AddressMatchService_createClass(AddressMatchService, [{
  73008. key: "code",
  73009. value: function code(params, callback) {
  73010. var me = this;
  73011. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  73012. proxy: me.options.proxy,
  73013. withCredentials: me.options.withCredentials,
  73014. crossOrigin: me.options.crossOrigin,
  73015. headers: me.options.headers,
  73016. serverType: me.options.serverType,
  73017. eventListeners: {
  73018. scope: me,
  73019. processCompleted: callback,
  73020. processFailed: callback
  73021. }
  73022. });
  73023. addressMatchService.code(Util.urlPathAppend(me.url, 'geocoding'), params);
  73024. }
  73025. /**
  73026. * @function mapboxgl.supermap.AddressMatchService.prototype.decode
  73027. * @description 获取反向地址匹配结果。
  73028. * @param {Object} params -反向匹配参数。
  73029. * @param {RequestCallback} callback - 请求结果的回调函数。
  73030. */
  73031. }, {
  73032. key: "decode",
  73033. value: function decode(params, callback) {
  73034. var me = this;
  73035. var addressMatchService = new AddressMatchService_AddressMatchService(me.url, {
  73036. proxy: me.options.proxy,
  73037. withCredentials: me.options.withCredentials,
  73038. crossOrigin: me.options.crossOrigin,
  73039. headers: me.options.headers,
  73040. serverType: me.options.serverType,
  73041. eventListeners: {
  73042. scope: me,
  73043. processCompleted: callback,
  73044. processFailed: callback
  73045. }
  73046. });
  73047. addressMatchService.decode(Util.urlPathAppend(me.url, 'geodecoding'), params);
  73048. }
  73049. }]);
  73050. return AddressMatchService;
  73051. }(ServiceBase);
  73052. (external_mapboxgl_default()).supermap.AddressMatchService = AddressMatchService;
  73053. ;// CONCATENATED MODULE: ./src/mapboxgl/services/ChartService.js
  73054. function ChartService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ChartService_typeof = function _typeof(obj) { return typeof obj; }; } else { ChartService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ChartService_typeof(obj); }
  73055. function ChartService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73056. 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); } }
  73057. function ChartService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ChartService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ChartService_defineProperties(Constructor, staticProps); return Constructor; }
  73058. 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 } }); if (superClass) ChartService_setPrototypeOf(subClass, superClass); }
  73059. function ChartService_setPrototypeOf(o, p) { ChartService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ChartService_setPrototypeOf(o, p); }
  73060. 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); }; }
  73061. function ChartService_possibleConstructorReturn(self, call) { if (call && (ChartService_typeof(call) === "object" || typeof call === "function")) { return call; } return ChartService_assertThisInitialized(self); }
  73062. function ChartService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73063. function ChartService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73064. function ChartService_getPrototypeOf(o) { ChartService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ChartService_getPrototypeOf(o); }
  73065. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  73066. * This program are made available under the terms of the Apache License, Version 2.0
  73067. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73068. /**
  73069. * @class mapboxgl.supermap.ChartService
  73070. * @category iServer Map Chart
  73071. * @classdesc 海图服务。
  73072. * @extends {mapboxgl.supermap.ServiceBase}
  73073. * @example
  73074. * new mapboxgl.supermap.ChartService(url)
  73075. * .queryChart(param,function(result){
  73076. * //doSomething
  73077. * })
  73078. * @param {string} url - 与客户端交互的海图服务地址。
  73079. * @param {Object} options - 交互时所需可选参数。
  73080. * @param {string} [options.proxy] - 服务代理地址。
  73081. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73082. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73083. * @param {Object} [options.headers] - 请求头。
  73084. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73085. */
  73086. var ChartService = /*#__PURE__*/function (_ServiceBase) {
  73087. ChartService_inherits(ChartService, _ServiceBase);
  73088. var _super = ChartService_createSuper(ChartService);
  73089. function ChartService(url, options) {
  73090. ChartService_classCallCheck(this, ChartService);
  73091. return _super.call(this, url, options);
  73092. }
  73093. /**
  73094. * @function mapboxgl.supermap.ChartService.prototype.queryChart
  73095. * @description 查询海图服务。
  73096. * @param {SuperMap.ChartQueryParameters} params - 海图查询所需参数类。
  73097. * @param {RequestCallback} callback 回调函数。
  73098. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果格式类型。
  73099. */
  73100. ChartService_createClass(ChartService, [{
  73101. key: "queryChart",
  73102. value: function queryChart(params, callback, resultFormat) {
  73103. var me = this,
  73104. param = me._processParams(params),
  73105. format = me._processFormat(resultFormat);
  73106. var chartQueryService = new ChartQueryService(me.url, {
  73107. proxy: me.options.proxy,
  73108. withCredentials: me.options.withCredentials,
  73109. crossOrigin: me.options.crossOrigin,
  73110. headers: me.options.headers,
  73111. serverType: me.options.serverType,
  73112. eventListeners: {
  73113. scope: me,
  73114. processCompleted: callback,
  73115. processFailed: callback
  73116. },
  73117. format: format
  73118. });
  73119. chartQueryService.processAsync(param);
  73120. }
  73121. /**
  73122. * @function mapboxgl.supermap.ChartService.prototype.getChartFeatureInfo
  73123. * @description 获取海图物标信息服务。
  73124. * @param {RequestCallback} callback 回调函数。
  73125. */
  73126. }, {
  73127. key: "getChartFeatureInfo",
  73128. value: function getChartFeatureInfo(callback) {
  73129. var me = this,
  73130. url = me.url.concat();
  73131. url = Util.urlPathAppend(url, 'chartFeatureInfoSpecs');
  73132. var chartFeatureInfoSpecsService = new ChartFeatureInfoSpecsService(url, {
  73133. proxy: me.options.proxy,
  73134. withCredentials: me.options.withCredentials,
  73135. crossOrigin: me.options.crossOrigin,
  73136. headers: me.options.headers,
  73137. serverType: me.options.serverType,
  73138. eventListeners: {
  73139. scope: me,
  73140. processCompleted: callback,
  73141. processFailed: callback
  73142. }
  73143. });
  73144. chartFeatureInfoSpecsService.processAsync();
  73145. }
  73146. }, {
  73147. key: "_processParams",
  73148. value: function _processParams(params) {
  73149. if (!params) {
  73150. return {};
  73151. }
  73152. params.returnContent = params.returnContent == null ? true : params.returnContent;
  73153. if (params.filter) {
  73154. params.chartQueryFilterParameters = core_Util_Util.isArray(params.filter) ? params.filter : [params.filter];
  73155. }
  73156. if (params.bounds) {
  73157. if (params.bounds instanceof Array) {
  73158. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  73159. }
  73160. if (params.bounds instanceof (external_mapboxgl_default()).LngLatBounds) {
  73161. params.bounds = new Bounds(params.bounds.getSouthWest().lng, params.bounds.getSouthWest().lat, params.bounds.getNorthEast().lng, params.bounds.getNorthEast().lat);
  73162. }
  73163. }
  73164. }
  73165. }, {
  73166. key: "_processFormat",
  73167. value: function _processFormat(resultFormat) {
  73168. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  73169. }
  73170. }]);
  73171. return ChartService;
  73172. }(ServiceBase);
  73173. (external_mapboxgl_default()).supermap.ChartService = ChartService;
  73174. ;// CONCATENATED MODULE: ./src/mapboxgl/services/DataFlowService.js
  73175. function services_DataFlowService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_DataFlowService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_DataFlowService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_DataFlowService_typeof(obj); }
  73176. function services_DataFlowService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73177. 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); } }
  73178. function services_DataFlowService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_DataFlowService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_DataFlowService_defineProperties(Constructor, staticProps); return Constructor; }
  73179. 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 } }); if (superClass) services_DataFlowService_setPrototypeOf(subClass, superClass); }
  73180. function services_DataFlowService_setPrototypeOf(o, p) { services_DataFlowService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_DataFlowService_setPrototypeOf(o, p); }
  73181. 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); }; }
  73182. function services_DataFlowService_possibleConstructorReturn(self, call) { if (call && (services_DataFlowService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_DataFlowService_assertThisInitialized(self); }
  73183. function services_DataFlowService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73184. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73185. function services_DataFlowService_getPrototypeOf(o) { services_DataFlowService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_DataFlowService_getPrototypeOf(o); }
  73186. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  73187. * This program are made available under the terms of the Apache License, Version 2.0
  73188. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73189. /**
  73190. * @class mapboxgl.supermap.DataFlowService
  73191. * @category iServer DataFlow
  73192. * @classdesc 数据流服务。
  73193. * @extends {mapboxgl.supermap.ServiceBase}
  73194. * @example
  73195. * new mapboxgl.supermap.DataFlowService(url)
  73196. * .queryChart(param,function(result){
  73197. * //doSomething
  73198. * })
  73199. * @param {string} url - 与客户端交互的实时数据服务地址。
  73200. * @param {Object} options - 加载实时数据可选参数。
  73201. * @param {GeoJSONObject} [options.geometry] - 指定几何范围,该范围内的要素才能被订阅。
  73202. * @param {Object} [options.excludeField] - 排除字段。
  73203. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73204. * @param {Object} [options.headers] - 请求头。
  73205. * @fires mapboxgl.supermap.DataFlowService#broadcastSocketConnected
  73206. * @fires mapboxgl.supermap.DataFlowService#broadcastSocketError
  73207. * @fires mapboxgl.supermap.DataFlowService#broadcastFailed
  73208. * @fires mapboxgl.supermap.DataFlowService#broadcastSucceeded
  73209. * @fires mapboxgl.supermap.DataFlowService#subscribeSocketError
  73210. * @fires mapboxgl.supermap.DataFlowService#messageSucceeded
  73211. * @fires mapboxgl.supermap.DataFlowService#setFilterParamSucceeded
  73212. */
  73213. var DataFlowService = /*#__PURE__*/function (_ServiceBase) {
  73214. services_DataFlowService_inherits(DataFlowService, _ServiceBase);
  73215. var _super = services_DataFlowService_createSuper(DataFlowService);
  73216. function DataFlowService(url, options) {
  73217. var _this;
  73218. services_DataFlowService_classCallCheck(this, DataFlowService);
  73219. options = options || {};
  73220. if (options.projection) {
  73221. options.prjCoordSys = options.projection;
  73222. }
  73223. _this = _super.call(this, url, options);
  73224. _this.dataFlow = new DataFlowService_DataFlowService(url, options);
  73225. /**
  73226. * @event mapboxgl.supermap.DataFlowService#broadcastSocketConnected
  73227. * @description broadcast Socket 连接成功。
  73228. */
  73229. /**
  73230. * @event mapboxgl.supermap.DataFlowService#broadcastSocketError
  73231. * @description broadcast Socket 连接失败。
  73232. */
  73233. /**
  73234. * @event mapboxgl.supermap.DataFlowService#broadcastFailed
  73235. * @description 广播失败。
  73236. */
  73237. /**
  73238. * @event mapboxgl.supermap.DataFlowService#broadcastSucceeded
  73239. * @description 广播成功。
  73240. */
  73241. /**
  73242. * @event mapboxgl.supermap.DataFlowService#subscribeSocketConnected
  73243. * @description 订阅数据连接成功。
  73244. */
  73245. /**
  73246. * @event mapboxgl.supermap.DataFlowService#subscribeSocketError
  73247. * @description 订阅数据连接失败。
  73248. */
  73249. /**
  73250. * @event mapboxgl.supermap.DataFlowService#messageSucceeded
  73251. * @description 获取信息成功。
  73252. */
  73253. /**
  73254. * @event mapboxgl.supermap.DataFlowService#setFilterParamSucceeded
  73255. * @description 设置过滤参数成功。
  73256. */
  73257. _this.dataFlow.events.on({
  73258. "broadcastSocketConnected": _this._defaultEvent,
  73259. "broadcastSocketError": _this._defaultEvent,
  73260. "broadcastFailed": _this._defaultEvent,
  73261. "broadcastSucceeded": _this._defaultEvent,
  73262. "subscribeSocketConnected": _this._defaultEvent,
  73263. "subscribeSocketError": _this._defaultEvent,
  73264. "messageSucceeded": _this._defaultEvent,
  73265. "setFilterParamSucceeded": _this._defaultEvent,
  73266. scope: services_DataFlowService_assertThisInitialized(_this)
  73267. });
  73268. var me = services_DataFlowService_assertThisInitialized(_this);
  73269. me.on('subscribeSocketConnected', function (e) {
  73270. /**
  73271. * @event mapboxgl.supermap.DataFlowService#subscribesucceeded
  73272. * @description 数据流服务订阅成功后触发。
  73273. * @property {Object} e - 事件对象。
  73274. */
  73275. me.fire('subscribesucceeded', e);
  73276. });
  73277. return _this;
  73278. }
  73279. /**
  73280. * @function mapboxgl.supermap.DataFlowService.prototype.initBroadcast
  73281. * @description 初始化广播。
  73282. * @returns {mapboxgl.supermap.DataFlowService}
  73283. */
  73284. services_DataFlowService_createClass(DataFlowService, [{
  73285. key: "initBroadcast",
  73286. value: function initBroadcast() {
  73287. this.dataFlow.initBroadcast();
  73288. return this;
  73289. }
  73290. /**
  73291. * @function mapboxgl.supermap.DataFlowService.prototype.broadcast
  73292. * @description 加载广播数据。
  73293. * @param {JSON} obj - JSON 格式的要素数据。
  73294. */
  73295. }, {
  73296. key: "broadcast",
  73297. value: function broadcast(obj) {
  73298. this.dataFlow.broadcast(obj);
  73299. }
  73300. /**
  73301. * @function mapboxgl.supermap.DataFlowService.prototype.initSubscribe
  73302. * @description 初始化订阅数据。
  73303. */
  73304. }, {
  73305. key: "initSubscribe",
  73306. value: function initSubscribe() {
  73307. this.dataFlow.initSubscribe();
  73308. return this;
  73309. }
  73310. /**
  73311. * @function mapboxgl.supermap.DataFlowService.prototype.setExcludeField
  73312. * @description 设置排除字段。
  73313. * @param {Object} excludeField - 排除字段。
  73314. */
  73315. }, {
  73316. key: "setExcludeField",
  73317. value: function setExcludeField(excludeField) {
  73318. this.dataFlow.setExcludeField(excludeField);
  73319. this.options.excludeField = excludeField;
  73320. return this;
  73321. }
  73322. /**
  73323. * @function mapboxgl.supermap.DataFlowService.prototype.setGeometry
  73324. * @description 设置添加的几何要素数据。
  73325. * @param {GeoJSONObject} geometry - 指定几何范围,该范围内的要素才能被订阅。
  73326. */
  73327. }, {
  73328. key: "setGeometry",
  73329. value: function setGeometry(geometry) {
  73330. this.dataFlow.setGeometry(geometry);
  73331. this.options.geometry = geometry;
  73332. return this;
  73333. }
  73334. /**
  73335. * @function mapboxgl.supermap.DataFlowService.prototype.unSubscribe
  73336. * @description 结束订阅数据。
  73337. */
  73338. }, {
  73339. key: "unSubscribe",
  73340. value: function unSubscribe() {
  73341. this.dataFlow.unSubscribe();
  73342. }
  73343. /**
  73344. * @function mapboxgl.supermap.DataFlowService.prototype.unBroadcast
  73345. * @description 结束加载广播。
  73346. */
  73347. }, {
  73348. key: "unBroadcast",
  73349. value: function unBroadcast() {
  73350. this.dataFlow.unBroadcast();
  73351. }
  73352. }, {
  73353. key: "_defaultEvent",
  73354. value: function _defaultEvent(e) {
  73355. this.fire(e.eventType || e.type, e);
  73356. }
  73357. }]);
  73358. return DataFlowService;
  73359. }(ServiceBase);
  73360. (external_mapboxgl_default()).supermap.DataFlowService = DataFlowService;
  73361. ;// CONCATENATED MODULE: ./src/mapboxgl/services/FeatureService.js
  73362. function FeatureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FeatureService_typeof = function _typeof(obj) { return typeof obj; }; } else { FeatureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FeatureService_typeof(obj); }
  73363. function FeatureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73364. 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); } }
  73365. function FeatureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FeatureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FeatureService_defineProperties(Constructor, staticProps); return Constructor; }
  73366. 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 } }); if (superClass) FeatureService_setPrototypeOf(subClass, superClass); }
  73367. function FeatureService_setPrototypeOf(o, p) { FeatureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FeatureService_setPrototypeOf(o, p); }
  73368. 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); }; }
  73369. function FeatureService_possibleConstructorReturn(self, call) { if (call && (FeatureService_typeof(call) === "object" || typeof call === "function")) { return call; } return FeatureService_assertThisInitialized(self); }
  73370. function FeatureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73371. function FeatureService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73372. function FeatureService_getPrototypeOf(o) { FeatureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FeatureService_getPrototypeOf(o); }
  73373. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  73374. * This program are made available under the terms of the Apache License, Version 2.0
  73375. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73376. /**
  73377. * @class mapboxgl.supermap.FeatureService
  73378. * @category iServer Data Feature
  73379. * @classdesc 要素数据集类。提供:ID 查询,范围查询,SQL 查询,几何查询,bounds 查询,缓冲区查询,地物编辑。
  73380. * @example
  73381. * new mapboxgl.supermap.FeatureService(url)
  73382. * .getFeaturesByIDs(param,function(result){
  73383. * //doSomething
  73384. * })
  73385. * @extends {mapboxgl.supermap.ServiceBase}
  73386. * @param {string} url - 要素数据集服务地址。
  73387. * @param {Object} options - 创建要素数据集服务类可选参数。
  73388. * @param {string} [options.proxy] - 服务代理地址。
  73389. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73390. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73391. * @param {Object} [options.headers] - 请求头。
  73392. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73393. */
  73394. var FeatureService = /*#__PURE__*/function (_ServiceBase) {
  73395. FeatureService_inherits(FeatureService, _ServiceBase);
  73396. var _super = FeatureService_createSuper(FeatureService);
  73397. function FeatureService(url, options) {
  73398. FeatureService_classCallCheck(this, FeatureService);
  73399. return _super.call(this, url, options);
  73400. }
  73401. /**
  73402. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByIDs
  73403. * @description 数据集 ID 查询服务。
  73404. * @param {SuperMap.GetFeaturesByIDsParameters} params - 查询所需参数类。
  73405. * @param {RequestCallback} callback - 回调函数。
  73406. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73407. */
  73408. FeatureService_createClass(FeatureService, [{
  73409. key: "getFeaturesByIDs",
  73410. value: function getFeaturesByIDs(params, callback, resultFormat) {
  73411. var me = this;
  73412. var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, {
  73413. proxy: me.options.proxy,
  73414. withCredentials: me.options.withCredentials,
  73415. crossOrigin: me.options.crossOrigin,
  73416. headers: me.options.headers,
  73417. serverType: me.options.serverType,
  73418. eventListeners: {
  73419. processCompleted: callback,
  73420. processFailed: callback
  73421. },
  73422. format: me._processFormat(resultFormat)
  73423. });
  73424. getFeaturesByIDsService.processAsync(me._processParams(params));
  73425. }
  73426. /**
  73427. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBounds
  73428. * @description 数据集 Bounds 查询服务。
  73429. * @param {SuperMap.GetFeaturesByBoundsParameters} params - 查询所需参数类。
  73430. * @param {RequestCallback} callback - 回调函数。
  73431. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73432. */
  73433. }, {
  73434. key: "getFeaturesByBounds",
  73435. value: function getFeaturesByBounds(params, callback, resultFormat) {
  73436. var me = this;
  73437. var getFeaturesByBoundsService = new GetFeaturesByBoundsService(me.url, {
  73438. proxy: me.options.proxy,
  73439. withCredentials: me.options.withCredentials,
  73440. crossOrigin: me.options.crossOrigin,
  73441. headers: me.options.headers,
  73442. serverType: me.options.serverType,
  73443. eventListeners: {
  73444. processCompleted: callback,
  73445. processFailed: callback
  73446. },
  73447. format: me._processFormat(resultFormat)
  73448. });
  73449. getFeaturesByBoundsService.processAsync(me._processParams(params));
  73450. }
  73451. /**
  73452. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByBuffer
  73453. * @description 数据集 Buffer 查询服务。
  73454. * @param {SuperMap.GetFeaturesByBufferParameters} params - 查询所需参数类。
  73455. * @param {RequestCallback} callback 回调函数。
  73456. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73457. */
  73458. }, {
  73459. key: "getFeaturesByBuffer",
  73460. value: function getFeaturesByBuffer(params, callback, resultFormat) {
  73461. var me = this;
  73462. var getFeatureService = new GetFeaturesByBufferService(me.url, {
  73463. proxy: me.options.proxy,
  73464. withCredentials: me.options.withCredentials,
  73465. crossOrigin: me.options.crossOrigin,
  73466. headers: me.options.headers,
  73467. serverType: me.options.serverType,
  73468. eventListeners: {
  73469. processCompleted: callback,
  73470. processFailed: callback
  73471. },
  73472. format: me._processFormat(resultFormat)
  73473. });
  73474. getFeatureService.processAsync(me._processParams(params));
  73475. }
  73476. /**
  73477. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesBySQL
  73478. * @description 数据集 SQL 查询服务。
  73479. * @param {SuperMap.GetFeaturesBySQLParameters} params - 查询所需参数类。
  73480. * @param {RequestCallback} callback 回调函数。
  73481. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的数据格式。
  73482. */
  73483. }, {
  73484. key: "getFeaturesBySQL",
  73485. value: function getFeaturesBySQL(params, callback, resultFormat) {
  73486. var me = this;
  73487. var getFeatureBySQLService = new GetFeaturesBySQLService(me.url, {
  73488. proxy: me.options.proxy,
  73489. withCredentials: me.options.withCredentials,
  73490. crossOrigin: me.options.crossOrigin,
  73491. headers: me.options.headers,
  73492. serverType: me.options.serverType,
  73493. eventListeners: {
  73494. processCompleted: callback,
  73495. processFailed: callback
  73496. },
  73497. format: me._processFormat(resultFormat)
  73498. });
  73499. getFeatureBySQLService.processAsync(me._processParams(params));
  73500. }
  73501. /**
  73502. * @function mapboxgl.supermap.FeatureService.prototype.getFeaturesByGeometry
  73503. * @description 数据集几何查询服务类。
  73504. * @param {SuperMap.GetFeaturesByGeometryParameters} params - 查询所需参数类。
  73505. * @param {RequestCallback} callback - 回调函数。
  73506. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的数据格式。
  73507. */
  73508. }, {
  73509. key: "getFeaturesByGeometry",
  73510. value: function getFeaturesByGeometry(params, callback, resultFormat) {
  73511. var me = this;
  73512. var getFeaturesByGeometryService = new GetFeaturesByGeometryService(me.url, {
  73513. proxy: me.options.proxy,
  73514. withCredentials: me.options.withCredentials,
  73515. crossOrigin: me.options.crossOrigin,
  73516. headers: me.options.headers,
  73517. serverType: me.options.serverType,
  73518. eventListeners: {
  73519. processCompleted: callback,
  73520. processFailed: callback
  73521. },
  73522. format: me._processFormat(resultFormat)
  73523. });
  73524. getFeaturesByGeometryService.processAsync(me._processParams(params));
  73525. }
  73526. /**
  73527. * @function mapboxgl.supermap.FeatureService.prototype.editFeatures
  73528. * @description 地物编辑服务。
  73529. * @param {SuperMap.EditFeaturesParameters} params - 查询所需参数类。
  73530. * @param {RequestCallback} callback 回调函数。
  73531. */
  73532. }, {
  73533. key: "editFeatures",
  73534. value: function editFeatures(params, callback) {
  73535. if (!params || !params.dataSourceName || !params.dataSetName) {
  73536. return;
  73537. }
  73538. var me = this,
  73539. url = me.url,
  73540. dataSourceName = params.dataSourceName,
  73541. dataSetName = params.dataSetName;
  73542. url = Util.urlPathAppend(url, "datasources/" + dataSourceName + "/datasets/" + dataSetName);
  73543. var editFeatureService = new EditFeaturesService(url, {
  73544. proxy: me.options.proxy,
  73545. withCredentials: me.options.withCredentials,
  73546. crossOrigin: me.options.crossOrigin,
  73547. headers: me.options.headers,
  73548. serverType: me.options.serverType,
  73549. eventListeners: {
  73550. processCompleted: callback,
  73551. processFailed: callback
  73552. }
  73553. });
  73554. editFeatureService.processAsync(me._processParams(params));
  73555. }
  73556. /**
  73557. * @private
  73558. * @description 参数类型转换。
  73559. * @param {Object} params - 服务参数 。
  73560. * @returns {Object} params - 转换后的对接 SuperMap 服务的参数。
  73561. */
  73562. }, {
  73563. key: "_processParams",
  73564. value: function _processParams(params) {
  73565. if (!params) {
  73566. return {};
  73567. }
  73568. var me = this;
  73569. params.returnContent = params.returnContent == null ? true : params.returnContent;
  73570. params.fromIndex = params.fromIndex ? params.fromIndex : 0;
  73571. params.toIndex = params.toIndex === 0 ? 0 : params.toIndex ? params.toIndex : -1;
  73572. if (params.bounds) {
  73573. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  73574. }
  73575. if (params.editType) {
  73576. params.editType = params.editType.toLowerCase();
  73577. } //mapboxgl geojson要素对象转 SuperMap Geometry 对象
  73578. if (params.geometry) {
  73579. if (params.geometry instanceof (external_mapboxgl_default()).LngLatBounds) {
  73580. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  73581. } else {
  73582. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  73583. }
  73584. } //editFeature服务参数转换,传入单独得对象或对象数组
  73585. if (params.features) {
  73586. var features = [];
  73587. if (core_Util_Util.isArray(params.features)) {
  73588. params.features.map(function (feature) {
  73589. features.push(me._createServerFeature(feature));
  73590. return features;
  73591. });
  73592. } else {
  73593. features.push(me._createServerFeature(params.features));
  73594. }
  73595. params.features = features;
  73596. }
  73597. return params;
  73598. } //geoFeature严格按照 mapboxgl geojson的结构
  73599. }, {
  73600. key: "_createServerFeature",
  73601. value: function _createServerFeature(geoFeature) {
  73602. var feature = {},
  73603. fieldNames = [],
  73604. fieldValues = [];
  73605. var properties = geoFeature.properties;
  73606. for (var key in properties) {
  73607. fieldNames.push(key);
  73608. fieldValues.push(properties[key]);
  73609. }
  73610. feature.fieldNames = fieldNames;
  73611. feature.fieldValues = fieldValues;
  73612. if (geoFeature.id) {
  73613. feature.id = geoFeature.id;
  73614. }
  73615. feature.geometry = core_Util_Util.toSuperMapGeometry(geoFeature);
  73616. return feature;
  73617. }
  73618. }, {
  73619. key: "_processFormat",
  73620. value: function _processFormat(resultFormat) {
  73621. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  73622. }
  73623. }]);
  73624. return FeatureService;
  73625. }(ServiceBase);
  73626. (external_mapboxgl_default()).supermap.FeatureService = FeatureService;
  73627. ;// CONCATENATED MODULE: ./src/mapboxgl/services/FieldService.js
  73628. function FieldService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FieldService_typeof = function _typeof(obj) { return typeof obj; }; } else { FieldService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FieldService_typeof(obj); }
  73629. function FieldService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73630. 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); } }
  73631. function FieldService_createClass(Constructor, protoProps, staticProps) { if (protoProps) FieldService_defineProperties(Constructor.prototype, protoProps); if (staticProps) FieldService_defineProperties(Constructor, staticProps); return Constructor; }
  73632. 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 } }); if (superClass) FieldService_setPrototypeOf(subClass, superClass); }
  73633. function FieldService_setPrototypeOf(o, p) { FieldService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return FieldService_setPrototypeOf(o, p); }
  73634. 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); }; }
  73635. function FieldService_possibleConstructorReturn(self, call) { if (call && (FieldService_typeof(call) === "object" || typeof call === "function")) { return call; } return FieldService_assertThisInitialized(self); }
  73636. function FieldService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73637. function FieldService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73638. function FieldService_getPrototypeOf(o) { FieldService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FieldService_getPrototypeOf(o); }
  73639. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  73640. * This program are made available under the terms of the Apache License, Version 2.0
  73641. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73642. /**
  73643. * @class mapboxgl.supermap.FieldService
  73644. * @category iServer Data Field
  73645. * @classdesc 字段服务类。
  73646. * @example
  73647. * new mapboxgl.supermap.FieldService(url).getFields(function(result){
  73648. * //doSomething
  73649. * });
  73650. * @param {string} url - 与客户端交互的服务地址。
  73651. * @param {Object} options - 参数。
  73652. * @param {string} [options.proxy] - 服务代理地址。
  73653. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73654. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73655. * @param {Object} [options.headers] - 请求头。
  73656. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73657. * @extends {mapboxgl.supermap.ServiceBase}
  73658. */
  73659. var FieldService = /*#__PURE__*/function (_ServiceBase) {
  73660. FieldService_inherits(FieldService, _ServiceBase);
  73661. var _super = FieldService_createSuper(FieldService);
  73662. function FieldService(url, options) {
  73663. FieldService_classCallCheck(this, FieldService);
  73664. return _super.call(this, url, options);
  73665. }
  73666. /**
  73667. * @function mapboxgl.supermap.FieldService.prototype.getFields
  73668. * @description 字段查询服务。
  73669. * @param {SuperMap.FieldParameters} params - 字段信息查询参数类。
  73670. * @param {RequestCallback} callback 回调函数。
  73671. */
  73672. FieldService_createClass(FieldService, [{
  73673. key: "getFields",
  73674. value: function getFields(params, callback) {
  73675. var me = this;
  73676. var getFieldsService = new GetFieldsService(me.url, {
  73677. proxy: me.options.proxy,
  73678. withCredentials: me.options.withCredentials,
  73679. crossOrigin: me.options.crossOrigin,
  73680. headers: me.options.headers,
  73681. serverType: me.options.serverType,
  73682. eventListeners: {
  73683. scope: me,
  73684. processCompleted: callback,
  73685. processFailed: callback
  73686. },
  73687. datasource: params.datasource,
  73688. dataset: params.dataset
  73689. });
  73690. getFieldsService.processAsync();
  73691. }
  73692. /**
  73693. * @function mapboxgl.supermap.FieldService.prototype.getFieldStatisticsInfo
  73694. * @description 字段统计服务。
  73695. * @param {SuperMap.FieldStatisticsParameters} params - 查询所需参数类。
  73696. * @param {RequestCallback} callback 回调函数。
  73697. */
  73698. }, {
  73699. key: "getFieldStatisticsInfo",
  73700. value: function getFieldStatisticsInfo(params, callback) {
  73701. var me = this,
  73702. fieldName = params.fieldName,
  73703. modes = params.statisticMode;
  73704. if (modes && !core_Util_Util.isArray(modes)) {
  73705. modes = [modes];
  73706. }
  73707. me.currentStatisticResult = {
  73708. fieldName: fieldName
  73709. };
  73710. me._statisticsCallback = callback; //针对每种统计方式分别进行请求
  73711. modes.forEach(function (mode) {
  73712. me.currentStatisticResult[mode] = null;
  73713. me._fieldStatisticRequest(params.datasource, params.dataset, fieldName, mode);
  73714. });
  73715. }
  73716. }, {
  73717. key: "_fieldStatisticRequest",
  73718. value: function _fieldStatisticRequest(datasource, dataset, fieldName, statisticMode) {
  73719. var me = this;
  73720. var statisticService = new FieldStatisticService(me.url, {
  73721. eventListeners: {
  73722. scope: me,
  73723. processCompleted: me._processCompleted,
  73724. processFailed: me._statisticsCallback
  73725. },
  73726. datasource: datasource,
  73727. dataset: dataset,
  73728. field: fieldName,
  73729. statisticMode: statisticMode,
  73730. crossOrigin: me.options.crossOrigin,
  73731. headers: me.options.headers
  73732. });
  73733. statisticService.processAsync();
  73734. }
  73735. }, {
  73736. key: "_processCompleted",
  73737. value: function _processCompleted(fieldStatisticResult) {
  73738. var me = this;
  73739. var getAll = true,
  73740. result = fieldStatisticResult.result;
  73741. if (this.currentStatisticResult) {
  73742. if (null == me.currentStatisticResult[result.mode]) {
  73743. this.currentStatisticResult[result.mode] = result.result;
  73744. }
  73745. }
  73746. for (var mode in me.currentStatisticResult) {
  73747. if (null == me.currentStatisticResult[mode]) {
  73748. getAll = false;
  73749. break;
  73750. }
  73751. }
  73752. if (getAll) {
  73753. me._statisticsCallback({
  73754. result: me.currentStatisticResult
  73755. });
  73756. }
  73757. }
  73758. }]);
  73759. return FieldService;
  73760. }(ServiceBase);
  73761. (external_mapboxgl_default()).supermap.FieldService = FieldService;
  73762. ;// CONCATENATED MODULE: ./src/mapboxgl/services/GridCellInfosService.js
  73763. function GridCellInfosService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { GridCellInfosService_typeof = function _typeof(obj) { return typeof obj; }; } else { GridCellInfosService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return GridCellInfosService_typeof(obj); }
  73764. function GridCellInfosService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73765. 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); } }
  73766. function GridCellInfosService_createClass(Constructor, protoProps, staticProps) { if (protoProps) GridCellInfosService_defineProperties(Constructor.prototype, protoProps); if (staticProps) GridCellInfosService_defineProperties(Constructor, staticProps); return Constructor; }
  73767. 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 } }); if (superClass) GridCellInfosService_setPrototypeOf(subClass, superClass); }
  73768. function GridCellInfosService_setPrototypeOf(o, p) { GridCellInfosService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return GridCellInfosService_setPrototypeOf(o, p); }
  73769. 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); }; }
  73770. function GridCellInfosService_possibleConstructorReturn(self, call) { if (call && (GridCellInfosService_typeof(call) === "object" || typeof call === "function")) { return call; } return GridCellInfosService_assertThisInitialized(self); }
  73771. function GridCellInfosService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73772. function GridCellInfosService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73773. function GridCellInfosService_getPrototypeOf(o) { GridCellInfosService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return GridCellInfosService_getPrototypeOf(o); }
  73774. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  73775. * This program are made available under the terms of the Apache License, Version 2.0
  73776. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  73777. /**
  73778. * @class mapboxgl.supermap.GridCellInfosService
  73779. * @category iServer Data Grid
  73780. * @classdesc 数据栅格查询服务。
  73781. * @extends {mapboxgl.supermap.ServiceBase}
  73782. * @example
  73783. * new mapboxgl.supermap.GridCellInfosService(url)
  73784. * .getGridCellInfos(param,function(result){
  73785. * //doSomething
  73786. * })
  73787. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:</br>
  73788. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  73789. * @param {Object} options - 服务所需可选参数。
  73790. * @param {string} [options.proxy] - 服务代理地址。
  73791. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  73792. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  73793. * @param {Object} [options.headers] - 请求头。
  73794. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  73795. */
  73796. var GridCellInfosService = /*#__PURE__*/function (_ServiceBase) {
  73797. GridCellInfosService_inherits(GridCellInfosService, _ServiceBase);
  73798. var _super = GridCellInfosService_createSuper(GridCellInfosService);
  73799. function GridCellInfosService(url, options) {
  73800. GridCellInfosService_classCallCheck(this, GridCellInfosService);
  73801. return _super.call(this, url, options);
  73802. }
  73803. /**
  73804. * @function mapboxgl.supermap.GridCellInfosService.prototype.getGridCellInfos
  73805. * @param {SuperMap.GetGridCellInfosParameters} params - 查询所需参数类。
  73806. * @param {RequestCallback} callback 回调函数。
  73807. */
  73808. GridCellInfosService_createClass(GridCellInfosService, [{
  73809. key: "getGridCellInfos",
  73810. value: function getGridCellInfos(params, callback) {
  73811. if (!params) {
  73812. return null;
  73813. }
  73814. var me = this;
  73815. var gridCellQueryService = new GetGridCellInfosService(me.url, {
  73816. proxy: me.options.proxy,
  73817. withCredentials: me.options.withCredentials,
  73818. crossOrigin: me.options.crossOrigin,
  73819. headers: me.options.headers,
  73820. serverType: me.options.serverType,
  73821. eventListeners: {
  73822. scope: me,
  73823. processCompleted: callback,
  73824. processFailed: callback
  73825. }
  73826. });
  73827. gridCellQueryService.processAsync(params);
  73828. }
  73829. }]);
  73830. return GridCellInfosService;
  73831. }(ServiceBase);
  73832. (external_mapboxgl_default()).supermap.GridCellInfosService = GridCellInfosService;
  73833. ;// CONCATENATED MODULE: ./src/mapboxgl/services/GeoprocessingService.js
  73834. function services_GeoprocessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_GeoprocessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_GeoprocessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_GeoprocessingService_typeof(obj); }
  73835. function services_GeoprocessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  73836. 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); } }
  73837. function services_GeoprocessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_GeoprocessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_GeoprocessingService_defineProperties(Constructor, staticProps); return Constructor; }
  73838. 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 } }); if (superClass) services_GeoprocessingService_setPrototypeOf(subClass, superClass); }
  73839. function services_GeoprocessingService_setPrototypeOf(o, p) { services_GeoprocessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_GeoprocessingService_setPrototypeOf(o, p); }
  73840. 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); }; }
  73841. function services_GeoprocessingService_possibleConstructorReturn(self, call) { if (call && (services_GeoprocessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_GeoprocessingService_assertThisInitialized(self); }
  73842. function services_GeoprocessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  73843. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  73844. function services_GeoprocessingService_getPrototypeOf(o) { services_GeoprocessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_GeoprocessingService_getPrototypeOf(o); }
  73845. /**
  73846. * @class mapboxgl.supermap.GeoprocessingService
  73847. * @classdesc 地理处理服务接口类。
  73848. * @version 10.1.0
  73849. * @category iServer GeoprocessingService
  73850. * @extends {mapboxgl.supermap.ServiceBase}
  73851. * @example
  73852. * //为了安全访问受保护的地理处理服务,必须通过传递iserver令牌(token),才能正确访问相关资源。
  73853. * SuperMap.SecurityManager.registerToken(serviceUrl, token);
  73854. * var geoprocessingService = new L.supermap.geoprocessingService("http://localhost:8090/iserver/services/geoprocessing/restjsr/gp/v2")
  73855. geoprocessingService.submitJob(identifier,params, environments, function(serverResult) {
  73856. console.log(serverResult.result);
  73857. var jobID = serverResult.result.jobID;
  73858. var options = {
  73859. interval: 5000,
  73860. statusCallback: function(state) {
  73861. console.log("Job Status: ", state);
  73862. }
  73863. };
  73864. geoprocessingService.waitForJobCompletion(jobID, identifier, options, function(serverResult) {
  73865. console.log(serverResult);
  73866. })
  73867. })
  73868. * @param {string} url - 服务地址。
  73869. * @param {Object} options - 参数。
  73870. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 iServer|iPortal|online。
  73871. */
  73872. var GeoprocessingService = /*#__PURE__*/function (_ServiceBase) {
  73873. services_GeoprocessingService_inherits(GeoprocessingService, _ServiceBase);
  73874. var _super = services_GeoprocessingService_createSuper(GeoprocessingService);
  73875. function GeoprocessingService(url, options) {
  73876. var _this;
  73877. services_GeoprocessingService_classCallCheck(this, GeoprocessingService);
  73878. _this = _super.call(this, url, options);
  73879. _this.headers = {};
  73880. _this.crossOrigin = true;
  73881. _this.withCredentials = true;
  73882. _this.proxy = true;
  73883. return _this;
  73884. }
  73885. /**
  73886. * @function mapboxgl.supermap.GeoprocessingService.prototype.getTools
  73887. * @description 获取地理处理工具列表。
  73888. * @param {RequestCallback} callback 请求结果的回调函数。
  73889. */
  73890. services_GeoprocessingService_createClass(GeoprocessingService, [{
  73891. key: "getTools",
  73892. value: function getTools(callback) {
  73893. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73894. proxy: this.options.proxy,
  73895. withCredentials: this.options.withCredentials,
  73896. crossOrigin: this.options.crossOrigin,
  73897. headers: this.options.headers,
  73898. serverType: this.options.serverType,
  73899. eventListeners: {
  73900. scope: this,
  73901. processCompleted: callback,
  73902. processFailed: callback
  73903. }
  73904. });
  73905. geoprocessingJobsService.getTools();
  73906. }
  73907. /**
  73908. * @function mapboxgl.supermap.GeoprocessingService.prototype.getTool
  73909. * @description 获取地理处理工具的ID、名称、描述、输入参数、环境参数和输出结果等相关参数。
  73910. * @param {string} identifier - 地理处理工具ID。
  73911. * @param {RequestCallback} callback 请求结果的回调函数。
  73912. */
  73913. }, {
  73914. key: "getTool",
  73915. value: function getTool(identifier, callback) {
  73916. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73917. proxy: this.options.proxy,
  73918. withCredentials: this.options.withCredentials,
  73919. crossOrigin: this.options.crossOrigin,
  73920. headers: this.options.headers,
  73921. serverType: this.options.serverType,
  73922. eventListeners: {
  73923. scope: this,
  73924. processCompleted: callback,
  73925. processFailed: callback
  73926. }
  73927. });
  73928. geoprocessingJobsService.getTool(identifier);
  73929. }
  73930. /**
  73931. * @function mapboxgl.supermap.GeoprocessingService.prototype.execute
  73932. * @description 同步执行地理处理工具。
  73933. * @param {string} identifier - 地理处理工具ID。
  73934. * @param {Object} parameter - 地理处理工具的输入参数。
  73935. * @param {Object} environment - 地理处理工具的环境参数。
  73936. * @param {RequestCallback} callback 回调函数。
  73937. */
  73938. }, {
  73939. key: "execute",
  73940. value: function execute(identifier, parameter, environment, callback) {
  73941. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73942. proxy: this.options.proxy,
  73943. withCredentials: this.options.withCredentials,
  73944. crossOrigin: this.options.crossOrigin,
  73945. headers: this.options.headers,
  73946. serverType: this.options.serverType,
  73947. eventListeners: {
  73948. scope: this,
  73949. processCompleted: callback,
  73950. processFailed: callback
  73951. }
  73952. });
  73953. geoprocessingJobsService.execute(identifier, parameter, environment);
  73954. }
  73955. /**
  73956. * @function mapboxgl.supermap.GeoprocessingService.prototype.submitJob
  73957. * @description 异步执行地理处理工具。
  73958. * @param {string} identifier - 地理处理工具ID。
  73959. * @param {Object} parameter - 地理处理工具的输入参数。
  73960. * @param {Object} environment - 地理处理工具的环境参数。
  73961. * @param {RequestCallback} callback 回调函数。
  73962. */
  73963. }, {
  73964. key: "submitJob",
  73965. value: function submitJob(identifier, parameter, environment, callback) {
  73966. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73967. proxy: this.options.proxy,
  73968. withCredentials: this.options.withCredentials,
  73969. crossOrigin: this.options.crossOrigin,
  73970. headers: this.options.headers,
  73971. serverType: this.options.serverType,
  73972. eventListeners: {
  73973. scope: this,
  73974. processCompleted: callback,
  73975. processFailed: callback
  73976. }
  73977. });
  73978. geoprocessingJobsService.submitJob(identifier, parameter, environment);
  73979. }
  73980. /**
  73981. * @function mapboxgl.supermap.GeoprocessingService.prototype.waitForJobCompletion
  73982. * @description 获取地理处理异步执行状态信息。
  73983. * @param {string} jobId - 地理处理任务ID。
  73984. * @param {string} identifier - 地理处理工具ID。
  73985. * @param {Object} options - 状态信息参数。
  73986. * @param {number} options.interval - 定时器时间间隔。
  73987. * @param {Callback} options.statusCallback - 任务状态的回调函数。
  73988. * @param {RequestCallback} callback 回调函数。
  73989. */
  73990. }, {
  73991. key: "waitForJobCompletion",
  73992. value: function waitForJobCompletion(jobId, identifier, options, callback) {
  73993. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  73994. proxy: this.options.proxy,
  73995. withCredentials: this.options.withCredentials,
  73996. crossOrigin: this.options.crossOrigin,
  73997. headers: this.options.headers,
  73998. serverType: this.options.serverType,
  73999. eventListeners: {
  74000. scope: this,
  74001. processCompleted: callback,
  74002. processFailed: callback
  74003. }
  74004. });
  74005. geoprocessingJobsService.waitForJobCompletion(jobId, identifier, options);
  74006. }
  74007. /**
  74008. * @function mapboxgl.supermap.GeoprocessingService.prototype.getJobInfo
  74009. * @description 获取地理处理任务的执行信息。
  74010. * @param {string} identifier - 地理处理工具ID。
  74011. * @param {string} jobId - 地理处理任务ID。
  74012. * @param {RequestCallback} callback 回调函数。
  74013. */
  74014. }, {
  74015. key: "getJobInfo",
  74016. value: function getJobInfo(identifier, jobId, callback) {
  74017. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  74018. proxy: this.options.proxy,
  74019. withCredentials: this.options.withCredentials,
  74020. crossOrigin: this.options.crossOrigin,
  74021. headers: this.options.headers,
  74022. serverType: this.options.serverType,
  74023. eventListeners: {
  74024. scope: this,
  74025. processCompleted: callback,
  74026. processFailed: callback
  74027. }
  74028. });
  74029. geoprocessingJobsService.getJobInfo(identifier, jobId);
  74030. }
  74031. /**
  74032. * @function mapboxgl.supermap.GeoprocessingService.prototype.cancelJob
  74033. * @description 取消地理处理任务的异步执行。
  74034. * @param {string} identifier - 地理处理工具ID。
  74035. * @param {string} jobId - 地理处理任务ID。
  74036. * @param {RequestCallback} callback 回调函数。
  74037. */
  74038. }, {
  74039. key: "cancelJob",
  74040. value: function cancelJob(identifier, jobId, callback) {
  74041. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  74042. proxy: this.options.proxy,
  74043. withCredentials: this.options.withCredentials,
  74044. crossOrigin: this.options.crossOrigin,
  74045. headers: this.options.headers,
  74046. serverType: this.options.serverType,
  74047. eventListeners: {
  74048. scope: this,
  74049. processCompleted: callback,
  74050. processFailed: callback
  74051. }
  74052. });
  74053. geoprocessingJobsService.cancelJob(identifier, jobId);
  74054. }
  74055. /**
  74056. * @function mapboxgl.supermap.GeoprocessingService.prototype.getJobs
  74057. * @description 获取地理处理服务任务列表。
  74058. * @param {string} identifier - 地理处理工具ID。(可选,传参代表identifier算子的任务列表,不传参代表所有任务的列表)
  74059. * @param {RequestCallback} callback 回调函数。
  74060. */
  74061. }, {
  74062. key: "getJobs",
  74063. value: function getJobs(identifier, callback) {
  74064. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  74065. proxy: this.options.proxy,
  74066. withCredentials: this.options.withCredentials,
  74067. crossOrigin: this.options.crossOrigin,
  74068. headers: this.options.headers,
  74069. serverType: this.options.serverType,
  74070. eventListeners: {
  74071. scope: this,
  74072. processCompleted: callback,
  74073. processFailed: callback
  74074. }
  74075. });
  74076. geoprocessingJobsService.getJobs(identifier);
  74077. }
  74078. /**
  74079. * @function mapboxgl.supermap.GeoprocessingService.prototype.getResults
  74080. * @description 地理处理工具异步执行的结果,支持结果过滤。
  74081. * @param {string} identifier - 地理处理工具ID。
  74082. * @param {string} jobId - 地理处理任务ID。
  74083. * @param {string} filter - 输出异步结果的id。(可选,传入filter参数时对该地理处理工具执行的结果进行过滤获取,不填参时显示所有的执行结果)
  74084. * @param {RequestCallback} callback 请求结果的回调函数。
  74085. */
  74086. }, {
  74087. key: "getResults",
  74088. value: function getResults(identifier, jobId, filter, callback) {
  74089. var geoprocessingJobsService = new GeoprocessingService_GeoprocessingService(this.url, {
  74090. proxy: this.options.proxy,
  74091. withCredentials: this.options.withCredentials,
  74092. crossOrigin: this.options.crossOrigin,
  74093. headers: this.options.headers,
  74094. serverType: this.options.serverType,
  74095. eventListeners: {
  74096. scope: this,
  74097. processCompleted: callback,
  74098. processFailed: callback
  74099. }
  74100. });
  74101. geoprocessingJobsService.getResults(identifier, jobId, filter);
  74102. }
  74103. }]);
  74104. return GeoprocessingService;
  74105. }(ServiceBase);
  74106. (external_mapboxgl_default()).supermap.GeoprocessingService = GeoprocessingService;
  74107. ;// CONCATENATED MODULE: ./src/mapboxgl/services/LayerInfoService.js
  74108. function LayerInfoService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { LayerInfoService_typeof = function _typeof(obj) { return typeof obj; }; } else { LayerInfoService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return LayerInfoService_typeof(obj); }
  74109. function LayerInfoService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74110. 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); } }
  74111. function LayerInfoService_createClass(Constructor, protoProps, staticProps) { if (protoProps) LayerInfoService_defineProperties(Constructor.prototype, protoProps); if (staticProps) LayerInfoService_defineProperties(Constructor, staticProps); return Constructor; }
  74112. 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 } }); if (superClass) LayerInfoService_setPrototypeOf(subClass, superClass); }
  74113. function LayerInfoService_setPrototypeOf(o, p) { LayerInfoService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return LayerInfoService_setPrototypeOf(o, p); }
  74114. 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); }; }
  74115. function LayerInfoService_possibleConstructorReturn(self, call) { if (call && (LayerInfoService_typeof(call) === "object" || typeof call === "function")) { return call; } return LayerInfoService_assertThisInitialized(self); }
  74116. function LayerInfoService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74117. function LayerInfoService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  74118. function LayerInfoService_getPrototypeOf(o) { LayerInfoService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return LayerInfoService_getPrototypeOf(o); }
  74119. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  74120. * This program are made available under the terms of the Apache License, Version 2.0
  74121. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74122. /**
  74123. * @class mapboxgl.supermap.LayerInfoService
  74124. * @category iServer Map Layer
  74125. * @classdesc 图层信息服务类 。
  74126. * @extends {mapboxgl.supermap.ServiceBase}
  74127. * @example
  74128. * new mapboxgl.supermap.LayerInfoService(url).getLayersInfo(function(result){
  74129. * //doSomething
  74130. * })
  74131. * @param {string} url - 与客户端交互的地图服务地址。请求地图服务,URL 应为:</br>
  74132. * http://{服务器地址}:{服务端口号}/iserver/services/{地图服务名}/rest/maps/{地图名}/tempLayersSet/{tempLayerID}/Rivers@World@@World"。
  74133. * @param {Object} options - 服务所需可选参数。
  74134. * @param {string} [options.proxy] - 服务代理地址。
  74135. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74136. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74137. * @param {Object} [options.headers] - 请求头。
  74138. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74139. */
  74140. var LayerInfoService = /*#__PURE__*/function (_ServiceBase) {
  74141. LayerInfoService_inherits(LayerInfoService, _ServiceBase);
  74142. var _super = LayerInfoService_createSuper(LayerInfoService);
  74143. function LayerInfoService(url, options) {
  74144. LayerInfoService_classCallCheck(this, LayerInfoService);
  74145. return _super.call(this, url, options);
  74146. }
  74147. /**
  74148. * @function mapboxgl.supermap.LayerInfoService.prototype.getLayersInfo
  74149. * @description 获取图层信息服务。
  74150. * @param {RequestCallback} callback - 回调函数。
  74151. * @returns {mapboxgl.supermap.LayerInfoService} 返回图层信息类。
  74152. */
  74153. LayerInfoService_createClass(LayerInfoService, [{
  74154. key: "getLayersInfo",
  74155. value: function getLayersInfo(callback) {
  74156. var me = this;
  74157. var getLayersInfoService = new GetLayersInfoService(me.url, {
  74158. proxy: me.options.proxy,
  74159. withCredentials: me.options.withCredentials,
  74160. crossOrigin: me.options.crossOrigin,
  74161. headers: me.options.headers,
  74162. serverType: me.options.serverType,
  74163. eventListeners: {
  74164. processCompleted: callback,
  74165. processFailed: callback
  74166. }
  74167. });
  74168. getLayersInfoService.processAsync();
  74169. }
  74170. /**
  74171. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayerInfo
  74172. * @description 设置图层信息服务。可以实现临时图层中子图层的修改。
  74173. * @param {SuperMap.SetLayerInfoParameters} params - 设置图层信息参数类。
  74174. * @param {RequestCallback} callback - 回调函数。
  74175. */
  74176. }, {
  74177. key: "setLayerInfo",
  74178. value: function setLayerInfo(params, callback) {
  74179. if (!params) {
  74180. return;
  74181. }
  74182. var me = this,
  74183. resourceID = params.resourceID,
  74184. tempLayerName = params.tempLayerName,
  74185. layerInfoParams = params.layerInfo;
  74186. if (!resourceID || !tempLayerName) {
  74187. return;
  74188. }
  74189. var url = Util.urlPathAppend(me.url, "tempLayersSet/" + resourceID + "/" + tempLayerName);
  74190. var setLayerInfoService = new SetLayerInfoService(url, {
  74191. proxy: me.options.proxy,
  74192. withCredentials: me.options.withCredentials,
  74193. crossOrigin: me.options.crossOrigin,
  74194. headers: me.options.headers,
  74195. serverType: me.options.serverType,
  74196. eventListeners: {
  74197. processCompleted: callback,
  74198. processFailed: callback
  74199. }
  74200. });
  74201. setLayerInfoService.processAsync(layerInfoParams);
  74202. }
  74203. /**
  74204. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayersInfo
  74205. * @description 设置图层信息服务。可以实现创建新的临时图层和对现有临时图层的修改。
  74206. * @param {SuperMap.SetLayersInfoParameters} params - 设置图层信息参数类,包括临时图层。
  74207. * @param {RequestCallback} callback - 回调函数。
  74208. */
  74209. }, {
  74210. key: "setLayersInfo",
  74211. value: function setLayersInfo(params, callback) {
  74212. if (!params) {
  74213. return;
  74214. }
  74215. var me = this,
  74216. resourceID = params.resourceID,
  74217. isTempLayers = params.isTempLayers ? params.isTempLayers : false,
  74218. layersInfo = params.layersInfo;
  74219. if (isTempLayers && !resourceID || !layersInfo) {
  74220. return;
  74221. }
  74222. var setLayersInfoService = new SetLayersInfoService(me.url, {
  74223. proxy: me.options.proxy,
  74224. withCredentials: me.options.withCredentials,
  74225. crossOrigin: me.options.crossOrigin,
  74226. headers: me.options.headers,
  74227. serverType: me.options.serverType,
  74228. eventListeners: {
  74229. processCompleted: callback,
  74230. processFailed: callback
  74231. },
  74232. resourceID: resourceID,
  74233. isTempLayers: isTempLayers
  74234. });
  74235. setLayersInfoService.processAsync(layersInfo);
  74236. }
  74237. /**
  74238. * @function mapboxgl.supermap.LayerInfoService.prototype.setLayerStatus
  74239. * @description 子图层显示控制服务。负责将子图层显示控制参数传递到服务端,并获取服务端返回的图层显示状态。
  74240. * @param {SuperMap.SetLayerStatusParameters} params - 子图层显示控制参数类。
  74241. * @param {RequestCallback} callback 回调函数。
  74242. */
  74243. }, {
  74244. key: "setLayerStatus",
  74245. value: function setLayerStatus(params, callback) {
  74246. if (!params) {
  74247. return;
  74248. }
  74249. var me = this;
  74250. var setLayerStatusService = new SetLayerStatusService(me.url, {
  74251. proxy: me.options.proxy,
  74252. withCredentials: me.options.withCredentials,
  74253. crossOrigin: me.options.crossOrigin,
  74254. headers: me.options.headers,
  74255. serverType: me.options.serverType,
  74256. eventListeners: {
  74257. processCompleted: callback,
  74258. processFailed: callback
  74259. }
  74260. });
  74261. setLayerStatusService.processAsync(params);
  74262. }
  74263. }]);
  74264. return LayerInfoService;
  74265. }(ServiceBase);
  74266. (external_mapboxgl_default()).supermap.LayerInfoService = LayerInfoService;
  74267. ;// CONCATENATED MODULE: ./src/mapboxgl/services/MapService.js
  74268. function services_MapService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_MapService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_MapService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_MapService_typeof(obj); }
  74269. function services_MapService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74270. 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); } }
  74271. function services_MapService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MapService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MapService_defineProperties(Constructor, staticProps); return Constructor; }
  74272. 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 } }); if (superClass) services_MapService_setPrototypeOf(subClass, superClass); }
  74273. function services_MapService_setPrototypeOf(o, p) { services_MapService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MapService_setPrototypeOf(o, p); }
  74274. 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); }; }
  74275. function services_MapService_possibleConstructorReturn(self, call) { if (call && (services_MapService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MapService_assertThisInitialized(self); }
  74276. function services_MapService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74277. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  74278. function services_MapService_getPrototypeOf(o) { services_MapService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MapService_getPrototypeOf(o); }
  74279. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  74280. * This program are made available under the terms of the Apache License, Version 2.0
  74281. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74282. /**
  74283. * @class mapboxgl.supermap.MapService
  74284. * @category iServer Map
  74285. * @classdesc 地图信息服务类。
  74286. * @extends {mapboxgl.supermap.ServiceBase}
  74287. * @param {string} url - 地图服务地址。
  74288. * @param {Object} options - 地图服务信息相关参数。
  74289. * @param {string} [options.proxy] - 服务代理地址。
  74290. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74291. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74292. * @param {Object} [options.headers] - 请求头。
  74293. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74294. * @example
  74295. * new mapboxgl.supermap.MapService(url)
  74296. * .getMapInfo(function(result){
  74297. * //doSomething
  74298. * })
  74299. */
  74300. var MapService = /*#__PURE__*/function (_ServiceBase) {
  74301. services_MapService_inherits(MapService, _ServiceBase);
  74302. var _super = services_MapService_createSuper(MapService);
  74303. function MapService(url, options) {
  74304. services_MapService_classCallCheck(this, MapService);
  74305. return _super.call(this, url, options);
  74306. }
  74307. /**
  74308. * @function mapboxgl.supermap.MapService.prototype.getMapInfo
  74309. * @description 地图信息查询服务。
  74310. * @param {RequestCallback} callback 回调函数。
  74311. * @returns {mapboxgl.supermap.MapService} 获取服务信息。
  74312. */
  74313. services_MapService_createClass(MapService, [{
  74314. key: "getMapInfo",
  74315. value: function getMapInfo(callback) {
  74316. var me = this;
  74317. var getMapStatusService = new MapService_MapService(me.url, {
  74318. proxy: me.options.proxy,
  74319. withCredentials: me.options.withCredentials,
  74320. crossOrigin: me.options.crossOrigin,
  74321. headers: me.options.headers,
  74322. serverType: me.options.serverType,
  74323. eventListeners: {
  74324. scope: me,
  74325. processCompleted: callback,
  74326. processFailed: callback
  74327. },
  74328. projection: me.options.projection
  74329. });
  74330. getMapStatusService.processAsync();
  74331. }
  74332. /**
  74333. * @function mapboxgl.supermap.MapService.prototype.getTilesets
  74334. * @description 切片列表信息查询服务。
  74335. * @param {RequestCallback} callback - 回调函数 。
  74336. * @returns {mapboxgl.supermap.MapService} 获取服务信息。
  74337. */
  74338. }, {
  74339. key: "getTilesets",
  74340. value: function getTilesets(callback) {
  74341. var me = this;
  74342. var tilesetsService = new TilesetsService(me.url, {
  74343. proxy: me.options.proxy,
  74344. withCredentials: me.options.withCredentials,
  74345. crossOrigin: me.options.crossOrigin,
  74346. headers: me.options.headers,
  74347. serverType: me.options.serverType,
  74348. eventListeners: {
  74349. scope: me,
  74350. processCompleted: callback,
  74351. processFailed: callback
  74352. }
  74353. });
  74354. tilesetsService.processAsync();
  74355. }
  74356. }]);
  74357. return MapService;
  74358. }(ServiceBase);
  74359. (external_mapboxgl_default()).supermap.MapService = MapService;
  74360. ;// CONCATENATED MODULE: ./src/mapboxgl/services/MeasureService.js
  74361. function services_MeasureService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_MeasureService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_MeasureService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_MeasureService_typeof(obj); }
  74362. function services_MeasureService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74363. 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); } }
  74364. function services_MeasureService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_MeasureService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_MeasureService_defineProperties(Constructor, staticProps); return Constructor; }
  74365. 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 } }); if (superClass) services_MeasureService_setPrototypeOf(subClass, superClass); }
  74366. function services_MeasureService_setPrototypeOf(o, p) { services_MeasureService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_MeasureService_setPrototypeOf(o, p); }
  74367. 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); }; }
  74368. function services_MeasureService_possibleConstructorReturn(self, call) { if (call && (services_MeasureService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_MeasureService_assertThisInitialized(self); }
  74369. function services_MeasureService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74370. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  74371. function services_MeasureService_getPrototypeOf(o) { services_MeasureService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_MeasureService_getPrototypeOf(o); }
  74372. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  74373. * This program are made available under the terms of the Apache License, Version 2.0
  74374. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74375. /**
  74376. * @class mapboxgl.supermap.MeasureService
  74377. * @category iServer Map Measure
  74378. * @classdesc 测量服务。
  74379. * @extends {mapboxgl.supermap.ServiceBase}
  74380. * @param {string} url - 服务访问的地址。如:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map。
  74381. * @param {Object} options - 交互服务时所需可选参数。
  74382. * @param {string} [options.proxy] - 服务代理地址。
  74383. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74384. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74385. * @param {Object} [options.headers] - 请求头。
  74386. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74387. * @param {SuperMap.MeasureMode} [options.measureMode=SuperMap.MeasureMode.DISTANCE] - 量算模式,包括距离量算模式和面积量算模式。
  74388. */
  74389. var MeasureService = /*#__PURE__*/function (_ServiceBase) {
  74390. services_MeasureService_inherits(MeasureService, _ServiceBase);
  74391. var _super = services_MeasureService_createSuper(MeasureService);
  74392. function MeasureService(url, options) {
  74393. services_MeasureService_classCallCheck(this, MeasureService);
  74394. return _super.call(this, url, options);
  74395. }
  74396. /**
  74397. * @function mapboxgl.supermap.MeasureService.prototype.measureDistance
  74398. * @description 距离测量。
  74399. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74400. * @param {RequestCallback} callback 回调函数。
  74401. */
  74402. services_MeasureService_createClass(MeasureService, [{
  74403. key: "measureDistance",
  74404. value: function measureDistance(params, callback) {
  74405. this.measure(params, 'DISTANCE', callback);
  74406. }
  74407. /**
  74408. * @function mapboxgl.supermap.MeasureService.prototype.measureArea
  74409. * @description 面积测量。
  74410. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74411. * @param {RequestCallback} callback 回调函数。
  74412. */
  74413. }, {
  74414. key: "measureArea",
  74415. value: function measureArea(params, callback) {
  74416. this.measure(params, 'AREA', callback);
  74417. }
  74418. /**
  74419. * @function mapboxgl.supermap.MeasureService.prototype.measure
  74420. * @description 测量。
  74421. * @param {SuperMap.MeasureParameters} params - 测量相关参数类。
  74422. * @param {string} type - 测量类型。
  74423. * @param {RequestCallback} callback - 回调函数。
  74424. * @returns {mapboxgl.supermap.MeasureService} 测量服务。
  74425. */
  74426. }, {
  74427. key: "measure",
  74428. value: function measure(params, type, callback) {
  74429. var me = this;
  74430. var measureService = new MeasureService_MeasureService(me.url, {
  74431. proxy: me.options.proxy,
  74432. withCredentials: me.options.withCredentials,
  74433. crossOrigin: me.options.crossOrigin,
  74434. headers: me.options.headers,
  74435. serverType: me.options.serverType,
  74436. measureMode: type,
  74437. eventListeners: {
  74438. scope: me,
  74439. processCompleted: callback,
  74440. processFailed: callback
  74441. }
  74442. });
  74443. measureService.processAsync(me._processParam(params));
  74444. }
  74445. }, {
  74446. key: "_processParam",
  74447. value: function _processParam(params) {
  74448. if (params && !(params.geometry instanceof Geometry)) {
  74449. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  74450. }
  74451. return params;
  74452. }
  74453. }]);
  74454. return MeasureService;
  74455. }(ServiceBase);
  74456. (external_mapboxgl_default()).supermap.MeasureService = MeasureService;
  74457. ;// CONCATENATED MODULE: ./src/mapboxgl/services/NetworkAnalystService.js
  74458. function NetworkAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalystService_typeof(obj); }
  74459. function NetworkAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74460. 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); } }
  74461. function NetworkAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  74462. 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 } }); if (superClass) NetworkAnalystService_setPrototypeOf(subClass, superClass); }
  74463. function NetworkAnalystService_setPrototypeOf(o, p) { NetworkAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalystService_setPrototypeOf(o, p); }
  74464. 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); }; }
  74465. function NetworkAnalystService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalystService_assertThisInitialized(self); }
  74466. function NetworkAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74467. function NetworkAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  74468. function NetworkAnalystService_getPrototypeOf(o) { NetworkAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalystService_getPrototypeOf(o); }
  74469. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  74470. * This program are made available under the terms of the Apache License, Version 2.0
  74471. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74472. /**
  74473. * @class mapboxgl.supermap.NetworkAnalystService
  74474. * @category iServer NetworkAnalyst
  74475. * @classdesc 网络分析服务类。
  74476. * @extends {mapboxgl.supermap.ServiceBase}
  74477. * @example
  74478. * new mapboxgl.supermap.NetworkAnalystService(url)
  74479. * .findPath(params,function(result){
  74480. * //doSomething
  74481. * })
  74482. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:</br>
  74483. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  74484. * 例如: "http://localhost:8090/iserver/services/test/rest/networkanalyst/WaterNet@FacilityNet"。
  74485. * @param {Object} options - 服务所需可选参数。
  74486. * @param {string} [options.proxy] - 服务代理地址。
  74487. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74488. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74489. * @param {Object} [options.headers] - 请求头。
  74490. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74491. */
  74492. var NetworkAnalystService = /*#__PURE__*/function (_ServiceBase) {
  74493. NetworkAnalystService_inherits(NetworkAnalystService, _ServiceBase);
  74494. var _super = NetworkAnalystService_createSuper(NetworkAnalystService);
  74495. function NetworkAnalystService(url, options) {
  74496. NetworkAnalystService_classCallCheck(this, NetworkAnalystService);
  74497. return _super.call(this, url, options);
  74498. }
  74499. /**
  74500. * @function mapboxgl.supermap.NetworkAnalystService.prototype.burstPipelineAnalyst
  74501. * @description 爆管分析服务:即将给定弧段或节点作为爆管点来进行分析,返回关键结点 ID 数组,普通结点 ID 数组及其上下游弧段 ID 数组。
  74502. * @param {SuperMap.BurstPipelineAnalystParameters} params - 爆管分析服务参数类。
  74503. * @param {RequestCallback} callback 回调函数。
  74504. */
  74505. NetworkAnalystService_createClass(NetworkAnalystService, [{
  74506. key: "burstPipelineAnalyst",
  74507. value: function burstPipelineAnalyst(params, callback) {
  74508. var me = this;
  74509. var burstPipelineAnalystService = new BurstPipelineAnalystService(me.url, {
  74510. proxy: me.options.proxy,
  74511. withCredentials: me.options.withCredentials,
  74512. crossOrigin: me.options.crossOrigin,
  74513. headers: me.options.headers,
  74514. serverType: me.options.serverType,
  74515. eventListeners: {
  74516. scope: me,
  74517. processCompleted: callback,
  74518. processFailed: callback
  74519. }
  74520. });
  74521. burstPipelineAnalystService.processAsync(me._processParams(params));
  74522. }
  74523. /**
  74524. * @function mapboxgl.supermap.NetworkAnalystService.prototype.computeWeightMatrix
  74525. * @description 耗费矩阵分析服务:根据交通网络分析参数中的耗费字段返回一个耗费矩阵。该矩阵是一个二维数组,用来存储任意两点间的资源消耗。
  74526. * @param {SuperMap.ComputeWeightMatrixParameters} params - 耗费矩阵分析服务参数类。
  74527. * @param {RequestCallback} callback - 回调函数。
  74528. */
  74529. }, {
  74530. key: "computeWeightMatrix",
  74531. value: function computeWeightMatrix(params, callback) {
  74532. var me = this;
  74533. var computeWeightMatrixService = new ComputeWeightMatrixService(me.url, {
  74534. proxy: me.options.proxy,
  74535. withCredentials: me.options.withCredentials,
  74536. crossOrigin: me.options.crossOrigin,
  74537. headers: me.options.headers,
  74538. serverType: me.options.serverType,
  74539. eventListeners: {
  74540. scope: me,
  74541. processCompleted: callback,
  74542. processFailed: callback
  74543. }
  74544. });
  74545. computeWeightMatrixService.processAsync(me._processParams(params));
  74546. }
  74547. /**
  74548. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findClosestFacilities
  74549. * @description 最近设施分析服务:指在网络上给定一个事件点和一组设施点,查找从事件点到设施点(或从设施点到事件点)以最小耗费能到达的最佳路径。
  74550. * @param {SuperMap.FindClosestFacilitiesParameters} params - 最近设施分析服务参数类。
  74551. * @param {RequestCallback} callback 回调函数。
  74552. * @param {SuperMap.DataFormat} [resultFormat=DataFormat.GEOJSON] - 返回的结果类型。
  74553. */
  74554. }, {
  74555. key: "findClosestFacilities",
  74556. value: function findClosestFacilities(params, callback, resultFormat) {
  74557. var me = this;
  74558. var findClosestFacilitiesService = new FindClosestFacilitiesService(me.url, {
  74559. proxy: me.options.proxy,
  74560. withCredentials: me.options.withCredentials,
  74561. crossOrigin: me.options.crossOrigin,
  74562. headers: me.options.headers,
  74563. serverType: me.options.serverType,
  74564. eventListeners: {
  74565. scope: me,
  74566. processCompleted: callback,
  74567. processFailed: callback
  74568. },
  74569. format: me._processFormat(resultFormat)
  74570. });
  74571. findClosestFacilitiesService.processAsync(me._processParams(params));
  74572. }
  74573. /**
  74574. * @function mapboxgl.supermap.NetworkAnalystService.prototype.streamFacilityAnalyst
  74575. * @description 上游/下游 关键设施查找资源服务:查找给定弧段或节点的上游/下游中的关键设施结点,返回关键结点 ID 数组及其下游弧段 ID 数组。
  74576. * @param {SuperMap.FacilityAnalystStreamParameters} params - 上游/下游 关键设施查找资源服务参数类。
  74577. * @param {RequestCallback} callback 回调函数。
  74578. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74579. */
  74580. }, {
  74581. key: "streamFacilityAnalyst",
  74582. value: function streamFacilityAnalyst(params, callback, resultFormat) {
  74583. var me = this;
  74584. var facilityAnalystStreamService = new FacilityAnalystStreamService(me.url, {
  74585. proxy: me.options.proxy,
  74586. withCredentials: me.options.withCredentials,
  74587. crossOrigin: me.options.crossOrigin,
  74588. headers: me.options.headers,
  74589. serverType: me.options.serverType,
  74590. eventListeners: {
  74591. scope: me,
  74592. processCompleted: callback,
  74593. processFailed: callback
  74594. },
  74595. format: me._processFormat(resultFormat)
  74596. });
  74597. facilityAnalystStreamService.processAsync(me._processParams(params));
  74598. }
  74599. /**
  74600. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findLocation
  74601. * @description 选址分区分析服务:确定一个或多个待建设施的最佳或最优位置。
  74602. * @param {SuperMap.FindLocationParameters} params - 选址分区分析服务参数类。
  74603. * @param {RequestCallback} callback 回调函数。
  74604. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74605. */
  74606. }, {
  74607. key: "findLocation",
  74608. value: function findLocation(params, callback, resultFormat) {
  74609. var me = this;
  74610. var findLocationService = new FindLocationService(me.url, {
  74611. proxy: me.options.proxy,
  74612. withCredentials: me.options.withCredentials,
  74613. crossOrigin: me.options.crossOrigin,
  74614. headers: me.options.headers,
  74615. serverType: me.options.serverType,
  74616. eventListeners: {
  74617. scope: me,
  74618. processCompleted: callback,
  74619. processFailed: callback
  74620. },
  74621. format: me._processFormat(resultFormat)
  74622. });
  74623. findLocationService.processAsync(me._processParams(params));
  74624. }
  74625. /**
  74626. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findPath
  74627. * @description 最佳路径分析服务:在网络数据集中指定一些节点,按照节点的选择顺序,顺序访问这些节点从而求解起止点之间阻抗最小的路经。
  74628. * @param {SuperMap.FindPathParameters} params - 最佳路径分析服务参数类。
  74629. * @param {RequestCallback} callback - 回调函数。
  74630. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74631. */
  74632. }, {
  74633. key: "findPath",
  74634. value: function findPath(params, callback, resultFormat) {
  74635. var me = this;
  74636. var findPathService = new FindPathService(me.url, {
  74637. proxy: me.options.proxy,
  74638. withCredentials: me.options.withCredentials,
  74639. crossOrigin: me.options.crossOrigin,
  74640. headers: me.options.headers,
  74641. serverType: me.options.serverType,
  74642. eventListeners: {
  74643. scope: me,
  74644. processCompleted: callback,
  74645. processFailed: callback
  74646. },
  74647. format: me._processFormat(resultFormat)
  74648. });
  74649. findPathService.processAsync(me._processParams(params));
  74650. }
  74651. /**
  74652. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findTSPPaths
  74653. * @description 旅行商分析服务:路径分析的一种,它从起点开始(默认为用户指定的第一点)查找能够遍历所有途经点且花费最小的路径。
  74654. * @param {SuperMap.SuperMap.FindTSPPathsParameters} params - 旅行商分析服务参数类。
  74655. * @param {RequestCallback} callback - 回调函数。
  74656. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74657. */
  74658. }, {
  74659. key: "findTSPPaths",
  74660. value: function findTSPPaths(params, callback, resultFormat) {
  74661. var me = this;
  74662. var findTSPPathsService = new FindTSPPathsService(me.url, {
  74663. proxy: me.options.proxy,
  74664. withCredentials: me.options.withCredentials,
  74665. crossOrigin: me.options.crossOrigin,
  74666. headers: me.options.headers,
  74667. serverType: me.options.serverType,
  74668. eventListeners: {
  74669. scope: me,
  74670. processCompleted: callback,
  74671. processFailed: callback
  74672. },
  74673. format: me._processFormat(resultFormat)
  74674. });
  74675. findTSPPathsService.processAsync(me._processParams(params));
  74676. }
  74677. /**
  74678. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findMTSPPaths
  74679. * @description 多旅行商分析服务:也称为物流配送,是指在网络数据集中,给定 M 个配送中心点和 N 个配送目的地(M,N 为大于零的整数)。查找经济有效的配送路径,并给出相应的行走路线。
  74680. * @param {SuperMap.FindMTSPPathsParameters} params - 多旅行商分析服务参数类。
  74681. * @param {RequestCallback} callback - 回调函数。
  74682. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74683. */
  74684. }, {
  74685. key: "findMTSPPaths",
  74686. value: function findMTSPPaths(params, callback, resultFormat) {
  74687. var me = this;
  74688. var findMTSPPathsService = new FindMTSPPathsService(me.url, {
  74689. proxy: me.options.proxy,
  74690. withCredentials: me.options.withCredentials,
  74691. crossOrigin: me.options.crossOrigin,
  74692. headers: me.options.headers,
  74693. serverType: me.options.serverType,
  74694. eventListeners: {
  74695. scope: me,
  74696. processCompleted: callback,
  74697. processFailed: callback
  74698. },
  74699. format: me._processFormat(resultFormat)
  74700. });
  74701. findMTSPPathsService.processAsync(me._processParams(params));
  74702. }
  74703. /**
  74704. * @function mapboxgl.supermap.NetworkAnalystService.prototype.findServiceAreas
  74705. * @description 服务区分析服务:以指定服务站点为中心,在一定服务范围内查找网络上服务站点能够提供服务的区域范围。
  74706. * @param {SuperMap.FindServiceAreasParameters} params - 服务区分析服务参数类。
  74707. * @param {RequestCallback} callback 回调函数。
  74708. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  74709. */
  74710. }, {
  74711. key: "findServiceAreas",
  74712. value: function findServiceAreas(params, callback, resultFormat) {
  74713. var me = this;
  74714. var findServiceAreasService = new FindServiceAreasService(me.url, {
  74715. proxy: me.options.proxy,
  74716. withCredentials: me.options.withCredentials,
  74717. crossOrigin: me.options.crossOrigin,
  74718. headers: me.options.headers,
  74719. serverType: me.options.serverType,
  74720. eventListeners: {
  74721. scope: me,
  74722. processCompleted: callback,
  74723. processFailed: callback
  74724. },
  74725. format: me._processFormat(resultFormat)
  74726. });
  74727. findServiceAreasService.processAsync(me._processParams(params));
  74728. }
  74729. /**
  74730. * @function mapboxgl.supermap.NetworkAnalystService.prototype.updateEdgeWeight
  74731. * @description 更新边的耗费权重服务。
  74732. * @param {SuperMap.UpdateEdgeWeightParameters} params - 更新边的耗费权重服务参数类。
  74733. * @param {RequestCallback} callback 回调函数。
  74734. */
  74735. }, {
  74736. key: "updateEdgeWeight",
  74737. value: function updateEdgeWeight(params, callback) {
  74738. var me = this;
  74739. var updateEdgeWeightService = new UpdateEdgeWeightService(me.url, {
  74740. proxy: me.options.proxy,
  74741. withCredentials: me.options.withCredentials,
  74742. crossOrigin: me.options.crossOrigin,
  74743. headers: me.options.headers,
  74744. serverType: me.options.serverType,
  74745. eventListeners: {
  74746. scope: me,
  74747. processCompleted: callback,
  74748. processFailed: callback
  74749. }
  74750. });
  74751. updateEdgeWeightService.processAsync(params);
  74752. }
  74753. /**
  74754. * @function mapboxgl.supermap.NetworkAnalystService.prototype.updateTurnNodeWeight
  74755. * @description 转向耗费权重更新服务。
  74756. * @param {SuperMap.UpdateTurnNodeWeightParameters} params - 转向耗费权重更新服务参数类。
  74757. * @param {RequestCallback} callback - 回调函数。
  74758. */
  74759. }, {
  74760. key: "updateTurnNodeWeight",
  74761. value: function updateTurnNodeWeight(params, callback) {
  74762. var me = this;
  74763. var updateTurnNodeWeightService = new UpdateTurnNodeWeightService(me.url, {
  74764. proxy: me.options.proxy,
  74765. withCredentials: me.options.withCredentials,
  74766. crossOrigin: me.options.crossOrigin,
  74767. headers: me.options.headers,
  74768. serverType: me.options.serverType,
  74769. eventListeners: {
  74770. scope: me,
  74771. processCompleted: callback,
  74772. processFailed: callback
  74773. }
  74774. });
  74775. updateTurnNodeWeightService.processAsync(params);
  74776. }
  74777. /**
  74778. * @description 所有 Point 考虑 mapboxgl.lnglat、mapboxgl.Point、[]三种形式。
  74779. * @param {Object} params - 待转换参数。
  74780. * @returns {Object}
  74781. * @private
  74782. */
  74783. }, {
  74784. key: "_processParams",
  74785. value: function _processParams(params) {
  74786. if (!params) {
  74787. return {};
  74788. }
  74789. var me = this;
  74790. if (params.centers && core_Util_Util.isArray(params.centers)) {
  74791. params.centers.map(function (point, key) {
  74792. params.centers[key] = me._toPointObject(point);
  74793. return params.centers[key];
  74794. });
  74795. }
  74796. if (params.nodes && core_Util_Util.isArray(params.nodes)) {
  74797. params.nodes.map(function (point, key) {
  74798. params.nodes[key] = me._toPointObject(point);
  74799. return params.nodes[key];
  74800. });
  74801. }
  74802. if (params.event) {
  74803. params.event = me._toPointObject(params.event);
  74804. }
  74805. if (params.facilities && core_Util_Util.isArray(params.facilities)) {
  74806. params.facilities.map(function (point, key) {
  74807. params.facilities[key] = me._toPointObject(point);
  74808. return params.facilities[key];
  74809. });
  74810. }
  74811. if (params.parameter && params.parameter.barrierPoints) {
  74812. var barrierPoints = params.parameter.barrierPoints;
  74813. if (core_Util_Util.isArray(barrierPoints)) {
  74814. barrierPoints.map(function (point, key) {
  74815. params.parameter[key] = me._toPointObject(point);
  74816. return params.parameter.barrierPoints[key];
  74817. });
  74818. } else {
  74819. params.parameter.barrierPoints = [barrierPoints instanceof (external_mapboxgl_default()).LngLat ? {
  74820. x: barrierPoints.lng,
  74821. y: barrierPoints.lat
  74822. } : barrierPoints];
  74823. }
  74824. }
  74825. return params;
  74826. }
  74827. }, {
  74828. key: "_toPointObject",
  74829. value: function _toPointObject(point) {
  74830. if (core_Util_Util.isArray(point)) {
  74831. return {
  74832. x: point[0],
  74833. y: point[1]
  74834. };
  74835. }
  74836. if (point instanceof (external_mapboxgl_default()).LngLat) {
  74837. return {
  74838. x: point.lng,
  74839. y: point.lat
  74840. };
  74841. }
  74842. return point instanceof (external_mapboxgl_default()).Point ? {
  74843. x: point.x,
  74844. y: point.y
  74845. } : point;
  74846. }
  74847. }, {
  74848. key: "_processFormat",
  74849. value: function _processFormat(resultFormat) {
  74850. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  74851. }
  74852. }]);
  74853. return NetworkAnalystService;
  74854. }(ServiceBase);
  74855. (external_mapboxgl_default()).supermap.NetworkAnalystService = NetworkAnalystService;
  74856. ;// CONCATENATED MODULE: ./src/mapboxgl/services/NetworkAnalyst3DService.js
  74857. function NetworkAnalyst3DService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { NetworkAnalyst3DService_typeof = function _typeof(obj) { return typeof obj; }; } else { NetworkAnalyst3DService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return NetworkAnalyst3DService_typeof(obj); }
  74858. function NetworkAnalyst3DService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  74859. 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); } }
  74860. function NetworkAnalyst3DService_createClass(Constructor, protoProps, staticProps) { if (protoProps) NetworkAnalyst3DService_defineProperties(Constructor.prototype, protoProps); if (staticProps) NetworkAnalyst3DService_defineProperties(Constructor, staticProps); return Constructor; }
  74861. 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 } }); if (superClass) NetworkAnalyst3DService_setPrototypeOf(subClass, superClass); }
  74862. function NetworkAnalyst3DService_setPrototypeOf(o, p) { NetworkAnalyst3DService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return NetworkAnalyst3DService_setPrototypeOf(o, p); }
  74863. 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); }; }
  74864. function NetworkAnalyst3DService_possibleConstructorReturn(self, call) { if (call && (NetworkAnalyst3DService_typeof(call) === "object" || typeof call === "function")) { return call; } return NetworkAnalyst3DService_assertThisInitialized(self); }
  74865. function NetworkAnalyst3DService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  74866. function NetworkAnalyst3DService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  74867. function NetworkAnalyst3DService_getPrototypeOf(o) { NetworkAnalyst3DService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return NetworkAnalyst3DService_getPrototypeOf(o); }
  74868. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  74869. * This program are made available under the terms of the Apache License, Version 2.0
  74870. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  74871. /**
  74872. * @class mapboxgl.supermap.NetworkAnalyst3DService
  74873. * @category iServer FacilityAnalyst3D
  74874. * @classdesc 3D 网络分析服务类。
  74875. * @extends {mapboxgl.supermap.ServiceBase}
  74876. * @example
  74877. * new mapboxgl.supermap.NetworkAnalyst3DService(url)
  74878. * .sinksFacilityAnalyst(params,function(result){
  74879. * //doSomething
  74880. * })
  74881. * @param {string} url - 网络分析服务地址。请求网络分析服务,URL应为:</br>
  74882. * http://{服务器地址}:{服务端口号}/iserver/services/{网络分析服务名}/rest/networkanalyst/{网络数据集@数据源}。
  74883. * 例如:"http://localhost:8090/iserver/services/components-rest/rest/networkanalyst/RoadNet@Changchun"。
  74884. * @param {Object} options - 服务所需可选参数。
  74885. * @param {string} [options.proxy] - 服务代理地址。
  74886. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  74887. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  74888. * @param {Object} [options.headers] - 请求头。
  74889. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  74890. */
  74891. var NetworkAnalyst3DService = /*#__PURE__*/function (_ServiceBase) {
  74892. NetworkAnalyst3DService_inherits(NetworkAnalyst3DService, _ServiceBase);
  74893. var _super = NetworkAnalyst3DService_createSuper(NetworkAnalyst3DService);
  74894. function NetworkAnalyst3DService(url, options) {
  74895. NetworkAnalyst3DService_classCallCheck(this, NetworkAnalyst3DService);
  74896. return _super.call(this, url, options);
  74897. }
  74898. /**
  74899. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.sinksFacilityAnalyst
  74900. * @description 汇查找服务。
  74901. * @param {SuperMap.FacilityAnalystSinks3DParameters} params - 最近设施分析参数类(汇查找资源)。
  74902. * @param {RequestCallback} callback - 回调函数。
  74903. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74904. */
  74905. NetworkAnalyst3DService_createClass(NetworkAnalyst3DService, [{
  74906. key: "sinksFacilityAnalyst",
  74907. value: function sinksFacilityAnalyst(params, callback) {
  74908. var me = this;
  74909. var facilityAnalystSinks3DService = new FacilityAnalystSinks3DService(me.url, {
  74910. proxy: me.options.proxy,
  74911. withCredentials: me.options.withCredentials,
  74912. crossOrigin: me.options.crossOrigin,
  74913. headers: me.options.headers,
  74914. serverType: me.options.serverType,
  74915. eventListeners: {
  74916. scope: me,
  74917. processCompleted: callback,
  74918. processFailed: callback
  74919. }
  74920. });
  74921. facilityAnalystSinks3DService.processAsync(params);
  74922. }
  74923. /**
  74924. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.sourcesFacilityAnalyst
  74925. * @description 源查找服务。
  74926. * @param {SuperMap.FacilityAnalystSources3DParameters} params - 最近设施分析参数类(源查找服务)。
  74927. * @param {RequestCallback} callback - 回调函数。
  74928. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74929. */
  74930. }, {
  74931. key: "sourcesFacilityAnalyst",
  74932. value: function sourcesFacilityAnalyst(params, callback) {
  74933. var me = this;
  74934. var facilityAnalystSources3DService = new FacilityAnalystSources3DService(me.url, {
  74935. proxy: me.options.proxy,
  74936. withCredentials: me.options.withCredentials,
  74937. crossOrigin: me.options.crossOrigin,
  74938. headers: me.options.headers,
  74939. serverType: me.options.serverType,
  74940. eventListeners: {
  74941. scope: me,
  74942. processCompleted: callback,
  74943. processFailed: callback
  74944. }
  74945. });
  74946. facilityAnalystSources3DService.processAsync(params);
  74947. }
  74948. /**
  74949. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.traceUpFacilityAnalyst
  74950. * @description 上游追踪资源服务。
  74951. * @param {SuperMap.FacilityAnalystTraceup3DParameters} params - 上游追踪资源参数类。
  74952. * @param {RequestCallback} callback 回调函数。
  74953. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74954. */
  74955. }, {
  74956. key: "traceUpFacilityAnalyst",
  74957. value: function traceUpFacilityAnalyst(params, callback) {
  74958. var me = this;
  74959. var facilityAnalystTraceup3DService = new FacilityAnalystTraceup3DService(me.url, {
  74960. proxy: me.options.proxy,
  74961. withCredentials: me.options.withCredentials,
  74962. crossOrigin: me.options.crossOrigin,
  74963. headers: me.options.headers,
  74964. serverType: me.options.serverType,
  74965. eventListeners: {
  74966. scope: me,
  74967. processCompleted: callback,
  74968. processFailed: callback
  74969. }
  74970. });
  74971. facilityAnalystTraceup3DService.processAsync(params);
  74972. }
  74973. /**
  74974. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.traceDownFacilityAnalyst
  74975. * @description 下游追踪资源服务。
  74976. * @param {SuperMap.FacilityAnalystTracedown3DParameters} params - 下游追踪资源服务参数类。
  74977. * @param {RequestCallback} callback 回调函数。
  74978. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  74979. */
  74980. }, {
  74981. key: "traceDownFacilityAnalyst",
  74982. value: function traceDownFacilityAnalyst(params, callback) {
  74983. var me = this;
  74984. var facilityAnalystTracedown3DService = new FacilityAnalystTracedown3DService(me.url, {
  74985. proxy: me.options.proxy,
  74986. withCredentials: me.options.withCredentials,
  74987. crossOrigin: me.options.crossOrigin,
  74988. headers: me.options.headers,
  74989. serverType: me.options.serverType,
  74990. eventListeners: {
  74991. scope: me,
  74992. processCompleted: callback,
  74993. processFailed: callback
  74994. }
  74995. });
  74996. facilityAnalystTracedown3DService.processAsync(params);
  74997. }
  74998. /**
  74999. * @function mapboxgl.supermap.NetworkAnalyst3DService.prototype.upstreamFacilityAnalyst
  75000. * @description 上游关键设施查找服务。
  75001. * @param {SuperMap.FacilityAnalystUpstream3DParameters} params - 上游关键设施查找服务参数类。
  75002. * @param {RequestCallback} callback 回调函数。
  75003. * @returns {mapboxgl.supermap.NetworkAnalyst3DService} 3D 网络分析服务。
  75004. */
  75005. }, {
  75006. key: "upstreamFacilityAnalyst",
  75007. value: function upstreamFacilityAnalyst(params, callback) {
  75008. var me = this;
  75009. var facilityAnalystUpstream3DService = new FacilityAnalystUpstream3DService(me.url, {
  75010. proxy: me.options.proxy,
  75011. withCredentials: me.options.withCredentials,
  75012. crossOrigin: me.options.crossOrigin,
  75013. headers: me.options.headers,
  75014. serverType: me.options.serverType,
  75015. eventListeners: {
  75016. scope: me,
  75017. processCompleted: callback,
  75018. processFailed: callback
  75019. }
  75020. });
  75021. facilityAnalystUpstream3DService.processAsync(params);
  75022. }
  75023. }]);
  75024. return NetworkAnalyst3DService;
  75025. }(ServiceBase);
  75026. (external_mapboxgl_default()).supermap.NetworkAnalyst3DService = NetworkAnalyst3DService;
  75027. ;// CONCATENATED MODULE: ./src/mapboxgl/services/ProcessingService.js
  75028. function ProcessingService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { ProcessingService_typeof = function _typeof(obj) { return typeof obj; }; } else { ProcessingService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return ProcessingService_typeof(obj); }
  75029. function ProcessingService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75030. 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); } }
  75031. function ProcessingService_createClass(Constructor, protoProps, staticProps) { if (protoProps) ProcessingService_defineProperties(Constructor.prototype, protoProps); if (staticProps) ProcessingService_defineProperties(Constructor, staticProps); return Constructor; }
  75032. 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 } }); if (superClass) ProcessingService_setPrototypeOf(subClass, superClass); }
  75033. function ProcessingService_setPrototypeOf(o, p) { ProcessingService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return ProcessingService_setPrototypeOf(o, p); }
  75034. 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); }; }
  75035. function ProcessingService_possibleConstructorReturn(self, call) { if (call && (ProcessingService_typeof(call) === "object" || typeof call === "function")) { return call; } return ProcessingService_assertThisInitialized(self); }
  75036. function ProcessingService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75037. function ProcessingService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  75038. function ProcessingService_getPrototypeOf(o) { ProcessingService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return ProcessingService_getPrototypeOf(o); }
  75039. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  75040. * This program are made available under the terms of the Apache License, Version 2.0
  75041. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75042. /**
  75043. * @class mapboxgl.supermap.ProcessingService
  75044. * @category iServer ProcessingService
  75045. * @classdesc 分布式分析相关服务类。
  75046. * @extends {mapboxgl.supermap.ServiceBase}
  75047. * @example
  75048. * new mapboxgl.supermap.ProcessingService(url,options)
  75049. * .getKernelDensityJobs(function(result){
  75050. * //doSomething
  75051. * })
  75052. * @param {string} url - 分布式分析服务地址。
  75053. * @param {Object} options - 交互服务时所需可选参数。
  75054. * @param {string} [options.proxy] - 服务代理地址。
  75055. * @param {boolean} [options.withCredentials=false] - 请求是否携带cookie。
  75056. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  75057. * @param {Object} [options.headers] - 请求头。
  75058. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  75059. */
  75060. var ProcessingService = /*#__PURE__*/function (_ServiceBase) {
  75061. ProcessingService_inherits(ProcessingService, _ServiceBase);
  75062. var _super = ProcessingService_createSuper(ProcessingService);
  75063. function ProcessingService(url, options) {
  75064. var _this;
  75065. ProcessingService_classCallCheck(this, ProcessingService);
  75066. _this = _super.call(this, url, options);
  75067. _this.kernelDensityJobs = {};
  75068. _this.summaryMeshJobs = {};
  75069. _this.queryJobs = {};
  75070. _this.summaryRegionJobs = {};
  75071. _this.vectorClipJobs = {};
  75072. _this.overlayGeoJobs = {};
  75073. _this.buffersJobs = {};
  75074. _this.topologyValidatorJobs = {};
  75075. _this.summaryAttributesJobs = {};
  75076. return _this;
  75077. }
  75078. /**
  75079. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJobs
  75080. * @description 获取密度分析的列表。
  75081. * @param {RequestCallback} callback - 请求结果的回调函数。
  75082. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75083. */
  75084. ProcessingService_createClass(ProcessingService, [{
  75085. key: "getKernelDensityJobs",
  75086. value: function getKernelDensityJobs(callback, resultFormat) {
  75087. var me = this,
  75088. format = me._processFormat(resultFormat);
  75089. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  75090. proxy: me.options.proxy,
  75091. withCredentials: me.options.withCredentials,
  75092. crossOrigin: me.options.crossOrigin,
  75093. headers: me.options.headers,
  75094. serverType: me.options.serverType,
  75095. eventListeners: {
  75096. scope: me,
  75097. processCompleted: callback,
  75098. processFailed: callback
  75099. },
  75100. format: format
  75101. });
  75102. kernelDensityJobsService.getKernelDensityJobs();
  75103. }
  75104. /**
  75105. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJob
  75106. * @description 获取某一个密度分析。
  75107. * @param {string} id - 空间分析的id。
  75108. * @param {RequestCallback} callback - 请求结果的回调函数。
  75109. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75110. */
  75111. }, {
  75112. key: "getKernelDensityJob",
  75113. value: function getKernelDensityJob(id, callback, resultFormat) {
  75114. var me = this,
  75115. format = me._processFormat(resultFormat);
  75116. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  75117. proxy: me.options.proxy,
  75118. withCredentials: me.options.withCredentials,
  75119. crossOrigin: me.options.crossOrigin,
  75120. headers: me.options.headers,
  75121. serverType: me.options.serverType,
  75122. eventListeners: {
  75123. scope: me,
  75124. processCompleted: callback,
  75125. processFailed: callback
  75126. },
  75127. format: format
  75128. });
  75129. kernelDensityJobsService.getKernelDensityJob(id);
  75130. }
  75131. /**
  75132. * @function mapboxgl.supermap.ProcessingService.prototype.addKernelDensityJob
  75133. * @description 新建一个密度分析。
  75134. * @param {SuperMap.KernelDensityJobParameter} params -创建一个空间分析的请求参数。
  75135. * @param {RequestCallback} callback 请求结果的回调函数。
  75136. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75137. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75138. */
  75139. }, {
  75140. key: "addKernelDensityJob",
  75141. value: function addKernelDensityJob(params, callback, seconds, resultFormat) {
  75142. var me = this,
  75143. param = me._processParams(params),
  75144. format = me._processFormat(resultFormat);
  75145. var kernelDensityJobsService = new KernelDensityJobsService(me.url, {
  75146. proxy: me.options.proxy,
  75147. withCredentials: me.options.withCredentials,
  75148. crossOrigin: me.options.crossOrigin,
  75149. headers: me.options.headers,
  75150. eventListeners: {
  75151. scope: me,
  75152. processCompleted: callback,
  75153. processFailed: callback,
  75154. processRunning: function processRunning(job) {
  75155. me.kernelDensityJobs[job.id] = job.state;
  75156. }
  75157. },
  75158. format: format
  75159. });
  75160. kernelDensityJobsService.addKernelDensityJob(param, seconds);
  75161. }
  75162. /**
  75163. * @function mapboxgl.supermap.ProcessingService.prototype.getKernelDensityJobState
  75164. * @description 获取密度分析的状态。
  75165. * @param {string} id - 密度分析的id。
  75166. * @returns {Object} 密度分析的状态。
  75167. */
  75168. }, {
  75169. key: "getKernelDensityJobState",
  75170. value: function getKernelDensityJobState(id) {
  75171. return this.kernelDensityJobs[id];
  75172. }
  75173. /**
  75174. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJobs
  75175. * @description 获取点聚合分析的列表。
  75176. * @param {RequestCallback} callback - 请求结果的回调函数。
  75177. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75178. */
  75179. }, {
  75180. key: "getSummaryMeshJobs",
  75181. value: function getSummaryMeshJobs(callback, resultFormat) {
  75182. var me = this,
  75183. format = me._processFormat(resultFormat);
  75184. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  75185. proxy: me.options.proxy,
  75186. withCredentials: me.options.withCredentials,
  75187. crossOrigin: me.options.crossOrigin,
  75188. headers: me.options.headers,
  75189. serverType: me.options.serverType,
  75190. eventListeners: {
  75191. scope: me,
  75192. processCompleted: callback,
  75193. processFailed: callback
  75194. },
  75195. format: format
  75196. });
  75197. summaryMeshJobsService.getSummaryMeshJobs();
  75198. }
  75199. /**
  75200. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJob
  75201. * @description 获取某一个点聚合分析。
  75202. * @param {string} id - 空间分析的 id。
  75203. * @param {function} callback - 请求结果的回调函数。
  75204. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75205. */
  75206. }, {
  75207. key: "getSummaryMeshJob",
  75208. value: function getSummaryMeshJob(id, callback, resultFormat) {
  75209. var me = this,
  75210. format = me._processFormat(resultFormat);
  75211. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  75212. proxy: me.options.proxy,
  75213. withCredentials: me.options.withCredentials,
  75214. crossOrigin: me.options.crossOrigin,
  75215. headers: me.options.headers,
  75216. serverType: me.options.serverType,
  75217. eventListeners: {
  75218. scope: me,
  75219. processCompleted: callback,
  75220. processFailed: callback
  75221. },
  75222. format: format
  75223. });
  75224. summaryMeshJobsService.getSummaryMeshJob(id);
  75225. }
  75226. /**
  75227. * @function mapboxgl.supermap.ProcessingService.prototype.addSummaryMeshJob
  75228. * @description 新建一个点聚合分析。
  75229. * @param {SuperMap.SummaryMeshJobParameter} params - 点聚合分析任务参数类。
  75230. * @param {RequestCallback} callback 请求结果的回调函数。
  75231. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75232. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75233. */
  75234. }, {
  75235. key: "addSummaryMeshJob",
  75236. value: function addSummaryMeshJob(params, callback, seconds, resultFormat) {
  75237. var me = this,
  75238. param = me._processParams(params),
  75239. format = me._processFormat(resultFormat);
  75240. var summaryMeshJobsService = new SummaryMeshJobsService(me.url, {
  75241. proxy: me.options.proxy,
  75242. withCredentials: me.options.withCredentials,
  75243. crossOrigin: me.options.crossOrigin,
  75244. headers: me.options.headers,
  75245. eventListeners: {
  75246. scope: me,
  75247. processCompleted: callback,
  75248. processFailed: callback,
  75249. processRunning: function processRunning(job) {
  75250. me.summaryMeshJobs[job.id] = job.state;
  75251. }
  75252. },
  75253. format: format
  75254. });
  75255. summaryMeshJobsService.addSummaryMeshJob(param, seconds);
  75256. }
  75257. /**
  75258. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryMeshJobState
  75259. * @description 获取点聚合分析的状态。
  75260. * @param {string} id - 点聚合分析的 ID。
  75261. * @returns {Object} 点聚合分析的状态。
  75262. */
  75263. }, {
  75264. key: "getSummaryMeshJobState",
  75265. value: function getSummaryMeshJobState(id) {
  75266. return this.summaryMeshJobs[id];
  75267. }
  75268. /**
  75269. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJobs
  75270. * @description 获取单对象查询分析的列表。
  75271. * @param {RequestCallback} callback - 请求结果的回调函数。
  75272. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75273. */
  75274. }, {
  75275. key: "getQueryJobs",
  75276. value: function getQueryJobs(callback, resultFormat) {
  75277. var me = this,
  75278. format = me._processFormat(resultFormat);
  75279. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  75280. proxy: me.options.proxy,
  75281. withCredentials: me.options.withCredentials,
  75282. serverType: me.options.serverType,
  75283. crossOrigin: me.options.crossOrigin,
  75284. headers: me.options.headers,
  75285. eventListeners: {
  75286. scope: me,
  75287. processCompleted: callback,
  75288. processFailed: callback
  75289. },
  75290. format: format
  75291. });
  75292. singleObjectQueryJobsService.getQueryJobs();
  75293. }
  75294. /**
  75295. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJob
  75296. * @description 获取某一个单对象查询分析。
  75297. * @param {string} id - 空间分析的 id。
  75298. * @param {RequestCallback} callback - 请求结果的回调函数。
  75299. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75300. */
  75301. }, {
  75302. key: "getQueryJob",
  75303. value: function getQueryJob(id, callback, resultFormat) {
  75304. var me = this,
  75305. format = me._processFormat(resultFormat);
  75306. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  75307. proxy: me.options.proxy,
  75308. withCredentials: me.options.withCredentials,
  75309. crossOrigin: me.options.crossOrigin,
  75310. headers: me.options.headers,
  75311. serverType: me.options.serverType,
  75312. eventListeners: {
  75313. scope: me,
  75314. processCompleted: callback,
  75315. processFailed: callback
  75316. },
  75317. format: format
  75318. });
  75319. singleObjectQueryJobsService.getQueryJob(id);
  75320. }
  75321. /**
  75322. * @function mapboxgl.supermap.ProcessingService.prototype.addQueryJob
  75323. * @description 新建一个单对象查询分析。
  75324. * @param {SuperMap.SingleObjectQueryJobsParameter} params -创建一个空间分析的请求参数。
  75325. * @param {RequestCallback} callback - 请求结果的回调函数。
  75326. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75327. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75328. */
  75329. }, {
  75330. key: "addQueryJob",
  75331. value: function addQueryJob(params, callback, seconds, resultFormat) {
  75332. var me = this,
  75333. param = me._processParams(params),
  75334. format = me._processFormat(resultFormat);
  75335. var singleObjectQueryJobsService = new SingleObjectQueryJobsService(me.url, {
  75336. proxy: me.options.proxy,
  75337. withCredentials: me.options.withCredentials,
  75338. crossOrigin: me.options.crossOrigin,
  75339. headers: me.options.headers,
  75340. eventListeners: {
  75341. scope: me,
  75342. processCompleted: callback,
  75343. processFailed: callback,
  75344. processRunning: function processRunning(job) {
  75345. me.queryJobs[job.id] = job.state;
  75346. }
  75347. },
  75348. format: format
  75349. });
  75350. singleObjectQueryJobsService.addQueryJob(param, seconds);
  75351. }
  75352. /**
  75353. * @function mapboxgl.supermap.ProcessingService.prototype.getQueryJobState
  75354. * @description 获取单对象查询分析的状态。
  75355. * @param {string} id - 单对象查询分析的 ID。
  75356. * @returns {Object} 单对象查询分析的状态。
  75357. */
  75358. }, {
  75359. key: "getQueryJobState",
  75360. value: function getQueryJobState(id) {
  75361. return this.queryJobs[id];
  75362. }
  75363. /**
  75364. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJobs
  75365. * @description 获取区域汇总分析的列表。
  75366. * @param {RequestCallback} callback - 请求结果的回调函数。
  75367. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75368. */
  75369. }, {
  75370. key: "getSummaryRegionJobs",
  75371. value: function getSummaryRegionJobs(callback, resultFormat) {
  75372. var me = this,
  75373. format = me._processFormat(resultFormat);
  75374. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  75375. proxy: me.options.proxy,
  75376. withCredentials: me.options.withCredentials,
  75377. crossOrigin: me.options.crossOrigin,
  75378. headers: me.options.headers,
  75379. serverType: me.options.serverType,
  75380. eventListeners: {
  75381. scope: me,
  75382. processCompleted: callback,
  75383. processFailed: callback
  75384. },
  75385. format: format
  75386. });
  75387. summaryRegionJobsService.getSummaryRegionJobs();
  75388. }
  75389. /**
  75390. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJob
  75391. * @description 获取某一个区域汇总分析。
  75392. * @param {string} id - 区域汇总分析的 id。
  75393. * @param {RequestCallback} callback - 请求结果的回调函数。
  75394. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75395. */
  75396. }, {
  75397. key: "getSummaryRegionJob",
  75398. value: function getSummaryRegionJob(id, callback, resultFormat) {
  75399. var me = this,
  75400. format = me._processFormat(resultFormat);
  75401. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  75402. proxy: me.options.proxy,
  75403. withCredentials: me.options.withCredentials,
  75404. crossOrigin: me.options.crossOrigin,
  75405. headers: me.options.headers,
  75406. serverType: me.options.serverType,
  75407. eventListeners: {
  75408. scope: me,
  75409. processCompleted: callback,
  75410. processFailed: callback
  75411. },
  75412. format: format
  75413. });
  75414. summaryRegionJobsService.getSummaryRegionJob(id);
  75415. }
  75416. /**
  75417. * @function mapboxgl.supermap.ProcessingService.prototype.addSummaryRegionJob
  75418. * @description 新建一个区域汇总分析。
  75419. * @param {SuperMap.SummaryRegionJobParameter} params - 区域汇总分析参数类。
  75420. * @param {RequestCallback} callback - 请求结果的回调函数。
  75421. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75422. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75423. */
  75424. }, {
  75425. key: "addSummaryRegionJob",
  75426. value: function addSummaryRegionJob(params, callback, seconds, resultFormat) {
  75427. var me = this,
  75428. param = me._processParams(params),
  75429. format = me._processFormat(resultFormat);
  75430. var summaryRegionJobsService = new SummaryRegionJobsService(me.url, {
  75431. proxy: me.options.proxy,
  75432. withCredentials: me.options.withCredentials,
  75433. crossOrigin: me.options.crossOrigin,
  75434. headers: me.options.headers,
  75435. eventListeners: {
  75436. scope: me,
  75437. processCompleted: callback,
  75438. processFailed: callback,
  75439. processRunning: function processRunning(job) {
  75440. me.summaryRegionJobs[job.id] = job.state;
  75441. }
  75442. },
  75443. format: format
  75444. });
  75445. summaryRegionJobsService.addSummaryRegionJob(param, seconds);
  75446. }
  75447. /**
  75448. * @function mapboxgl.supermap.ProcessingService.prototype.getSummaryRegionJobState
  75449. * @description 获取区域汇总分析的状态。
  75450. * @param {string} id - 生成区域汇总分析的 id。
  75451. * @returns {Object} 区域汇总分析的状态。
  75452. */
  75453. }, {
  75454. key: "getSummaryRegionJobState",
  75455. value: function getSummaryRegionJobState(id) {
  75456. return this.summaryRegionJobs[id];
  75457. }
  75458. /**
  75459. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJobs
  75460. * @description 获取矢量裁剪分析的列表。
  75461. * @param {RequestCallback} callback - 请求结果的回调函数。
  75462. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75463. */
  75464. }, {
  75465. key: "getVectorClipJobs",
  75466. value: function getVectorClipJobs(callback, resultFormat) {
  75467. var me = this,
  75468. format = me._processFormat(resultFormat);
  75469. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  75470. proxy: me.options.proxy,
  75471. withCredentials: me.options.withCredentials,
  75472. crossOrigin: me.options.crossOrigin,
  75473. headers: me.options.headers,
  75474. serverType: me.options.serverType,
  75475. eventListeners: {
  75476. scope: me,
  75477. processCompleted: callback,
  75478. processFailed: callback
  75479. },
  75480. format: format
  75481. });
  75482. vectorClipJobsService.getVectorClipJobs();
  75483. }
  75484. /**
  75485. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJob
  75486. * @description 获取某一个矢量裁剪分析。
  75487. * @param {string} id - 空间分析的 id。
  75488. * @param {RequestCallback} callback - 请求结果的回调函数。
  75489. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75490. */
  75491. }, {
  75492. key: "getVectorClipJob",
  75493. value: function getVectorClipJob(id, callback, resultFormat) {
  75494. var me = this,
  75495. format = me._processFormat(resultFormat);
  75496. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  75497. proxy: me.options.proxy,
  75498. withCredentials: me.options.withCredentials,
  75499. serverType: me.options.serverType,
  75500. crossOrigin: me.options.crossOrigin,
  75501. headers: me.options.headers,
  75502. eventListeners: {
  75503. scope: me,
  75504. processCompleted: callback,
  75505. processFailed: callback
  75506. },
  75507. format: format
  75508. });
  75509. vectorClipJobsService.getVectorClipJob(id);
  75510. }
  75511. /**
  75512. * @function mapboxgl.supermap.ProcessingService.prototype.addVectorClipJob
  75513. * @description 新建一个矢量裁剪分析。
  75514. * @param {SuperMap.VectorClipJobsParameter} params - 创建一个空间分析的请求参数。
  75515. * @param {RequestCallback} callback - 请求结果的回调函数。
  75516. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75517. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75518. */
  75519. }, {
  75520. key: "addVectorClipJob",
  75521. value: function addVectorClipJob(params, callback, seconds, resultFormat) {
  75522. var me = this,
  75523. param = me._processParams(params),
  75524. format = me._processFormat(resultFormat);
  75525. var vectorClipJobsService = new VectorClipJobsService(me.url, {
  75526. proxy: me.options.proxy,
  75527. withCredentials: me.options.withCredentials,
  75528. serverType: me.options.serverType,
  75529. crossOrigin: me.options.crossOrigin,
  75530. headers: me.options.headers,
  75531. eventListeners: {
  75532. scope: me,
  75533. processCompleted: callback,
  75534. processFailed: callback,
  75535. processRunning: function processRunning(job) {
  75536. me.vectorClipJobs[job.id] = job.state;
  75537. }
  75538. },
  75539. format: format
  75540. });
  75541. vectorClipJobsService.addVectorClipJob(param, seconds);
  75542. }
  75543. /**
  75544. * @function mapboxgl.supermap.ProcessingService.prototype.getVectorClipJobState
  75545. * @description 获取矢量裁剪分析的状态。
  75546. * @param {number} id - 矢量裁剪分析的id。
  75547. * @returns {Object} 矢量裁剪分析的状态。
  75548. */
  75549. }, {
  75550. key: "getVectorClipJobState",
  75551. value: function getVectorClipJobState(id) {
  75552. return this.vectorClipJobs[id];
  75553. }
  75554. /**
  75555. * @function mapboxgl.supermap.processingService.prototype.getOverlayGeoJobs
  75556. * @description 获取叠加分析的列表。
  75557. * @param {RequestCallback} callback - 请求结果的回调函数。
  75558. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75559. */
  75560. }, {
  75561. key: "getOverlayGeoJobs",
  75562. value: function getOverlayGeoJobs(callback, resultFormat) {
  75563. var me = this,
  75564. format = me._processFormat(resultFormat);
  75565. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  75566. proxy: me.options.proxy,
  75567. withCredentials: me.options.withCredentials,
  75568. serverType: me.options.serverType,
  75569. crossOrigin: me.options.crossOrigin,
  75570. headers: me.options.headers,
  75571. eventListeners: {
  75572. scope: me,
  75573. processCompleted: callback,
  75574. processFailed: callback
  75575. },
  75576. format: format
  75577. });
  75578. overlayGeoJobsService.getOverlayGeoJobs();
  75579. }
  75580. /**
  75581. * @function mapboxgl.supermap.processingService.prototype.getOverlayGeoJob
  75582. * @description 获取某一个叠加分析。
  75583. * @param {string} id - 空间分析的 ID。
  75584. * @param {RequestCallback} callback - 请求结果的回调函数。
  75585. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75586. */
  75587. }, {
  75588. key: "getOverlayGeoJob",
  75589. value: function getOverlayGeoJob(id, callback, resultFormat) {
  75590. var me = this,
  75591. format = me._processFormat(resultFormat);
  75592. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  75593. proxy: me.options.proxy,
  75594. withCredentials: me.options.withCredentials,
  75595. serverType: me.options.serverType,
  75596. crossOrigin: me.options.crossOrigin,
  75597. headers: me.options.headers,
  75598. eventListeners: {
  75599. scope: me,
  75600. processCompleted: callback,
  75601. processFailed: callback
  75602. },
  75603. format: format
  75604. });
  75605. overlayGeoJobsService.getOverlayGeoJob(id);
  75606. }
  75607. /**
  75608. * @function mapboxgl.supermap.processingService.prototype.addOverlayGeoJob
  75609. * @description 新建一个叠加分析。
  75610. * @param {SuperMap.OverlayGeoJobParameter} params - 创建一个空间分析的请求参数。
  75611. * @param {RequestCallback} callback - 请求结果的回调函数。
  75612. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75613. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75614. */
  75615. }, {
  75616. key: "addOverlayGeoJob",
  75617. value: function addOverlayGeoJob(params, callback, seconds, resultFormat) {
  75618. var me = this,
  75619. param = me._processParams(params),
  75620. format = me._processFormat(resultFormat);
  75621. var overlayGeoJobsService = new OverlayGeoJobsService(me.url, {
  75622. proxy: me.options.proxy,
  75623. withCredentials: me.options.withCredentials,
  75624. serverType: me.options.serverType,
  75625. crossOrigin: me.options.crossOrigin,
  75626. headers: me.options.headers,
  75627. eventListeners: {
  75628. scope: me,
  75629. processCompleted: callback,
  75630. processFailed: callback,
  75631. processRunning: function processRunning(job) {
  75632. me.overlayGeoJobs[job.id] = job.state;
  75633. }
  75634. },
  75635. format: format
  75636. });
  75637. overlayGeoJobsService.addOverlayGeoJob(param, seconds);
  75638. }
  75639. /**
  75640. * @function mapboxgl.supermap.processingService.prototype.getoverlayGeoJobState
  75641. * @description 获取叠加分析的状态。
  75642. * @param {string} id - 叠加分析的id。
  75643. * @returns {Object} 叠加分析的状态
  75644. */
  75645. }, {
  75646. key: "getoverlayGeoJobState",
  75647. value: function getoverlayGeoJobState(id) {
  75648. return this.overlayGeoJobs[id];
  75649. }
  75650. /**
  75651. * @function mapboxgl.supermap.processingService.prototype.getBuffersJobs
  75652. * @description 获取缓冲区分析的列表。
  75653. * @param {RequestCallback} callback - 请求结果的回调函数。
  75654. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75655. */
  75656. }, {
  75657. key: "getBuffersJobs",
  75658. value: function getBuffersJobs(callback, resultFormat) {
  75659. var me = this,
  75660. format = me._processFormat(resultFormat);
  75661. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  75662. proxy: me.options.proxy,
  75663. withCredentials: me.options.withCredentials,
  75664. serverType: me.options.serverType,
  75665. crossOrigin: me.options.crossOrigin,
  75666. headers: me.options.headers,
  75667. eventListeners: {
  75668. scope: me,
  75669. processCompleted: callback,
  75670. processFailed: callback
  75671. },
  75672. format: format
  75673. });
  75674. buffersAnalystJobsService.getBuffersJobs();
  75675. }
  75676. /**
  75677. * @function mapboxgl.supermap.processingService.prototype.getBuffersJob
  75678. * @description 获取某一个缓冲区分析。
  75679. * @param {string} id - 空间分析的 ID。
  75680. * @param {RequestCallback} callback - 请求结果的回调函数。
  75681. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75682. */
  75683. }, {
  75684. key: "getBuffersJob",
  75685. value: function getBuffersJob(id, callback, resultFormat) {
  75686. var me = this,
  75687. format = me._processFormat(resultFormat);
  75688. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  75689. proxy: me.options.proxy,
  75690. withCredentials: me.options.withCredentials,
  75691. serverType: me.options.serverType,
  75692. crossOrigin: me.options.crossOrigin,
  75693. headers: me.options.headers,
  75694. eventListeners: {
  75695. scope: me,
  75696. processCompleted: callback,
  75697. processFailed: callback
  75698. },
  75699. format: format
  75700. });
  75701. buffersAnalystJobsService.getBuffersJob(id);
  75702. }
  75703. /**
  75704. * @function mapboxgl.supermap.processingService.prototype.addBuffersJob
  75705. * @description 新建一个缓冲区分析。
  75706. * @param {SuperMap.BuffersAnalystJobsParameter} params - 创建一个空间分析的请求参数。
  75707. * @param {RequestCallback} callback - 请求结果的回调函数。
  75708. * @param {number} seconds - 开始创建后,获取创建成功结果的时间间隔。
  75709. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75710. */
  75711. }, {
  75712. key: "addBuffersJob",
  75713. value: function addBuffersJob(params, callback, seconds, resultFormat) {
  75714. var me = this,
  75715. param = me._processParams(params),
  75716. format = me._processFormat(resultFormat);
  75717. var buffersAnalystJobsService = new BuffersAnalystJobsService(me.url, {
  75718. proxy: me.options.proxy,
  75719. withCredentials: me.options.withCredentials,
  75720. serverType: me.options.serverType,
  75721. crossOrigin: me.options.crossOrigin,
  75722. headers: me.options.headers,
  75723. eventListeners: {
  75724. scope: me,
  75725. processCompleted: callback,
  75726. processFailed: callback,
  75727. processRunning: function processRunning(job) {
  75728. me.buffersJobs[job.id] = job.state;
  75729. }
  75730. },
  75731. format: format
  75732. });
  75733. buffersAnalystJobsService.addBuffersJob(param, seconds);
  75734. }
  75735. /**
  75736. * @function mapboxgl.supermap.processingService.prototype.getBuffersJobState
  75737. * @description 获取缓冲区分析的状态。
  75738. * @param {string} id - 缓冲区分析的 ID。
  75739. * @returns {Object} 缓冲区分析的状态。
  75740. */
  75741. }, {
  75742. key: "getBuffersJobState",
  75743. value: function getBuffersJobState(id) {
  75744. return this.buffersJobs[id];
  75745. }
  75746. /**
  75747. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJobs
  75748. * @description 获取拓扑检查分析的列表。
  75749. * @param {RequestCallback} callback - 请求结果的回调函数。
  75750. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75751. */
  75752. }, {
  75753. key: "getTopologyValidatorJobs",
  75754. value: function getTopologyValidatorJobs(callback, resultFormat) {
  75755. var me = this,
  75756. format = me._processFormat(resultFormat);
  75757. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  75758. proxy: me.options.proxy,
  75759. withCredentials: me.options.withCredentials,
  75760. serverType: me.options.serverType,
  75761. crossOrigin: me.options.crossOrigin,
  75762. headers: me.options.headers,
  75763. eventListeners: {
  75764. scope: me,
  75765. processCompleted: callback,
  75766. processFailed: callback
  75767. },
  75768. format: format
  75769. });
  75770. topologyValidatorJobsService.getTopologyValidatorJobs();
  75771. }
  75772. /**
  75773. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJob
  75774. * @description 获取某一个拓扑检查分析。
  75775. * @param {string} id - 空间分析的 ID。
  75776. * @param {RequestCallback} callback - 请求结果的回调函数。
  75777. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75778. */
  75779. }, {
  75780. key: "getTopologyValidatorJob",
  75781. value: function getTopologyValidatorJob(id, callback, resultFormat) {
  75782. var me = this,
  75783. format = me._processFormat(resultFormat);
  75784. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  75785. proxy: me.options.proxy,
  75786. withCredentials: me.options.withCredentials,
  75787. serverType: me.options.serverType,
  75788. crossOrigin: me.options.crossOrigin,
  75789. headers: me.options.headers,
  75790. eventListeners: {
  75791. scope: me,
  75792. processCompleted: callback,
  75793. processFailed: callback
  75794. },
  75795. format: format
  75796. });
  75797. topologyValidatorJobsService.getTopologyValidatorJob(id);
  75798. }
  75799. /**
  75800. * @function mapboxgl.supermap.processingService.prototype.addTopologyValidatorJob
  75801. * @description 新建一个拓扑检查分析。
  75802. * @param {SuperMap.TopologyValidatorJobsParameter} params - 创建一个空间分析的请求参数。
  75803. * @param {RequestCallback} callback - 请求结果的回调函数。
  75804. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75805. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75806. */
  75807. }, {
  75808. key: "addTopologyValidatorJob",
  75809. value: function addTopologyValidatorJob(params, callback, seconds, resultFormat) {
  75810. var me = this,
  75811. param = me._processParams(params),
  75812. format = me._processFormat(resultFormat);
  75813. var topologyValidatorJobsService = new TopologyValidatorJobsService(me.url, {
  75814. proxy: me.options.proxy,
  75815. withCredentials: me.options.withCredentials,
  75816. serverType: me.options.serverType,
  75817. crossOrigin: me.options.crossOrigin,
  75818. headers: me.options.headers,
  75819. eventListeners: {
  75820. scope: me,
  75821. processCompleted: callback,
  75822. processFailed: callback,
  75823. processRunning: function processRunning(job) {
  75824. me.topologyValidatorJobs[job.id] = job.state;
  75825. }
  75826. },
  75827. format: format
  75828. });
  75829. topologyValidatorJobsService.addTopologyValidatorJob(param, seconds);
  75830. }
  75831. /**
  75832. * @function mapboxgl.supermap.processingService.prototype.getTopologyValidatorJobState
  75833. * @description 获取拓扑检查分析的状态。
  75834. * @param {string} id - 拓扑检查分析的 ID。
  75835. * @returns {Object} 拓扑检查分析的状态。
  75836. */
  75837. }, {
  75838. key: "getTopologyValidatorJobState",
  75839. value: function getTopologyValidatorJobState(id) {
  75840. return this.topologyValidatorJobs[id];
  75841. }
  75842. /**
  75843. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJobs
  75844. * @description 获取属性汇总分析的列表。
  75845. * @param {RequestCallback} callback - 请求结果的回调函数。
  75846. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75847. */
  75848. }, {
  75849. key: "getSummaryAttributesJobs",
  75850. value: function getSummaryAttributesJobs(callback, resultFormat) {
  75851. var me = this,
  75852. format = me._processFormat(resultFormat);
  75853. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  75854. proxy: me.options.proxy,
  75855. withCredentials: me.options.withCredentials,
  75856. serverType: me.options.serverType,
  75857. crossOrigin: me.options.crossOrigin,
  75858. headers: me.options.headers,
  75859. eventListeners: {
  75860. scope: me,
  75861. processCompleted: callback,
  75862. processFailed: callback
  75863. },
  75864. format: format
  75865. });
  75866. summaryAttributesJobsService.getSummaryAttributesJobs();
  75867. }
  75868. /**
  75869. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJob
  75870. * @description 获取某一个属性汇总分析。
  75871. * @param {string} id - 空间分析的 ID。
  75872. * @param {RequestCallback} callback - 请求结果的回调函数。
  75873. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75874. */
  75875. }, {
  75876. key: "getSummaryAttributesJob",
  75877. value: function getSummaryAttributesJob(id, callback, resultFormat) {
  75878. var me = this,
  75879. format = me._processFormat(resultFormat);
  75880. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  75881. proxy: me.options.proxy,
  75882. withCredentials: me.options.withCredentials,
  75883. serverType: me.options.serverType,
  75884. crossOrigin: me.options.crossOrigin,
  75885. headers: me.options.headers,
  75886. eventListeners: {
  75887. scope: me,
  75888. processCompleted: callback,
  75889. processFailed: callback
  75890. },
  75891. format: format
  75892. });
  75893. summaryAttributesJobsService.getSummaryAttributesJob(id);
  75894. }
  75895. /**
  75896. * @function mapboxgl.supermap.processingService.prototype.addSummaryAttributesJob
  75897. * @description 新建一个属性汇总分析。
  75898. * @param {SuperMap.SummaryAttributesJobsParameter} params - 创建一个空间分析的请求参数。
  75899. * @param {RequestCallback} callback - 请求结果的回调函数。
  75900. * @param {number} [seconds=1000] - 开始创建后,获取创建成功结果的时间间隔。
  75901. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回的结果类型。
  75902. */
  75903. }, {
  75904. key: "addSummaryAttributesJob",
  75905. value: function addSummaryAttributesJob(params, callback, seconds, resultFormat) {
  75906. var me = this,
  75907. param = me._processParams(params),
  75908. format = me._processFormat(resultFormat);
  75909. var summaryAttributesJobsService = new SummaryAttributesJobsService(me.url, {
  75910. proxy: me.options.proxy,
  75911. withCredentials: me.options.withCredentials,
  75912. serverType: me.options.serverType,
  75913. crossOrigin: me.options.crossOrigin,
  75914. headers: me.options.headers,
  75915. eventListeners: {
  75916. scope: me,
  75917. processCompleted: callback,
  75918. processFailed: callback,
  75919. processRunning: function processRunning(job) {
  75920. me.summaryAttributesJobs[job.id] = job.state;
  75921. }
  75922. },
  75923. format: format
  75924. });
  75925. summaryAttributesJobsService.addSummaryAttributesJob(param, seconds);
  75926. }
  75927. /**
  75928. * @function mapboxgl.supermap.processingService.prototype.getSummaryAttributesJobState
  75929. * @description 获取属性汇总分析的状态。
  75930. * @param {string} id - 属性汇总分析的 ID。
  75931. * @returns {Object} 属性汇总分析的状态
  75932. */
  75933. }, {
  75934. key: "getSummaryAttributesJobState",
  75935. value: function getSummaryAttributesJobState(id) {
  75936. return this.summaryAttributesJobs[id];
  75937. }
  75938. }, {
  75939. key: "_processFormat",
  75940. value: function _processFormat(resultFormat) {
  75941. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  75942. }
  75943. }, {
  75944. key: "_processParams",
  75945. value: function _processParams(params) {
  75946. if (!params) {
  75947. return {};
  75948. }
  75949. if (params.bounds) {
  75950. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  75951. } //这里只允许传端的bounds
  75952. if (params.query) {
  75953. params.query = core_Util_Util.toSuperMapBounds(params.query);
  75954. }
  75955. if (params.geometryQuery) {
  75956. params.geometryQuery = core_Util_Util.toProcessingParam(params.geometryQuery);
  75957. }
  75958. if (params.geometryClip) {
  75959. params.geometryClip = core_Util_Util.toProcessingParam(params.geometryClip);
  75960. }
  75961. return params;
  75962. }
  75963. }]);
  75964. return ProcessingService;
  75965. }(ServiceBase);
  75966. (external_mapboxgl_default()).supermap.ProcessingService = ProcessingService;
  75967. ;// CONCATENATED MODULE: ./src/mapboxgl/services/QueryService.js
  75968. function services_QueryService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_QueryService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_QueryService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_QueryService_typeof(obj); }
  75969. function services_QueryService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  75970. 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); } }
  75971. function services_QueryService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_QueryService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_QueryService_defineProperties(Constructor, staticProps); return Constructor; }
  75972. function services_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 } }); if (superClass) services_QueryService_setPrototypeOf(subClass, superClass); }
  75973. function services_QueryService_setPrototypeOf(o, p) { services_QueryService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_QueryService_setPrototypeOf(o, p); }
  75974. function services_QueryService_createSuper(Derived) { var hasNativeReflectConstruct = services_QueryService_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = services_QueryService_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = services_QueryService_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return services_QueryService_possibleConstructorReturn(this, result); }; }
  75975. function services_QueryService_possibleConstructorReturn(self, call) { if (call && (services_QueryService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_QueryService_assertThisInitialized(self); }
  75976. function services_QueryService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  75977. function services_QueryService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  75978. function services_QueryService_getPrototypeOf(o) { services_QueryService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_QueryService_getPrototypeOf(o); }
  75979. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  75980. * This program are made available under the terms of the Apache License, Version 2.0
  75981. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  75982. /**
  75983. * @class mapboxgl.supermap.QueryService
  75984. * @category iServer Map QueryResults
  75985. * @classdesc 地图查询服务类。
  75986. * 提供:范围查询,SQL 查询,几何查询,距离查询。
  75987. * @extends {mapboxgl.supermap.ServiceBase}
  75988. * @param {string} url - 地图查询服务访问地址。
  75989. * @param {Object} options - 服务交互时所需的可选参数。
  75990. * @param {string} [options.proxy] - 服务代理地址。
  75991. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  75992. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  75993. * @param {Object} [options.headers] - 请求头。
  75994. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  75995. * @example
  75996. * new mapboxgl.supermap.QueryService(url)
  75997. * .queryByBounds(param,function(result){
  75998. * //doSomething
  75999. * })
  76000. */
  76001. var QueryService_QueryService = /*#__PURE__*/function (_ServiceBase) {
  76002. services_QueryService_inherits(QueryService, _ServiceBase);
  76003. var _super = services_QueryService_createSuper(QueryService);
  76004. function QueryService(url, options) {
  76005. services_QueryService_classCallCheck(this, QueryService);
  76006. return _super.call(this, url, options);
  76007. }
  76008. /**
  76009. * @function mapboxgl.supermap.QueryService.prototype.queryByBounds
  76010. * @description Bounds 查询地图服务。
  76011. * @param {SuperMap.QueryByBoundsParameters} params - 通过 Bounds 查询的相关参数类。
  76012. * @param {RequestCallback} callback - 回调函数。
  76013. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76014. */
  76015. services_QueryService_createClass(QueryService, [{
  76016. key: "queryByBounds",
  76017. value: function queryByBounds(params, callback, resultFormat) {
  76018. var me = this;
  76019. var queryService = new QueryByBoundsService(me.url, {
  76020. proxy: me.options.proxy,
  76021. withCredentials: me.options.withCredentials,
  76022. crossOrigin: me.options.crossOrigin,
  76023. headers: me.options.headers,
  76024. serverType: me.options.serverType,
  76025. eventListeners: {
  76026. scope: me,
  76027. processCompleted: callback,
  76028. processFailed: callback
  76029. },
  76030. format: me._processFormat(resultFormat)
  76031. });
  76032. queryService.processAsync(me._processParams(params));
  76033. }
  76034. /**
  76035. * @function mapboxgl.supermap.QueryService.prototype.queryByDistance
  76036. * @description 地图距离查询服务。
  76037. * @param {SuperMap.QueryByDistanceParameters} params - Distance 查询相关参数类。
  76038. * @param {RequestCallback} callback - 回调函数。
  76039. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型
  76040. */
  76041. }, {
  76042. key: "queryByDistance",
  76043. value: function queryByDistance(params, callback, resultFormat) {
  76044. var me = this;
  76045. var queryByDistanceService = new QueryByDistanceService(me.url, {
  76046. proxy: me.options.proxy,
  76047. withCredentials: me.options.withCredentials,
  76048. crossOrigin: me.options.crossOrigin,
  76049. headers: me.options.headers,
  76050. serverType: me.options.serverType,
  76051. eventListeners: {
  76052. scope: me,
  76053. processCompleted: callback,
  76054. processFailed: callback
  76055. },
  76056. format: me._processFormat(resultFormat)
  76057. });
  76058. queryByDistanceService.processAsync(me._processParams(params));
  76059. }
  76060. /**
  76061. * @function mapboxgl.supermap.QueryService.prototype.queryBySQL
  76062. * @description 地图 SQL 查询服务。
  76063. * @param {SuperMap.QueryBySQLParameters} params - SQL 查询相关参数类。
  76064. * @param {RequestCallback} callback - 回调函数。
  76065. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76066. */
  76067. }, {
  76068. key: "queryBySQL",
  76069. value: function queryBySQL(params, callback, resultFormat) {
  76070. var me = this;
  76071. var queryBySQLService = new QueryBySQLService(me.url, {
  76072. proxy: me.options.proxy,
  76073. withCredentials: me.options.withCredentials,
  76074. crossOrigin: me.options.crossOrigin,
  76075. headers: me.options.headers,
  76076. serverType: me.options.serverType,
  76077. eventListeners: {
  76078. scope: me,
  76079. processCompleted: callback,
  76080. processFailed: callback
  76081. },
  76082. format: me._processFormat(resultFormat)
  76083. });
  76084. queryBySQLService.processAsync(me._processParams(params));
  76085. }
  76086. /**
  76087. * @function mapboxgl.supermap.QueryService.prototype.queryByGeometry
  76088. * @description 地图几何查询服务。
  76089. * @param {SuperMap.QueryByGeometryParameters} params - Geometry 查询相关参数类。
  76090. * @param {RequestCallback} callback - 回调函数。
  76091. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76092. */
  76093. }, {
  76094. key: "queryByGeometry",
  76095. value: function queryByGeometry(params, callback, resultFormat) {
  76096. var me = this;
  76097. var queryByGeometryService = new QueryByGeometryService(me.url, {
  76098. proxy: me.options.proxy,
  76099. withCredentials: me.options.withCredentials,
  76100. crossOrigin: me.options.crossOrigin,
  76101. headers: me.options.headers,
  76102. serverType: me.options.serverType,
  76103. eventListeners: {
  76104. scope: me,
  76105. processCompleted: callback,
  76106. processFailed: callback
  76107. },
  76108. format: me._processFormat(resultFormat)
  76109. });
  76110. queryByGeometryService.processAsync(me._processParams(params));
  76111. }
  76112. }, {
  76113. key: "_processParams",
  76114. value: function _processParams(params) {
  76115. if (!params) {
  76116. return {};
  76117. }
  76118. params.returnContent = params.returnContent == null ? true : params.returnContent;
  76119. if (params.queryParams && !core_Util_Util.isArray(params.queryParams)) {
  76120. params.queryParams = [params.queryParams];
  76121. }
  76122. if (params.bounds) {
  76123. if (params.bounds instanceof Array) {
  76124. params.bounds = new Bounds(params.bounds[0], params.bounds[1], params.bounds[2], params.bounds[3]);
  76125. }
  76126. if (params.bounds instanceof (external_mapboxgl_default()).LngLatBounds) {
  76127. params.bounds = new Bounds(params.bounds.getSouthWest().lng, params.bounds.getSouthWest().lat, params.bounds.getNorthEast().lng, params.bounds.getNorthEast().lat);
  76128. }
  76129. }
  76130. if (params.geometry) {
  76131. if (params.geometry instanceof (external_mapboxgl_default()).LngLat) {
  76132. params.geometry = new Point(params.geometry.lng, params.geometry.lat);
  76133. }
  76134. if (params.geometry instanceof (external_mapboxgl_default()).Point) {
  76135. params.geometry = new Point(params.geometry.x, params.geometry.y);
  76136. }
  76137. if (params.geometry instanceof (external_mapboxgl_default()).LngLatBounds) {
  76138. params.geometry = core_Util_Util.toSuperMapPolygon(params.geometry);
  76139. }
  76140. if (!(params.geometry instanceof Geometry)) {
  76141. params.geometry = core_Util_Util.toSuperMapGeometry(params.geometry);
  76142. }
  76143. }
  76144. return params;
  76145. }
  76146. }, {
  76147. key: "_processFormat",
  76148. value: function _processFormat(resultFormat) {
  76149. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  76150. }
  76151. }]);
  76152. return QueryService;
  76153. }(ServiceBase);
  76154. (external_mapboxgl_default()).supermap.QueryService = QueryService_QueryService;
  76155. ;// CONCATENATED MODULE: ./src/mapboxgl/services/SpatialAnalystService.js
  76156. function SpatialAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { SpatialAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { SpatialAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return SpatialAnalystService_typeof(obj); }
  76157. function SpatialAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76158. 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); } }
  76159. function SpatialAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) SpatialAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) SpatialAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  76160. 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 } }); if (superClass) SpatialAnalystService_setPrototypeOf(subClass, superClass); }
  76161. function SpatialAnalystService_setPrototypeOf(o, p) { SpatialAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return SpatialAnalystService_setPrototypeOf(o, p); }
  76162. 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); }; }
  76163. function SpatialAnalystService_possibleConstructorReturn(self, call) { if (call && (SpatialAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return SpatialAnalystService_assertThisInitialized(self); }
  76164. function SpatialAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76165. function SpatialAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  76166. function SpatialAnalystService_getPrototypeOf(o) { SpatialAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return SpatialAnalystService_getPrototypeOf(o); }
  76167. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  76168. * This program are made available under the terms of the Apache License, Version 2.0
  76169. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76170. /**
  76171. * @class mapboxgl.supermap.SpatialAnalystService
  76172. * @extends {mapboxgl.supermap.ServiceBase}
  76173. * @category iServer SpatialAnalyst
  76174. * @classdesc 空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。
  76175. * @example
  76176. * new mapboxgl.supermap.SpatialAnalystService(url)
  76177. * .bufferAnalysis(params,function(result){
  76178. * //doSomething
  76179. * })
  76180. * @param {string} url - 服务的访问地址。
  76181. * @param {Object} options - 交互服务时所需可选参数。
  76182. * @param {string} [options.proxy] - 服务代理地址。
  76183. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76184. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76185. * @param {Object} [options.headers] - 请求头。
  76186. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  76187. */
  76188. var SpatialAnalystService = /*#__PURE__*/function (_ServiceBase) {
  76189. SpatialAnalystService_inherits(SpatialAnalystService, _ServiceBase);
  76190. var _super = SpatialAnalystService_createSuper(SpatialAnalystService);
  76191. function SpatialAnalystService(url, options) {
  76192. SpatialAnalystService_classCallCheck(this, SpatialAnalystService);
  76193. return _super.call(this, url, options);
  76194. }
  76195. /**
  76196. * @function mapboxgl.supermap.SpatialAnalystService.prototype.getAreaSolarRadiationResult
  76197. * @description 地区太阳辐射。
  76198. * @param {SuperMap.mapboxgl} params -查询相关参数类。
  76199. * @param {RequestCallback} callback - 回调函数。
  76200. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76201. */
  76202. SpatialAnalystService_createClass(SpatialAnalystService, [{
  76203. key: "getAreaSolarRadiationResult",
  76204. value: function getAreaSolarRadiationResult(params, callback, resultFormat) {
  76205. var me = this;
  76206. var areaSolarRadiationService = new AreaSolarRadiationService(me.url, {
  76207. proxy: me.options.proxy,
  76208. withCredentials: me.options.withCredentials,
  76209. crossOrigin: me.options.crossOrigin,
  76210. headers: me.options.headers,
  76211. serverType: me.options.serverType,
  76212. eventListeners: {
  76213. scope: me,
  76214. processCompleted: callback,
  76215. processFailed: callback
  76216. },
  76217. format: me._processFormat(resultFormat)
  76218. });
  76219. areaSolarRadiationService.processAsync(params);
  76220. }
  76221. /**
  76222. * @function mapboxgl.supermap.SpatialAnalystService.prototype.bufferAnalysis
  76223. * @description 缓冲区分析。
  76224. * @param {SuperMap.DatasetBufferAnalystParameters} params - 查询相关参数类。
  76225. * @param {RequestCallback} callback - 回调函数。
  76226. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76227. */
  76228. }, {
  76229. key: "bufferAnalysis",
  76230. value: function bufferAnalysis(params, callback, resultFormat) {
  76231. var me = this;
  76232. var bufferAnalystService = new BufferAnalystService(me.url, {
  76233. proxy: me.options.proxy,
  76234. withCredentials: me.options.withCredentials,
  76235. crossOrigin: me.options.crossOrigin,
  76236. headers: me.options.headers,
  76237. serverType: me.options.serverType,
  76238. eventListeners: {
  76239. scope: me,
  76240. processCompleted: callback,
  76241. processFailed: callback
  76242. },
  76243. format: me._processFormat(resultFormat)
  76244. });
  76245. bufferAnalystService.processAsync(me._processParams(params));
  76246. }
  76247. /**
  76248. * @function mapboxgl.supermap.SpatialAnalystService.prototype.densityAnalysis
  76249. * @description 点密度分析。
  76250. * @param {SuperMap.DensityKernelAnalystParameters} params - 查询相关参数类。
  76251. * @param {RequestCallback} callback - 回调函数。
  76252. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76253. */
  76254. }, {
  76255. key: "densityAnalysis",
  76256. value: function densityAnalysis(params, callback, resultFormat) {
  76257. var me = this;
  76258. var densityAnalystService = new DensityAnalystService(me.url, {
  76259. proxy: me.options.proxy,
  76260. withCredentials: me.options.withCredentials,
  76261. crossOrigin: me.options.crossOrigin,
  76262. headers: me.options.headers,
  76263. serverType: me.options.serverType,
  76264. eventListeners: {
  76265. scope: me,
  76266. processCompleted: callback,
  76267. processFailed: callback
  76268. },
  76269. format: me._processFormat(resultFormat)
  76270. });
  76271. densityAnalystService.processAsync(me._processParams(params));
  76272. }
  76273. /**
  76274. * @function mapboxgl.supermap.SpatialAnalystService.prototype.generateSpatialData
  76275. * @description 动态分段分析。
  76276. * @param {SuperMap.GenerateSpatialDataParameters} params - 查询相关参数类。
  76277. * @param {RequestCallback} callback - 回调函数。
  76278. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76279. */
  76280. }, {
  76281. key: "generateSpatialData",
  76282. value: function generateSpatialData(params, callback, resultFormat) {
  76283. var me = this;
  76284. var generateSpatialDataService = new GenerateSpatialDataService(me.url, {
  76285. proxy: me.options.proxy,
  76286. withCredentials: me.options.withCredentials,
  76287. crossOrigin: me.options.crossOrigin,
  76288. headers: me.options.headers,
  76289. serverType: me.options.serverType,
  76290. eventListeners: {
  76291. scope: me,
  76292. processCompleted: callback,
  76293. processFailed: callback
  76294. },
  76295. format: me._processFormat(resultFormat)
  76296. });
  76297. generateSpatialDataService.processAsync(params);
  76298. }
  76299. /**
  76300. * @function mapboxgl.supermap.SpatialAnalystService.prototype.geoRelationAnalysis
  76301. * @description 空间关系分析。
  76302. * @param {SuperMap.GeoRelationAnalystParameters} params - 查询相关参数类。
  76303. * @param {RequestCallback} callback - 回调函数。
  76304. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76305. */
  76306. }, {
  76307. key: "geoRelationAnalysis",
  76308. value: function geoRelationAnalysis(params, callback, resultFormat) {
  76309. var me = this;
  76310. var geoRelationAnalystService = new GeoRelationAnalystService(me.url, {
  76311. proxy: me.options.proxy,
  76312. withCredentials: me.options.withCredentials,
  76313. crossOrigin: me.options.crossOrigin,
  76314. headers: me.options.headers,
  76315. serverType: me.options.serverType,
  76316. eventListeners: {
  76317. scope: me,
  76318. processCompleted: callback,
  76319. processFailed: callback
  76320. },
  76321. format: me._processFormat(resultFormat)
  76322. });
  76323. geoRelationAnalystService.processAsync(params);
  76324. }
  76325. /**
  76326. * @function mapboxgl.supermap.SpatialAnalystService.prototype.interpolationAnalysis
  76327. * @description 插值分析。
  76328. * @param {SuperMap.InterpolationRBFAnalystParameters} params - 查询相关参数类。
  76329. * @param {RequestCallback} callback - 回调函数。
  76330. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76331. */
  76332. }, {
  76333. key: "interpolationAnalysis",
  76334. value: function interpolationAnalysis(params, callback, resultFormat) {
  76335. var me = this;
  76336. var interpolationAnalystService = new InterpolationAnalystService(me.url, {
  76337. proxy: me.options.proxy,
  76338. withCredentials: me.options.withCredentials,
  76339. crossOrigin: me.options.crossOrigin,
  76340. headers: me.options.headers,
  76341. serverType: me.options.serverType,
  76342. eventListeners: {
  76343. scope: me,
  76344. processCompleted: callback,
  76345. processFailed: callback
  76346. },
  76347. format: me._processFormat(resultFormat)
  76348. });
  76349. interpolationAnalystService.processAsync(me._processParams(params));
  76350. }
  76351. /**
  76352. * @function mapboxgl.supermap.SpatialAnalystService.prototype.mathExpressionAnalysis
  76353. * @description 栅格代数运算。
  76354. * @param {SuperMap.MathExpressionAnalysisParameters} params - 查询相关参数类。
  76355. * @param {RequestCallback} callback - 回调函数。
  76356. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76357. */
  76358. }, {
  76359. key: "mathExpressionAnalysis",
  76360. value: function mathExpressionAnalysis(params, callback, resultFormat) {
  76361. var me = this;
  76362. var mathExpressionAnalysisService = new MathExpressionAnalysisService(me.url, {
  76363. proxy: me.options.proxy,
  76364. withCredentials: me.options.withCredentials,
  76365. crossOrigin: me.options.crossOrigin,
  76366. headers: me.options.headers,
  76367. serverType: me.options.serverType,
  76368. eventListeners: {
  76369. scope: me,
  76370. processCompleted: callback,
  76371. processFailed: callback
  76372. },
  76373. format: me._processFormat(resultFormat)
  76374. });
  76375. mathExpressionAnalysisService.processAsync(me._processParams(params));
  76376. }
  76377. /**
  76378. * @function mapboxgl.supermap.SpatialAnalystService.prototype.overlayAnalysis
  76379. * @description 叠加分析。
  76380. * @param {(SuperMap.DatasetOverlayAnalystParameters|SuperMap.GeometryOverlayAnalystParameters)} params - 叠加分析参数类,支持批量几何要素叠加分析。
  76381. * @param {RequestCallback} callback - 回调函数。
  76382. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76383. */
  76384. }, {
  76385. key: "overlayAnalysis",
  76386. value: function overlayAnalysis(params, callback, resultFormat) {
  76387. var me = this;
  76388. var overlayAnalystService = new OverlayAnalystService(me.url, {
  76389. proxy: me.options.proxy,
  76390. withCredentials: me.options.withCredentials,
  76391. crossOrigin: me.options.crossOrigin,
  76392. headers: me.options.headers,
  76393. serverType: me.options.serverType,
  76394. eventListeners: {
  76395. scope: me,
  76396. processCompleted: callback,
  76397. processFailed: callback
  76398. },
  76399. format: me._processFormat(resultFormat)
  76400. });
  76401. overlayAnalystService.processAsync(me._processParams(params));
  76402. }
  76403. /**
  76404. * @function mapboxgl.supermap.SpatialAnalystService.prototype.routeCalculateMeasure
  76405. * @description 路由测量计算。
  76406. * @param {SuperMap.RouteCalculateMeasureParameters} params - 查询相关参数类。
  76407. * @param {RequestCallback} callback - 回调函数。
  76408. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76409. */
  76410. }, {
  76411. key: "routeCalculateMeasure",
  76412. value: function routeCalculateMeasure(params, callback, resultFormat) {
  76413. var me = this;
  76414. var routeCalculateMeasureService = new RouteCalculateMeasureService(me.url, {
  76415. proxy: me.options.proxy,
  76416. withCredentials: me.options.withCredentials,
  76417. crossOrigin: me.options.crossOrigin,
  76418. headers: me.options.headers,
  76419. serverType: me.options.serverType,
  76420. eventListeners: {
  76421. scope: me,
  76422. processCompleted: callback,
  76423. processFailed: callback
  76424. },
  76425. format: me._processFormat(resultFormat)
  76426. });
  76427. routeCalculateMeasureService.processAsync(me._processParams(params));
  76428. }
  76429. /**
  76430. * @function mapboxgl.supermap.SpatialAnalystService.prototype.routeLocate
  76431. * @description 路由定位。
  76432. * @param {SuperMap.RouteLocatorParameters} params - 查询相关参数类。
  76433. * @param {RequestCallback} callback - 回调函数。
  76434. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76435. */
  76436. }, {
  76437. key: "routeLocate",
  76438. value: function routeLocate(params, callback, resultFormat) {
  76439. var me = this;
  76440. var routeLocatorService = new RouteLocatorService(me.url, {
  76441. proxy: me.options.proxy,
  76442. withCredentials: me.options.withCredentials,
  76443. crossOrigin: me.options.crossOrigin,
  76444. headers: me.options.headers,
  76445. serverType: me.options.serverType,
  76446. eventListeners: {
  76447. scope: me,
  76448. processCompleted: callback,
  76449. processFailed: callback
  76450. },
  76451. format: me._processFormat(resultFormat)
  76452. });
  76453. routeLocatorService.processAsync(me._processParams(params));
  76454. }
  76455. /**
  76456. * @function mapboxgl.supermap.SpatialAnalystService.prototype.surfaceAnalysis
  76457. * @description 表面分析。
  76458. * @param {SuperMap.SurfaceAnalystParameters} params - 表面分析参数类。
  76459. * @param {RequestCallback} callback - 回调函数。
  76460. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76461. */
  76462. }, {
  76463. key: "surfaceAnalysis",
  76464. value: function surfaceAnalysis(params, callback, resultFormat) {
  76465. var me = this;
  76466. var surfaceAnalystService = new SurfaceAnalystService(me.url, {
  76467. proxy: me.options.proxy,
  76468. withCredentials: me.options.withCredentials,
  76469. crossOrigin: me.options.crossOrigin,
  76470. headers: me.options.headers,
  76471. serverType: me.options.serverType,
  76472. eventListeners: {
  76473. scope: me,
  76474. processCompleted: callback,
  76475. processFailed: callback
  76476. },
  76477. format: me._processFormat(resultFormat)
  76478. });
  76479. surfaceAnalystService.processAsync(me._processParams(params));
  76480. }
  76481. /**
  76482. * @function mapboxgl.supermap.SpatialAnalystService.prototype.terrainCurvatureCalculate
  76483. * @description 地形曲率计算。
  76484. * @param {SuperMap.TerrainCurvatureCalculationParameters} params - 查询相关参数类。
  76485. * @param {RequestCallback} callback - 回调函数。
  76486. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76487. */
  76488. }, {
  76489. key: "terrainCurvatureCalculate",
  76490. value: function terrainCurvatureCalculate(params, callback, resultFormat) {
  76491. var me = this;
  76492. var terrainCurvatureCalculationService = new TerrainCurvatureCalculationService(me.url, {
  76493. proxy: me.options.proxy,
  76494. withCredentials: me.options.withCredentials,
  76495. crossOrigin: me.options.crossOrigin,
  76496. headers: me.options.headers,
  76497. serverType: me.options.serverType,
  76498. eventListeners: {
  76499. scope: me,
  76500. processCompleted: callback,
  76501. processFailed: callback
  76502. },
  76503. format: me._processFormat(resultFormat)
  76504. });
  76505. terrainCurvatureCalculationService.processAsync(params);
  76506. }
  76507. /**
  76508. * @function mapboxgl.supermap.SpatialAnalystService.prototype.thiessenAnalysis
  76509. * @description 泰森多边形分析。
  76510. * @param {SuperMap.DatasetThiessenAnalystParameters} params - 查询相关参数类。
  76511. * @param {RequestCallback} callback - 回调函数。
  76512. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76513. */
  76514. }, {
  76515. key: "thiessenAnalysis",
  76516. value: function thiessenAnalysis(params, callback, resultFormat) {
  76517. var me = this;
  76518. var thiessenAnalystService = new ThiessenAnalystService(me.url, {
  76519. proxy: me.options.proxy,
  76520. withCredentials: me.options.withCredentials,
  76521. crossOrigin: me.options.crossOrigin,
  76522. headers: me.options.headers,
  76523. serverType: me.options.serverType,
  76524. eventListeners: {
  76525. scope: me,
  76526. processCompleted: callback,
  76527. processFailed: callback
  76528. },
  76529. format: me._processFormat(resultFormat)
  76530. });
  76531. thiessenAnalystService.processAsync(me._processParams(params));
  76532. }
  76533. /**
  76534. * @function mapboxgl.supermap.SpatialAnalystService.prototype.geometrybatchAnalysis
  76535. * @description 批量空间分析。
  76536. * @param {Array} params - 批量分析参数对象数组,包括:
  76537. * @param {string} params.analystName - 空间分析方法的名称。包括:</br>
  76538. * "buffer","overlay","interpolationDensity","interpolationidw","interpolationRBF","interpolationKriging","isoregion","isoline"。
  76539. * @param {Object} params.param - 空间分析类型对应的请求参数,包括:</br>
  76540. * {SuperMap.GeometryBufferAnalystParameters} 缓冲区分析参数类。</br>
  76541. * {SuperMap.GeometryOverlayAnalystParameters} 叠加分析参数类。</br>
  76542. * {SuperMap.InterpolationAnalystParameters} 插值分析参数类。</br>
  76543. * {SuperMap.SurfaceAnalystParameters} 表面分析参数类。</br>
  76544. * @param {RequestCallback} callback - 回调函数。
  76545. * @param {SuperMap.DataFormat} [resultFormat=SuperMap.DataFormat.GEOJSON] - 返回结果类型。
  76546. */
  76547. }, {
  76548. key: "geometrybatchAnalysis",
  76549. value: function geometrybatchAnalysis(params, callback, resultFormat) {
  76550. var me = this;
  76551. var geometryBatchAnalystService = new GeometryBatchAnalystService(me.url, {
  76552. serverType: me.options.serverType,
  76553. eventListeners: {
  76554. scope: me,
  76555. processCompleted: callback,
  76556. processFailed: callback
  76557. },
  76558. format: me._processFormat(resultFormat)
  76559. }); //处理批量分析中各个分类类型的参数:
  76560. var analystParameters = [];
  76561. for (var i = 0; i < params.length; i++) {
  76562. var tempParameter = params[i];
  76563. analystParameters.push({
  76564. analystName: tempParameter.analystName,
  76565. param: me._processParams(tempParameter.param)
  76566. });
  76567. }
  76568. geometryBatchAnalystService.processAsync(analystParameters);
  76569. }
  76570. }, {
  76571. key: "_processParams",
  76572. value: function _processParams(params) {
  76573. if (!params) {
  76574. return {};
  76575. }
  76576. if (params.bounds) {
  76577. params.bounds = core_Util_Util.toSuperMapBounds(params.bounds);
  76578. } //插值分析点数组转换
  76579. if (params.inputPoints) {
  76580. for (var i = 0; i < params.inputPoints.length; i++) {
  76581. var inputPoint = params.inputPoints[i];
  76582. if (core_Util_Util.isArray(inputPoint)) {
  76583. params.inputPoints[i] = {
  76584. x: inputPoint[0],
  76585. y: inputPoint[1],
  76586. tag: inputPoint[2]
  76587. };
  76588. }
  76589. }
  76590. } //点数组转换
  76591. if (params.points) {
  76592. for (var _i = 0; _i < params.points.length; _i++) {
  76593. var point = params.points[_i];
  76594. params.points[_i] = core_Util_Util.toSuperMapPoint(point);
  76595. }
  76596. } //mapboxgl点对象转SuperMap点对象
  76597. if (params.point) {
  76598. params.point = core_Util_Util.toSuperMapPoint(params.point);
  76599. } //初步判断mapbox数据就为geojson格式 ,进行转json格式即可
  76600. //栅格代数运算的范围
  76601. if (params.extractRegion) {
  76602. params.extractRegion = core_Util_Util.toSuperMapGeometry(params.extractRegion);
  76603. } //获取或设置表面分析参数
  76604. if (params.extractParameter && params.extractParameter.clipRegion) {
  76605. params.extractParameter.clipRegion = core_Util_Util.toSuperMapGeometry(params.extractParameter.clipRegion);
  76606. }
  76607. if (params.clipParam && params.clipParam.clipRegion) {
  76608. params.clipParam.clipRegion = core_Util_Util.toSuperMapGeometry(params.clipParam.clipRegion);
  76609. } //sourceRoute 路由对象。用于里程分析,该对象可以是用户自己生 成或在数据源中查询得到的符合标准的路由对象;geojson格式
  76610. if (params.sourceRoute) {
  76611. if (params.sourceRoute) {
  76612. var target = {};
  76613. target.type = "LINEM";
  76614. target.parts = [params.sourceRoute.geometry.coordinates.length];
  76615. target.points = [];
  76616. for (var _i2 = 0; _i2 < params.sourceRoute.geometry.coordinates.length; _i2++) {
  76617. var lnglat = params.sourceRoute.geometry.coordinates[_i2]; //measure 应该在传值时设置,
  76618. target.points = target.points.concat({
  76619. x: lnglat[0],
  76620. y: lnglat[1],
  76621. measure: lnglat[2]
  76622. });
  76623. }
  76624. params.sourceRoute = target;
  76625. }
  76626. } //operateRegions 操作面对象集合,数据集叠加分析,表示与这些面对象进行叠加分析
  76627. if (params.operateRegions && core_Util_Util.isArray(params.operateRegions)) {
  76628. params.operateRegions.map(function (geometry, key) {
  76629. params.operateRegions[key] = core_Util_Util.toSuperMapGeometry(geometry);
  76630. return params.operateRegions[key];
  76631. });
  76632. } //叠加分析,几何数据源 支持格式:GeoJson
  76633. if (params.sourceGeometry) {
  76634. var SRID = null;
  76635. if (params.sourceGeometrySRID) {
  76636. SRID = params.sourceGeometrySRID;
  76637. }
  76638. params.sourceGeometry = core_Util_Util.toSuperMapGeometry(params.sourceGeometry);
  76639. if (SRID) {
  76640. params.sourceGeometry.SRID = SRID;
  76641. }
  76642. delete params.sourceGeometry.sourceGeometrySRID;
  76643. }
  76644. if (params.operateGeometry) {
  76645. params.operateGeometry = core_Util_Util.toSuperMapGeometry(params.operateGeometry);
  76646. } //支持传入多个几何要素进行叠加分析:
  76647. if (params.sourceGeometries) {
  76648. var sourceGeometries = [];
  76649. for (var k = 0; k < params.sourceGeometries.length; k++) {
  76650. sourceGeometries.push(core_Util_Util.toSuperMapGeometry(params.sourceGeometries[k]));
  76651. }
  76652. params.sourceGeometries = sourceGeometries;
  76653. } //支持传入多个几何要素进行叠加分析:
  76654. if (params.operateGeometries) {
  76655. var operateGeometries = [];
  76656. for (var j = 0; j < params.operateGeometries.length; j++) {
  76657. operateGeometries.push(core_Util_Util.toSuperMapGeometry(params.operateGeometries[j]));
  76658. }
  76659. params.operateGeometries = operateGeometries;
  76660. } //components 几何对象数组
  76661. if (params.sourceRoute && params.sourceRoute.components && core_Util_Util.isArray(params.sourceRoute.components)) {
  76662. params.sourceRoute.components.map(function (geometry, key) {
  76663. params.sourceRoute.components[key] = core_Util_Util.toSuperMapGeometry(geometry);
  76664. return params.sourceRoute.components[key];
  76665. });
  76666. }
  76667. return params;
  76668. }
  76669. }, {
  76670. key: "_processFormat",
  76671. value: function _processFormat(resultFormat) {
  76672. return resultFormat ? resultFormat : DataFormat.GEOJSON;
  76673. }
  76674. }]);
  76675. return SpatialAnalystService;
  76676. }(ServiceBase);
  76677. (external_mapboxgl_default()).supermap.SpatialAnalystService = SpatialAnalystService;
  76678. ;// CONCATENATED MODULE: ./src/mapboxgl/services/ThemeService.js
  76679. function services_ThemeService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { services_ThemeService_typeof = function _typeof(obj) { return typeof obj; }; } else { services_ThemeService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return services_ThemeService_typeof(obj); }
  76680. function services_ThemeService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76681. 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); } }
  76682. function services_ThemeService_createClass(Constructor, protoProps, staticProps) { if (protoProps) services_ThemeService_defineProperties(Constructor.prototype, protoProps); if (staticProps) services_ThemeService_defineProperties(Constructor, staticProps); return Constructor; }
  76683. 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 } }); if (superClass) services_ThemeService_setPrototypeOf(subClass, superClass); }
  76684. function services_ThemeService_setPrototypeOf(o, p) { services_ThemeService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return services_ThemeService_setPrototypeOf(o, p); }
  76685. 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); }; }
  76686. function services_ThemeService_possibleConstructorReturn(self, call) { if (call && (services_ThemeService_typeof(call) === "object" || typeof call === "function")) { return call; } return services_ThemeService_assertThisInitialized(self); }
  76687. function services_ThemeService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76688. 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 { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  76689. function services_ThemeService_getPrototypeOf(o) { services_ThemeService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return services_ThemeService_getPrototypeOf(o); }
  76690. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  76691. * This program are made available under the terms of the Apache License, Version 2.0
  76692. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76693. /**
  76694. * @class mapboxgl.supermap.ThemeService
  76695. * @category iServer Map Theme
  76696. * @classdesc 专题图服务类。
  76697. * @extends {mapboxgl.supermap.ServiceBase}
  76698. * @example
  76699. * new mapboxgl.supermap.ThemeService(url,{
  76700. * projection:projection
  76701. * }).getThemeInfo(params,function(result){
  76702. * //doSomething
  76703. * });
  76704. * @param {string} url - 服务的访问地址。
  76705. * @param {Object} options - 交互服务时所需可选参数。
  76706. * @param {string} [options.proxy] - 服务代理地址。
  76707. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76708. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76709. * @param {Object} [options.headers] - 请求头。
  76710. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  76711. */
  76712. var ThemeService = /*#__PURE__*/function (_ServiceBase) {
  76713. services_ThemeService_inherits(ThemeService, _ServiceBase);
  76714. var _super = services_ThemeService_createSuper(ThemeService);
  76715. function ThemeService(url, options) {
  76716. services_ThemeService_classCallCheck(this, ThemeService);
  76717. return _super.call(this, url, options);
  76718. }
  76719. /**
  76720. * @function mapboxgl.supermap.ThemeService.prototype.getThemeInfo
  76721. * @description 获取专题图信息。
  76722. * @param {SuperMap.ThemeParameters} params - 专题图参数类。
  76723. * @param {RequestCallback} callback - 回调函数。
  76724. */
  76725. services_ThemeService_createClass(ThemeService, [{
  76726. key: "getThemeInfo",
  76727. value: function getThemeInfo(params, callback) {
  76728. var me = this;
  76729. var themeService = new ThemeService_ThemeService(me.url, {
  76730. proxy: me.options.proxy,
  76731. withCredentials: me.options.withCredentials,
  76732. crossOrigin: me.options.crossOrigin,
  76733. headers: me.options.headers,
  76734. serverType: me.options.serverType,
  76735. eventListeners: {
  76736. scope: me,
  76737. processCompleted: callback,
  76738. processFailed: callback
  76739. }
  76740. });
  76741. themeService.processAsync(params);
  76742. }
  76743. }]);
  76744. return ThemeService;
  76745. }(ServiceBase);
  76746. (external_mapboxgl_default()).supermap.ThemeService = ThemeService;
  76747. ;// CONCATENATED MODULE: ./src/mapboxgl/services/TrafficTransferAnalystService.js
  76748. function TrafficTransferAnalystService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { TrafficTransferAnalystService_typeof = function _typeof(obj) { return typeof obj; }; } else { TrafficTransferAnalystService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return TrafficTransferAnalystService_typeof(obj); }
  76749. function TrafficTransferAnalystService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76750. 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); } }
  76751. function TrafficTransferAnalystService_createClass(Constructor, protoProps, staticProps) { if (protoProps) TrafficTransferAnalystService_defineProperties(Constructor.prototype, protoProps); if (staticProps) TrafficTransferAnalystService_defineProperties(Constructor, staticProps); return Constructor; }
  76752. 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 } }); if (superClass) TrafficTransferAnalystService_setPrototypeOf(subClass, superClass); }
  76753. function TrafficTransferAnalystService_setPrototypeOf(o, p) { TrafficTransferAnalystService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return TrafficTransferAnalystService_setPrototypeOf(o, p); }
  76754. 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); }; }
  76755. function TrafficTransferAnalystService_possibleConstructorReturn(self, call) { if (call && (TrafficTransferAnalystService_typeof(call) === "object" || typeof call === "function")) { return call; } return TrafficTransferAnalystService_assertThisInitialized(self); }
  76756. function TrafficTransferAnalystService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76757. function TrafficTransferAnalystService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  76758. function TrafficTransferAnalystService_getPrototypeOf(o) { TrafficTransferAnalystService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return TrafficTransferAnalystService_getPrototypeOf(o); }
  76759. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  76760. * This program are made available under the terms of the Apache License, Version 2.0
  76761. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76762. /**
  76763. * @class mapboxgl.supermap.TrafficTransferAnalystService
  76764. * @extends mapboxgl.supermap.ServiceBase
  76765. * @category iServer TrafficTransferAnalyst
  76766. * @classdesc 交通换乘分析服务类。
  76767. * @example
  76768. * new mapboxgl.supermap.TrafficTransferAnalystService(url)
  76769. * .queryStop(params,function(result){
  76770. * //doSomething
  76771. * })
  76772. * @param {string} url - 服务地址。
  76773. * @param {Object} option - 参数。
  76774. * @param {string} [options.proxy] - 服务代理地址。
  76775. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76776. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76777. * @param {Object} [options.headers] - 请求头。
  76778. * @param {SuperMap.ServerType} [options.serverType=SuperMap.ServerType.ISERVER] - 服务来源 ISERVER|IPORTAL|ONLINE。
  76779. */
  76780. var TrafficTransferAnalystService = /*#__PURE__*/function (_ServiceBase) {
  76781. TrafficTransferAnalystService_inherits(TrafficTransferAnalystService, _ServiceBase);
  76782. var _super = TrafficTransferAnalystService_createSuper(TrafficTransferAnalystService);
  76783. function TrafficTransferAnalystService(url, options) {
  76784. TrafficTransferAnalystService_classCallCheck(this, TrafficTransferAnalystService);
  76785. return _super.call(this, url, options);
  76786. }
  76787. /**
  76788. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.queryStop
  76789. * @description 站点查询服务。
  76790. * @param {SuperMap.StopQueryParameters} params - 查询相关参数类。
  76791. * @param {RequestCallback} callback - 回调函数。
  76792. */
  76793. TrafficTransferAnalystService_createClass(TrafficTransferAnalystService, [{
  76794. key: "queryStop",
  76795. value: function queryStop(params, callback) {
  76796. var me = this;
  76797. var stopQueryService = new StopQueryService(me.url, {
  76798. proxy: me.options.proxy,
  76799. withCredentials: me.options.withCredentials,
  76800. crossOrigin: me.options.crossOrigin,
  76801. headers: me.options.headers,
  76802. serverType: me.options.serverType,
  76803. eventListeners: {
  76804. scope: me,
  76805. processCompleted: callback,
  76806. processFailed: callback
  76807. }
  76808. });
  76809. stopQueryService.processAsync(params);
  76810. }
  76811. /**
  76812. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.analysisTransferPath
  76813. * @description 交通换乘线路查询服务。
  76814. * @param {SuperMap.TransferPathParameters} params - 查询相关参数类。
  76815. * @param {RequestCallback} callback - 回调函数。
  76816. */
  76817. }, {
  76818. key: "analysisTransferPath",
  76819. value: function analysisTransferPath(params, callback) {
  76820. var me = this;
  76821. var transferPathService = new TransferPathService(me.url, {
  76822. proxy: me.options.proxy,
  76823. withCredentials: me.options.withCredentials,
  76824. crossOrigin: me.options.crossOrigin,
  76825. headers: me.options.headers,
  76826. serverType: me.options.serverType,
  76827. eventListeners: {
  76828. scope: me,
  76829. processCompleted: callback,
  76830. processFailed: callback
  76831. }
  76832. });
  76833. transferPathService.processAsync(me._processParams(params));
  76834. }
  76835. /**
  76836. * @function mapboxgl.supermap.TrafficTransferAnalystService.prototype.analysisTransferSolution
  76837. * @description 交通换乘方案查询服务。
  76838. * @param {SuperMap.TransferSolutionParameters} params - 查询相关参数类。
  76839. * @param {RequestCallback} callback - 回调函数。
  76840. */
  76841. }, {
  76842. key: "analysisTransferSolution",
  76843. value: function analysisTransferSolution(params, callback) {
  76844. var me = this;
  76845. var transferSolutionService = new TransferSolutionService(me.url, {
  76846. proxy: me.options.proxy,
  76847. withCredentials: me.options.withCredentials,
  76848. crossOrigin: me.options.crossOrigin,
  76849. headers: me.options.headers,
  76850. serverType: me.options.serverType,
  76851. eventListeners: {
  76852. scope: me,
  76853. processCompleted: callback,
  76854. processFailed: callback
  76855. }
  76856. });
  76857. transferSolutionService.processAsync(me._processParams(params));
  76858. }
  76859. }, {
  76860. key: "_processParams",
  76861. value: function _processParams(params) {
  76862. if (!params) {
  76863. return {};
  76864. }
  76865. if (params.transferLines && !core_Util_Util.isArray(params.transferLines)) {
  76866. params.transferLines = [params.transferLines];
  76867. }
  76868. if (params.points && core_Util_Util.isArray(params.points)) {
  76869. params.points.map(function (point, key) {
  76870. params.points[key] = point instanceof (external_mapboxgl_default()).LngLat ? {
  76871. x: point.lng,
  76872. y: point.lat
  76873. } : point;
  76874. return params.points[key];
  76875. });
  76876. }
  76877. return params;
  76878. }
  76879. }]);
  76880. return TrafficTransferAnalystService;
  76881. }(ServiceBase);
  76882. (external_mapboxgl_default()).supermap.TrafficTransferAnalystService = TrafficTransferAnalystService;
  76883. ;// CONCATENATED MODULE: ./src/mapboxgl/services/WebPrintingJobService.js
  76884. function WebPrintingJobService_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebPrintingJobService_typeof = function _typeof(obj) { return typeof obj; }; } else { WebPrintingJobService_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebPrintingJobService_typeof(obj); }
  76885. function WebPrintingJobService_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  76886. 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); } }
  76887. function WebPrintingJobService_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebPrintingJobService_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebPrintingJobService_defineProperties(Constructor, staticProps); return Constructor; }
  76888. 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 } }); if (superClass) WebPrintingJobService_setPrototypeOf(subClass, superClass); }
  76889. function WebPrintingJobService_setPrototypeOf(o, p) { WebPrintingJobService_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebPrintingJobService_setPrototypeOf(o, p); }
  76890. 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); }; }
  76891. function WebPrintingJobService_possibleConstructorReturn(self, call) { if (call && (WebPrintingJobService_typeof(call) === "object" || typeof call === "function")) { return call; } return WebPrintingJobService_assertThisInitialized(self); }
  76892. function WebPrintingJobService_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  76893. function WebPrintingJobService_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  76894. function WebPrintingJobService_getPrototypeOf(o) { WebPrintingJobService_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebPrintingJobService_getPrototypeOf(o); }
  76895. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  76896. * This program are made available under the terms of the Apache License, Version 2.0
  76897. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  76898. /**
  76899. * @class mapboxgl.supermap.WebPrintingJobService
  76900. * @category iServer WebPrintingJob
  76901. * @version 10.1.0
  76902. * @classdesc Web 打印服务类。
  76903. * 提供:创建 Web 打印任务,获取 Web 打印任务内容,获取 Web 打印输出文档流,获取 Web 打印服务的布局模板信息。
  76904. * @extends {mapboxgl.supermap.ServiceBase}
  76905. * @param {string} url - 资源根地址。请求打印地图服务的 URL 应为:http://{服务器地址}:{服务端口号}/iserver/services/webprinting/rest/webprinting/v1。
  76906. * @param {Object} options - 服务交互时所需的可选参数。
  76907. * @param {string} [options.proxy] - 服务代理地址。
  76908. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  76909. * @param {boolean} [options.crossOrigin] - 是否允许跨域请求。
  76910. * @param {Object} [options.headers] - 请求头。
  76911. * @example
  76912. * new mapboxgl.supermap.WebPrintingJobService(url)
  76913. * .createWebPrintingJob(param,function(result){
  76914. * //doSomething
  76915. * })
  76916. */
  76917. var WebPrintingJobService = /*#__PURE__*/function (_ServiceBase) {
  76918. WebPrintingJobService_inherits(WebPrintingJobService, _ServiceBase);
  76919. var _super = WebPrintingJobService_createSuper(WebPrintingJobService);
  76920. function WebPrintingJobService(url, options) {
  76921. WebPrintingJobService_classCallCheck(this, WebPrintingJobService);
  76922. return _super.call(this, url, options);
  76923. }
  76924. /**
  76925. * @function mapboxgl.supermap.WebPrintingJobService.prototype.createWebPrintingJob
  76926. * @description 创建 Web 打印任务。
  76927. * @param {SuperMap.WebPrintingJobParameters} params - 打印的请求参数。
  76928. * @param {RequestCallback} callback - 回调函数。
  76929. */
  76930. WebPrintingJobService_createClass(WebPrintingJobService, [{
  76931. key: "createWebPrintingJob",
  76932. value: function createWebPrintingJob(params, callback) {
  76933. if (!params) {
  76934. return;
  76935. }
  76936. var me = this;
  76937. var webPrintingService = new WebPrintingService(me.url, {
  76938. proxy: me.options.proxy,
  76939. withCredentials: me.options.withCredentials,
  76940. crossOrigin: me.options.crossOrigin,
  76941. headers: me.options.headers,
  76942. serverType: me.options.serverType,
  76943. eventListeners: {
  76944. scope: me,
  76945. processCompleted: callback,
  76946. processFailed: callback
  76947. }
  76948. });
  76949. webPrintingService.createWebPrintingJob(me._processParams(params));
  76950. }
  76951. /**
  76952. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getPrintingJob
  76953. * @description 获取 Web 打印输出文档任务。
  76954. * @param {String} jobId - Web 打印输入文档任务 Id。
  76955. * @param {RequestCallback} callback - 回调函数。
  76956. */
  76957. }, {
  76958. key: "getPrintingJob",
  76959. value: function getPrintingJob(jobId, callback) {
  76960. var me = this;
  76961. var webPrintingService = new WebPrintingService(me.url, {
  76962. proxy: me.options.proxy,
  76963. withCredentials: me.options.withCredentials,
  76964. crossOrigin: me.options.crossOrigin,
  76965. headers: me.options.headers,
  76966. serverType: me.options.serverType,
  76967. eventListeners: {
  76968. scope: me,
  76969. processCompleted: callback,
  76970. processFailed: callback
  76971. }
  76972. });
  76973. webPrintingService.getPrintingJob(jobId);
  76974. }
  76975. /**
  76976. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getPrintingJobResult
  76977. * @description 获取 Web 打印任务的输出文档。
  76978. * @param {String} jobId - Web 打印输入文档任务 Id。
  76979. * @param {RequestCallback} callback - 回调函数。
  76980. */
  76981. }, {
  76982. key: "getPrintingJobResult",
  76983. value: function getPrintingJobResult(jobId, callback) {
  76984. var me = this;
  76985. var webPrintingService = new WebPrintingService(me.url, {
  76986. proxy: me.options.proxy,
  76987. withCredentials: me.options.withCredentials,
  76988. crossOrigin: me.options.crossOrigin,
  76989. headers: me.options.headers,
  76990. serverType: me.options.serverType,
  76991. eventListeners: {
  76992. scope: me,
  76993. processCompleted: callback,
  76994. processFailed: callback
  76995. }
  76996. });
  76997. webPrintingService.getPrintingJobResult(jobId);
  76998. }
  76999. /**
  77000. * @function mapboxgl.supermap.WebPrintingJobService.prototype.getLayoutTemplates
  77001. * @description 查询 Web 打印服务所有可用的模板信息。
  77002. * @param {RequestCallback} callback - 回调函数。
  77003. */
  77004. }, {
  77005. key: "getLayoutTemplates",
  77006. value: function getLayoutTemplates(callback) {
  77007. var me = this;
  77008. var webPrintingService = new WebPrintingService(me.url, {
  77009. proxy: me.options.proxy,
  77010. withCredentials: me.options.withCredentials,
  77011. crossOrigin: me.options.crossOrigin,
  77012. headers: me.options.headers,
  77013. serverType: me.options.serverType,
  77014. eventListeners: {
  77015. scope: me,
  77016. processCompleted: callback,
  77017. processFailed: callback
  77018. }
  77019. });
  77020. webPrintingService.getLayoutTemplates();
  77021. }
  77022. }, {
  77023. key: "_processParams",
  77024. value: function _processParams(params) {
  77025. if (params.layoutOptions && params.layoutOptions.littleMapOptions) {
  77026. params.layoutOptions.littleMapOptions.center = this._toPointObject(params.layoutOptions.littleMapOptions.center);
  77027. }
  77028. if (params.exportOptions) {
  77029. params.exportOptions.center = this._toPointObject(params.exportOptions.center);
  77030. }
  77031. return params;
  77032. }
  77033. }, {
  77034. key: "_toPointObject",
  77035. value: function _toPointObject(point) {
  77036. if (core_Util_Util.isArray(point)) {
  77037. return {
  77038. x: point[0],
  77039. y: point[1]
  77040. };
  77041. } else if (point instanceof SuperMap.Geometry.Point || point instanceof (external_mapboxgl_default()).Point) {
  77042. return {
  77043. x: point.x,
  77044. y: point.y
  77045. };
  77046. } else if (point instanceof (external_mapboxgl_default()).LngLat) {
  77047. return {
  77048. x: point.lng,
  77049. y: point.lat
  77050. };
  77051. }
  77052. return point;
  77053. }
  77054. }]);
  77055. return WebPrintingJobService;
  77056. }(ServiceBase);
  77057. (external_mapboxgl_default()).supermap.WebPrintingJobService = WebPrintingJobService;
  77058. ;// CONCATENATED MODULE: ./src/mapboxgl/services/index.js
  77059. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77060. * This program are made available under the terms of the Apache License, Version 2.0
  77061. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77062. ;// CONCATENATED MODULE: external "function(){try{return convert}catch(e){return {}}}()"
  77063. var external_function_try_return_convert_catch_e_return_namespaceObject = function(){try{return convert}catch(e){return {}}}();
  77064. var external_function_try_return_convert_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_convert_catch_e_return_namespaceObject);
  77065. ;// CONCATENATED MODULE: external "function(){try{return canvg}catch(e){return {}}}()"
  77066. var external_function_try_return_canvg_catch_e_return_namespaceObject = function(){try{return canvg}catch(e){return {}}}();
  77067. var external_function_try_return_canvg_catch_e_return_default = /*#__PURE__*/__webpack_require__.n(external_function_try_return_canvg_catch_e_return_namespaceObject);
  77068. ;// CONCATENATED MODULE: ./src/mapboxgl/mapping/WebMap.js
  77069. function WebMap_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { WebMap_typeof = function _typeof(obj) { return typeof obj; }; } else { WebMap_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return WebMap_typeof(obj); }
  77070. function WebMap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  77071. 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); } }
  77072. function WebMap_createClass(Constructor, protoProps, staticProps) { if (protoProps) WebMap_defineProperties(Constructor.prototype, protoProps); if (staticProps) WebMap_defineProperties(Constructor, staticProps); return Constructor; }
  77073. 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 } }); if (superClass) WebMap_setPrototypeOf(subClass, superClass); }
  77074. function WebMap_setPrototypeOf(o, p) { WebMap_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return WebMap_setPrototypeOf(o, p); }
  77075. 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); }; }
  77076. function WebMap_possibleConstructorReturn(self, call) { if (call && (WebMap_typeof(call) === "object" || typeof call === "function")) { return call; } return WebMap_assertThisInitialized(self); }
  77077. function WebMap_assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  77078. function WebMap_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
  77079. function WebMap_getPrototypeOf(o) { WebMap_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return WebMap_getPrototypeOf(o); }
  77080. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  77081. * This program are made available under the terms of the Apache License, Version 2.0
  77082. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  77083. (external_mapboxgl_default()).supermap = (external_mapboxgl_default()).supermap || {};
  77084. var MB_SCALEDENOMINATOR_3857 = ['559082264.0287178', '279541132.0143589', '139770566.0071794', '69885283.00358972', '34942641.50179486', '17471320.75089743', '8735660.375448715', '4367830.1877224357', '2183915.093862179', '1091957.546931089', '545978.7734655447', '272989.7734655447', '272989.3867327723', '136494.6933663862', '68247.34668319309', '34123.67334159654', '17061.83667079827', '8530.918335399136', '4265.459167699568', '2132.729583849784'];
  77085. var MB_SCALEDENOMINATOR_4326 = ['5.590822640287176E8', '2.795411320143588E8', '1.397705660071794E8', '6.98852830035897E7', '3.494264150179485E7', '1.7471320750897426E7', '8735660.375448713', '4367830.187724357', '2183915.0938621783', '1091957.5469310891', '545978.7734655446', '272989.3867327723', '136494.69336638614', '68247.34668319307', '34123.673341596535', '17061.836670798268', '8530.918335399134'];
  77086. var DEFAULT_WELLKNOWNSCALESET = ['GoogleCRS84Quad', 'GoogleMapsCompatible'];
  77087. /**
  77088. * @class mapboxgl.supermap.WebMap
  77089. * @version 9.1.2
  77090. * @category iPortal/Online
  77091. * @classdesc 对接 iPortal/Online 地图类。目前支持地图坐标系包括:'EPSG:3857','EPSG:4326','EPSG:4490','EPSG:4214','EPSG:4610'。
  77092. * <div style="padding: 20px;border: 1px solid #eee;border-left-width: 5px;border-radius: 3px;border-left-color: #ce4844;">
  77093. * <p style="color: #ce4844">Notice</p>
  77094. * <p style="font-size: 13px">该功能依赖 <a href='https://iclient.supermap.io/web/libs/geostats/geostats.js'>geostats</a> 和 <a href='https://iclient.supermap.io/web/libs/jsonsql/jsonsql.js'>JsonSql</a> 插件,请确认引入该插件。</p>
  77095. * `<script type="text/javascript" src="https://iclient.supermap.io/web/libs/geostats/geostats.js"></script>`</br>
  77096. * `<script type="text/javascript" src="https://iclient.supermap.io/web/libs/jsonsql/jsonsql.js"></script>`
  77097. * </div>
  77098. * @param {number} id - iPortal|Online 地图 ID。
  77099. * @param {Object} options - 参数。
  77100. * @param {string} [options.target='map'] - 地图容器 ID。
  77101. * @param {string} [options.server="https://www.supermapol.com"] - 地图的地址。
  77102. * @param {string} [options.credentialKey] - 凭证密钥。
  77103. * @param {string} [options.credentialValue] - 凭证值。
  77104. * @param {boolean} [options.withCredentials=false] - 请求是否携带 cookie。
  77105. * @param {boolean} [options.excludePortalProxyUrl] - server 传递过来的 URL 是否带有代理。
  77106. * @fires mapboxgl.supermap.WebMap#getmapfailed
  77107. * @fires mapboxgl.supermap.WebMap#getwmtsfailed
  77108. * @fires mapboxgl.supermap.WebMap#getlayersfailed
  77109. * @fires mapboxgl.supermap.WebMap#getfeaturesfailed
  77110. * @fires mapboxgl.supermap.WebMap#addlayerssucceeded
  77111. * @extends {mapboxgl.Evented}
  77112. */
  77113. var WebMap = /*#__PURE__*/function (_mapboxgl$Evented) {
  77114. WebMap_inherits(WebMap, _mapboxgl$Evented);
  77115. var _super = WebMap_createSuper(WebMap);
  77116. /**
  77117. * @constructs
  77118. * @version 9.1.2
  77119. */
  77120. function WebMap(id, options) {
  77121. var _this2;
  77122. WebMap_classCallCheck(this, WebMap);
  77123. _this2 = _super.call(this);
  77124. _this2.mapId = id;
  77125. options = options || {};
  77126. _this2.server = options.server || 'https://www.supermapol.com';
  77127. _this2.credentialKey = options.credentialKey;
  77128. _this2.credentialValue = options.credentialValue;
  77129. _this2.withCredentials = options.withCredentials || false;
  77130. _this2.target = options.target || 'map';
  77131. _this2._createWebMap();
  77132. return _this2;
  77133. }
  77134. /**
  77135. * @function mapboxgl.supermap.WebMap.prototype.resize
  77136. * @description map resize。
  77137. * @version 9.1.2
  77138. */
  77139. WebMap_createClass(WebMap, [{
  77140. key: "resize",
  77141. value: function resize() {
  77142. this.map.resize();
  77143. }
  77144. /**
  77145. * @function mapboxgl.supermap.WebMap.prototype.setMapId
  77146. * @param {string} mapId - webMap 地图 ID。
  77147. * @description 设置 WebMap ID。
  77148. * @version 9.1.2
  77149. */
  77150. }, {
  77151. key: "setMapId",
  77152. value: function setMapId(mapId) {
  77153. this.mapId = mapId;
  77154. this._createWebMap();
  77155. }
  77156. /**
  77157. * @function mapboxgl.supermap.WebMap.prototype.setWebMapOptions
  77158. * @param {Object} webMapOptions - webMap 参数。
  77159. * @description 设置 webMap 参数。
  77160. * @version 9.1.2
  77161. */
  77162. }, {
  77163. key: "setWebMapOptions",
  77164. value: function setWebMapOptions(webMapOptions) {
  77165. this.server = webMapOptions.server;
  77166. this._createWebMap();
  77167. }
  77168. /**
  77169. * @function mapboxgl.supermap.WebMap.prototype.setMapOptions
  77170. * @param {Object} mapOptions - map 参数。
  77171. * @description 设置 map 参数。
  77172. * @version 9.1.2
  77173. */
  77174. }, {
  77175. key: "setMapOptions",
  77176. value: function setMapOptions(mapOptions) {
  77177. var center = mapOptions.center,
  77178. zoom = mapOptions.zoom,
  77179. maxBounds = mapOptions.maxBounds,
  77180. minZoom = mapOptions.minZoom,
  77181. maxZoom = mapOptions.maxZoom,
  77182. isWorldCopy = mapOptions.isWorldCopy,
  77183. bearing = mapOptions.bearing,
  77184. pitch = mapOptions.pitch;
  77185. center && center.length && this.map.setCenter(center);
  77186. zoom && this.map.setZoom(zoom);
  77187. maxBounds && this.map.setMaxBounds(maxBounds);
  77188. minZoom && this.map.setMinZoom(minZoom);
  77189. maxZoom && this.map.setMaxZoom(maxZoom);
  77190. isWorldCopy && this.map.setRenderWorldCopies(isWorldCopy);
  77191. bearing && this.map.setBearing(bearing);
  77192. pitch && this.map.setPitch(pitch);
  77193. }
  77194. /**
  77195. * @private
  77196. * @function mapboxgl.supermap.WebMap.prototype._createWebMap
  77197. * @description 登陆窗口后添加地图图层。
  77198. */
  77199. }, {
  77200. key: "_createWebMap",
  77201. value: function _createWebMap() {
  77202. var urlArr = this.server.split('');
  77203. if (urlArr[urlArr.length - 1] !== '/') {
  77204. this.server += '/';
  77205. }
  77206. var mapUrl = this.server + 'web/maps/' + this.mapId + '/map';
  77207. if (this.credentialValue && this.credentialKey) {
  77208. mapUrl += '?' + this.credentialKey + '=' + this.credentialValue;
  77209. }
  77210. var filter = 'getUrlResource.json?url=';
  77211. if (this.excludePortalProxyUrl && this.server.indexOf(filter) > -1) {
  77212. //大屏需求,或者有加上代理的
  77213. var urlArray = this.server.split(filter);
  77214. if (urlArray.length > 1) {
  77215. mapUrl = urlArray[0] + filter + this.server + 'web/maps/' + this.mapId + '/map.json';
  77216. }
  77217. }
  77218. this._getMapInfo(mapUrl);
  77219. }
  77220. /**
  77221. * @private
  77222. * @function mapboxgl.supermap.WebMap.prototype._createMap
  77223. * @description 创建地图。
  77224. */
  77225. }, {
  77226. key: "_createMap",
  77227. value: function _createMap(mapInfo) {
  77228. // 获取字体样式
  77229. var fonts = [];
  77230. var layers = mapInfo.layers; // 获取 label 图层字体类型
  77231. if (layers && layers.length > 0) {
  77232. layers.forEach(function (layer) {
  77233. layer.labelStyle && fonts.push(layer.labelStyle.fontFamily);
  77234. }, this);
  77235. }
  77236. fonts.push("'supermapol-icons'");
  77237. var fontFamilys = fonts.join(','); // zoom center
  77238. var oldcenter = mapInfo.center,
  77239. zoom = mapInfo.level || 0,
  77240. center,
  77241. zoomBase = 0; // zoom = zoom === 0 ? 0 : zoom - 1;
  77242. if (mapInfo.minScale && mapInfo.maxScale) {
  77243. zoomBase = this._transformScaleToZoom(mapInfo.minScale, (external_mapboxgl_default()).CRS ? external_mapboxgl_default().CRS.get(this.baseProjection) : 'EPSG:3857');
  77244. } else {
  77245. var e = this._getResolution((external_mapboxgl_default()).CRS ? external_mapboxgl_default().CRS.get(this.baseProjection).getExtent() : [-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892]) / this._getResolution(mapInfo.extent);
  77246. zoomBase = +Math.log(e) / Math.LN2.toFixed(2);
  77247. }
  77248. zoom += zoomBase;
  77249. center = oldcenter ? this._unproject([oldcenter.x, oldcenter.y]) : new (external_mapboxgl_default()).LngLat(0, 0); // 初始化 map
  77250. this.map = new (external_mapboxgl_default()).Map({
  77251. container: this.target,
  77252. center: center,
  77253. zoom: zoom,
  77254. style: {
  77255. version: 8,
  77256. sources: {},
  77257. // "glyphs": 'https://iclient.supermap.io/iserver/services/map-beijing/rest/maps/beijingMap/tileFeature/sdffonts/{fontstack}/{range}.pbf',
  77258. layers: []
  77259. },
  77260. crs: this.baseProjection,
  77261. localIdeographFontFamily: fontFamilys || ''
  77262. });
  77263. this.fire('mapinitialized');
  77264. }
  77265. /**
  77266. * @private
  77267. * @function mapboxgl.supermap.WebMap.prototype._getMapInfo
  77268. * @description 获取地图的 JSON 信息。
  77269. * @param {string} url - 请求地图的 url。
  77270. */
  77271. }, {
  77272. key: "_getMapInfo",
  77273. value: function _getMapInfo(url) {
  77274. var _this3 = this;
  77275. var mapUrl = url.indexOf('.json') === -1 ? "".concat(url, ".json") : url;
  77276. FetchRequest.get(mapUrl, null, {
  77277. withCredentials: this.withCredentials
  77278. }).then(function (response) {
  77279. return response.json();
  77280. }).then(function (mapInfo) {
  77281. _this3.baseProjection = mapInfo.projection; //存储地图的名称以及描述等信息,返回给用户
  77282. _this3.mapParams = {
  77283. title: mapInfo.title,
  77284. description: mapInfo.description
  77285. };
  77286. var projectionMap = {
  77287. 'EPSG:4490': 'EPSG:4490',
  77288. 'EPSG:4214': 'EPSG:4214',
  77289. 'EPSG:4610': 'EPSG:4610',
  77290. 'EPSG:3857': 'EPSG:3857',
  77291. 'EPSG:4326': 'EPSG:4326'
  77292. }; // 坐标系异常处理
  77293. if (_this3.baseProjection in projectionMap) {
  77294. _this3._createMap(mapInfo, _this3.mapSetting);
  77295. var layers = mapInfo.layers;
  77296. _this3.map.on('load', function () {
  77297. _this3._addBaseMap(mapInfo);
  77298. if (!layers || layers.length === 0) {
  77299. _this3._sendMapToUser(0, 0);
  77300. } else {
  77301. _this3._addLayers(layers);
  77302. }
  77303. });
  77304. } else {
  77305. throw Error(Lang.i18n('msg_crsunsupport'));
  77306. }
  77307. })["catch"](function (error) {
  77308. /**
  77309. * @event mapboxgl.supermap.WebMap#getmapfailed
  77310. * @description 获取地图信息失败。
  77311. * @property {Object} error - 失败原因。
  77312. */
  77313. _this3.fire('getmapfailed', {
  77314. error: error
  77315. });
  77316. });
  77317. }
  77318. /**
  77319. * @private
  77320. * @function mapboxgl.supermap.WebMap.prototype._addBaseMap
  77321. * @description 添加底图。
  77322. * @param {Object} mapInfo - map 信息。
  77323. */
  77324. }, {
  77325. key: "_addBaseMap",
  77326. value: function _addBaseMap(mapInfo) {
  77327. this._createBaseLayer(mapInfo);
  77328. }
  77329. /**
  77330. * @private
  77331. * @function mapboxgl.supermap.WebMap.prototype._createBaseLayer
  77332. * @description 创建底图。
  77333. * @param {Object} mapInfo - map 信息。
  77334. */
  77335. }, {
  77336. key: "_createBaseLayer",
  77337. value: function _createBaseLayer(mapInfo) {
  77338. var layerInfo = mapInfo.baseLayer || mapInfo;
  77339. var layerType = layerInfo.layerType; //底图和rest地图兼容
  77340. if (layerType.indexOf('TIANDITU_VEC') > -1 || layerType.indexOf('TIANDITU_IMG') > -1 || layerType.indexOf('TIANDITU_TER') > -1) {
  77341. layerType = layerType.substr(0, 12);
  77342. }
  77343. var mapUrls = {
  77344. CLOUD: 'http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}',
  77345. CLOUD_BLACK: 'http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}',
  77346. OSM: 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  77347. GOOGLE: 'https://www.google.cn/maps/vt/pb=!1m4!1m3!1i{z}!2i{x}!3i{y}!2m3!1e0!2sm!3i380072576!3m8!2szh-CN!3scn!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0',
  77348. GOOGLE_CN: 'https://mt{0-3}.google.cn/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}',
  77349. JAPAN_STD: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
  77350. JAPAN_PALE: 'https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png',
  77351. JAPAN_RELIEF: 'https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png',
  77352. JAPAN_ORT: 'https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg'
  77353. },
  77354. url;
  77355. switch (layerType) {
  77356. case 'TIANDITU_VEC':
  77357. case 'TIANDITU_IMG':
  77358. case 'TIANDITU_TER':
  77359. this._createTiandituLayer(mapInfo);
  77360. break;
  77361. case 'BING':
  77362. this._createBingLayer(layerInfo.name);
  77363. break;
  77364. case 'WMS':
  77365. this._createWMSLayer(layerInfo);
  77366. break;
  77367. case 'WMTS':
  77368. this._createWMTSLayer(layerInfo);
  77369. break;
  77370. case 'TILE':
  77371. case 'SUPERMAP_REST':
  77372. this._createDynamicTiledLayer(layerInfo);
  77373. break;
  77374. case 'CLOUD':
  77375. case 'CLOUD_BLACK':
  77376. case 'OSM':
  77377. case 'JAPAN_ORT':
  77378. case 'JAPAN_RELIEF':
  77379. case 'JAPAN_PALE':
  77380. case 'JAPAN_STD':
  77381. case 'GOOGLE_CN':
  77382. case 'GOOGLE':
  77383. url = mapUrls[layerType];
  77384. this._createXYZLayer(layerInfo, url);
  77385. break;
  77386. case 'MAPBOXSTYLE':
  77387. this._createMapboxStyle(layerInfo);
  77388. break;
  77389. default:
  77390. break;
  77391. }
  77392. }
  77393. /**
  77394. * @private
  77395. * @function mapboxgl.supermap.WebMap.prototype._createMapboxStyle
  77396. * @description 创建 Mapbox 样式。
  77397. * @param {Object} mapInfo - map 信息。
  77398. */
  77399. }, {
  77400. key: "_createMapboxStyle",
  77401. value: function _createMapboxStyle(mapInfo) {
  77402. var _this = this,
  77403. _mapInfo$dataSource = mapInfo.dataSource,
  77404. dataSource = _mapInfo$dataSource === void 0 ? {} : _mapInfo$dataSource,
  77405. serverId = dataSource.serverId,
  77406. url = dataSource.url,
  77407. styleUrl;
  77408. styleUrl = serverId !== undefined ? "".concat(this.server, "web/datas/").concat(serverId, "/download") : url;
  77409. FetchRequest.get(styleUrl, null, {
  77410. withCredentials: this.withCredentials,
  77411. withoutFormatSuffix: true,
  77412. headers: {
  77413. 'Content-Type': 'application/json;chartset=uft-8'
  77414. }
  77415. }).then(function (response) {
  77416. return response.json();
  77417. }).then(function (style) {
  77418. _this._matchStyleObject(style);
  77419. _this.map.setStyle(style);
  77420. });
  77421. }
  77422. /**
  77423. * @private
  77424. * @function mapboxgl.supermap.WebMap.prototype._matchStyleObject
  77425. * @description 恢复 style 为标准格式。
  77426. * @param {Object} style - mapbox 样式。
  77427. */
  77428. }, {
  77429. key: "_matchStyleObject",
  77430. value: function _matchStyleObject(style) {
  77431. var sprite = style.sprite,
  77432. glyphs = style.glyphs;
  77433. if (sprite && WebMap_typeof(sprite) === 'object') {
  77434. style.sprite = Object.values(sprite)[0];
  77435. }
  77436. if (glyphs && WebMap_typeof(glyphs) === 'object') {
  77437. style.glyphs = Object.values(glyphs)[0];
  77438. }
  77439. }
  77440. /**
  77441. * @private
  77442. * @function mapboxgl.supermap.WebMap.prototype._createTiandituLayer
  77443. * @description 创建天地图底图。
  77444. * @param {Object} mapInfo - map 信息。
  77445. */
  77446. }, {
  77447. key: "_createTiandituLayer",
  77448. value: function _createTiandituLayer(mapInfo) {
  77449. var tiandituUrls = this._getTiandituUrl(mapInfo);
  77450. var layerType = mapInfo.baseLayer.layerType;
  77451. var isLabel = Boolean(mapInfo.baseLayer.labelLayerVisible);
  77452. var labelUrl = tiandituUrls['labelUrl'];
  77453. var tiandituUrl = tiandituUrls['tiandituUrl'];
  77454. this._addBaselayer(tiandituUrl, 'tianditu-layers-' + layerType);
  77455. isLabel && this._addBaselayer(labelUrl, 'tianditu-label-layers-' + layerType);
  77456. }
  77457. /**
  77458. * @private
  77459. * @function mapboxgl.supermap.WebMap.prototype._createWMTSLayer
  77460. * @description 创建 WMTS 底图。
  77461. * @param {Object} mapInfo - map 信息。
  77462. */
  77463. }, {
  77464. key: "_createWMTSLayer",
  77465. value: function _createWMTSLayer(layerInfo) {
  77466. var _this4 = this;
  77467. var wmtsUrl = this._getWMTSUrl(layerInfo);
  77468. this._filterWMTSIsMatched(layerInfo, function (isMatched, matchMaxZoom) {
  77469. isMatched && _this4._addBaselayer([wmtsUrl], 'wmts-layers' + layerInfo.name, 0, matchMaxZoom);
  77470. });
  77471. }
  77472. /**
  77473. * @private
  77474. * @function mapboxgl.supermap.WebMap.prototype._filterWMTSIsMatched
  77475. * @description 过滤能够跟mapboxgl匹配的wmts服务。
  77476. * @param {Object} mapInfo - map 信息。
  77477. * @callback matchedCallback
  77478. */
  77479. }, {
  77480. key: "_filterWMTSIsMatched",
  77481. value: function _filterWMTSIsMatched(mapInfo, matchedCallback) {
  77482. var _this5 = this;
  77483. var isMatched = false,
  77484. matchMaxZoom = 22,
  77485. url = mapInfo.url;
  77486. var options = {
  77487. withCredentials: false,
  77488. withoutFormatSuffix: true
  77489. };
  77490. FetchRequest.get(url, null, options).then(function (response) {
  77491. return response.text();
  77492. }).then(function (capabilitiesText) {
  77493. var converts = (external_function_try_return_convert_catch_e_return_default()) ? (external_function_try_return_convert_catch_e_return_default()) : window.convert;
  77494. var tileMatrixSet = JSON.parse(converts.xml2json(capabilitiesText, {
  77495. compact: true,
  77496. spaces: 4
  77497. })).Capabilities.Contents.TileMatrixSet;
  77498. if (!Array.isArray(tileMatrixSet)) {
  77499. tileMatrixSet = [tileMatrixSet];
  77500. }
  77501. for (var i = 0; i < tileMatrixSet.length; i++) {
  77502. if (tileMatrixSet[i]['ows:Identifier'] && tileMatrixSet[i]['ows:Identifier']['_text'] === mapInfo.tileMatrixSet) {
  77503. if (DEFAULT_WELLKNOWNSCALESET.indexOf(tileMatrixSet[i]['WellKnownScaleSet']['_text']) > -1) {
  77504. isMatched = true;
  77505. } else if (tileMatrixSet[i]['WellKnownScaleSet'] && tileMatrixSet[i]['WellKnownScaleSet']['_text'] === 'Custom') {
  77506. var matchedScaleDenominator = []; //坐标系判断
  77507. var defaultCRSScaleDenominators = _this5.map.crs === 'EPSG:3857' ? MB_SCALEDENOMINATOR_3857 : MB_SCALEDENOMINATOR_4326;
  77508. for (var j = 0, len = defaultCRSScaleDenominators.length; j < len; j++) {
  77509. if (!tileMatrixSet[i].TileMatrix[j]) {
  77510. break;
  77511. }
  77512. if (defaultCRSScaleDenominators[j] !== tileMatrixSet[i].TileMatrix[j]['ScaleDenominator']['_text']) {
  77513. break;
  77514. }
  77515. matchedScaleDenominator.push(defaultCRSScaleDenominators[j]);
  77516. }
  77517. matchMaxZoom = matchedScaleDenominator.length - 1;
  77518. if (matchedScaleDenominator.length !== 0) {
  77519. isMatched = true;
  77520. } else {
  77521. throw Error(Lang.i18n('msg_tilematrixsetunsupport'));
  77522. }
  77523. } else {
  77524. throw Error(Lang.i18n('msg_tilematrixsetunsupport'));
  77525. }
  77526. }
  77527. }
  77528. matchedCallback(isMatched, matchMaxZoom);
  77529. })["catch"](function (error) {
  77530. /**
  77531. * @event mapboxgl.supermap.WebMap#getwmtsfailed
  77532. * @description 获取 WMTS 图层信息失败。
  77533. * @property {Object} error - 失败原因。
  77534. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  77535. */
  77536. _this5.fire('getwmtsfailed', {
  77537. error: error,
  77538. map: _this5.map
  77539. });
  77540. });
  77541. }
  77542. /**
  77543. * @private
  77544. * @function mapboxgl.supermap.WebMap.prototype._createBingLayer
  77545. * @description 创建 Bing 图层。
  77546. */
  77547. }, {
  77548. key: "_createBingLayer",
  77549. value: function _createBingLayer(layerName) {
  77550. var bingUrl = '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';
  77551. this.addLayer([bingUrl], 'bing-layers-' + layerName);
  77552. }
  77553. /**
  77554. * @private
  77555. * @function mapboxgl.supermap.WebMap.prototype._createXYZLayer
  77556. * @description 创建 XYZ 底图。
  77557. * @param {String} url - url 地址。
  77558. */
  77559. }, {
  77560. key: "_createXYZLayer",
  77561. value: function _createXYZLayer(layerInfo, url) {
  77562. var urlArr = [];
  77563. if (layerInfo.layerType === 'OSM') {
  77564. var res = url.match(/\w\-\w/g)[0];
  77565. var start = res[0];
  77566. var end = res[2];
  77567. var alphabet = '';
  77568. for (var i = 97; i < 123; i++) {
  77569. alphabet += String.fromCharCode(i);
  77570. }
  77571. var alphabetArr = alphabet.split('');
  77572. var startIndex = alphabetArr.indexOf(start);
  77573. var endIndex = alphabetArr.indexOf(end);
  77574. var res3 = alphabetArr.slice(startIndex, endIndex + 1);
  77575. for (var _i = 0; _i < res3.length; _i++) {
  77576. var replaceRes = url.replace(/{\w\-\w}/g, res3[_i]);
  77577. urlArr.push(replaceRes);
  77578. }
  77579. } else if (layerInfo.layerType === 'GOOGLE_CN') {
  77580. var _res = url.match(/\d\-\d/g)[0];
  77581. var _start = _res[0];
  77582. var _end = _res[2];
  77583. for (var _i2 = _start; _i2 <= _end; _i2++) {
  77584. var _replaceRes = url.replace(/{\d\-\d}/g, _i2);
  77585. urlArr.push(_replaceRes);
  77586. }
  77587. } else {
  77588. urlArr = [url];
  77589. }
  77590. this._addBaselayer(urlArr, 'XYZ-layers-' + layerInfo.name);
  77591. }
  77592. /**
  77593. * @private
  77594. * @function mapboxgl.supermap.WebMap.prototype._createDynamicTiledLayer
  77595. * @description 创建 iserver 底图。
  77596. * @param {Object} layerInfo - 图层信息。
  77597. */
  77598. }, {
  77599. key: "_createDynamicTiledLayer",
  77600. value: function _createDynamicTiledLayer(layerInfo) {
  77601. var url = layerInfo.url;
  77602. var layerId = layerInfo.layerID || layerInfo.name;
  77603. var minzoom = layerInfo.minzoom,
  77604. maxzoom = layerInfo.maxzoom;
  77605. this._addBaselayer([url], layerId, minzoom, maxzoom, true);
  77606. }
  77607. /**
  77608. * @private
  77609. * @function mapboxgl.supermap.WebMap.prototype._createWMSLayer
  77610. * @description 创建 WMS 图层。
  77611. * @param {Object} mapInfo - map 信息。
  77612. */
  77613. }, {
  77614. key: "_createWMSLayer",
  77615. value: function _createWMSLayer(layerInfo) {
  77616. var WMSUrl = this._getWMSUrl(layerInfo);
  77617. this._addBaselayer([WMSUrl], 'WMS-layers-' + layerInfo.name);
  77618. }
  77619. /**
  77620. * @private
  77621. * @function mapboxgl.supermap.WebMap.prototype._createVectorLayer
  77622. * @description 创建 Vector 图层。
  77623. * @param {Object} layerInfo - map 信息。
  77624. * @param {Array} features - 属性 信息。
  77625. */
  77626. }, {
  77627. key: "_createVectorLayer",
  77628. value: function _createVectorLayer(layerInfo, features) {
  77629. var style = layerInfo.style;
  77630. var type = layerInfo.featureType;
  77631. var layerID = layerInfo.layerID;
  77632. var visible = layerInfo.visible;
  77633. var layerStyle = {};
  77634. layerStyle.style = this._transformStyleToMapBoxGl(style, type);
  77635. layerStyle.layout = {
  77636. visibility: visible
  77637. };
  77638. var source = {
  77639. type: 'geojson',
  77640. data: {
  77641. type: 'FeatureCollection',
  77642. features: features
  77643. }
  77644. };
  77645. this._addOverlayToMap(type, source, layerID, layerStyle); // 如果面有边框
  77646. type === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeLine', visible);
  77647. }
  77648. /**
  77649. * @function mapboxgl.supermap.WebMap.prototype._getTiandituUrl
  77650. * @private
  77651. * @description 创建天地图url;
  77652. * @param {Object} mapInfo - map 信息。
  77653. */
  77654. }, {
  77655. key: "_getTiandituUrl",
  77656. value: function _getTiandituUrl(mapInfo) {
  77657. var re = /t0/gi;
  77658. var tiandituUrls = {};
  77659. var layerType = mapInfo.baseLayer.layerType.split('_')[1].toLowerCase();
  77660. var isLabel = Boolean(mapInfo.baseLayer.labelLayerVisible); // let isLabel = true;
  77661. var url = 'https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?';
  77662. var labelUrl = url;
  77663. var layerLabelMap = {
  77664. vec: 'cva',
  77665. ter: 'cta',
  77666. img: 'cia'
  77667. };
  77668. var tilematrixSet = this.baseProjection === 'EPSG:4326' ? 'c' : 'w';
  77669. var options = {
  77670. service: 'WMTS',
  77671. request: 'GetTile',
  77672. style: 'default',
  77673. version: '1.0.0',
  77674. layer: layerType,
  77675. tilematrixSet: tilematrixSet,
  77676. format: 'tiles',
  77677. width: 256,
  77678. height: 256
  77679. };
  77680. url += this._getParamString(options, url) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  77681. var tiandituUrl = url.replace('{layer}', layerType).replace('{proj}', tilematrixSet);
  77682. var tiandituUrlArr = [];
  77683. for (var i = 0; i < 8; i++) {
  77684. tiandituUrlArr.push(tiandituUrl.replace(re, "t".concat(i)));
  77685. }
  77686. tiandituUrls['tiandituUrl'] = tiandituUrlArr; // 如果有 label 图层
  77687. if (isLabel) {
  77688. var labelLayer = layerLabelMap[layerType];
  77689. options.layer = labelLayer;
  77690. labelUrl += this._getParamString(options, labelUrl) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  77691. labelUrl = labelUrl.replace('{layer}', labelLayer).replace('{proj}', tilematrixSet);
  77692. var labelUrlArr = [];
  77693. for (var _i3 = 0; _i3 < 8; _i3++) {
  77694. labelUrlArr.push(labelUrl.replace(re, "t".concat(_i3)));
  77695. }
  77696. tiandituUrls['labelUrl'] = labelUrlArr;
  77697. }
  77698. return tiandituUrls;
  77699. }
  77700. /**
  77701. * @function mapboxgl.supermap.WebMap.prototype._getWMSUrl
  77702. * @private
  77703. * @description 创建 WMS url;
  77704. * @param {Object} mapInfo - map 信息。
  77705. */
  77706. }, {
  77707. key: "_getWMSUrl",
  77708. value: function _getWMSUrl(mapInfo) {
  77709. var url = mapInfo.url;
  77710. url = url.split('?')[0];
  77711. var strArr = url.split('/');
  77712. var options = {
  77713. service: 'WMS',
  77714. request: 'GetMap',
  77715. layers: strArr[strArr.length - 1],
  77716. styles: '',
  77717. format: 'image/png',
  77718. transparent: 'true',
  77719. version: '1.1.1',
  77720. width: 256,
  77721. height: 256,
  77722. srs: this.baseProjection
  77723. };
  77724. var bbox = this.baseProjection === 'EPSG:4326' ? '{bbox-epsg-4326}' : '{bbox-epsg-3857}';
  77725. url += this._getParamString(options, url) + "&bbox=".concat(bbox);
  77726. return url;
  77727. }
  77728. /**
  77729. * @private
  77730. * @function mapboxgl.supermap.WebMap.prototype._addLayers
  77731. * @description 添加叠加图层。
  77732. * @param {Object} mapInfo - 图层信息。
  77733. */
  77734. }, {
  77735. key: "_addLayers",
  77736. value: function _addLayers(layers) {
  77737. var _this6 = this;
  77738. //存储地图上所有的图层对象
  77739. this.layers = layers;
  77740. var features,
  77741. layerAdded = 0,
  77742. len = layers.length;
  77743. layers.forEach(function (layer, index) {
  77744. if (layer.dataSource && layer.dataSource.serverId || layer.layerType === 'MARKER') {
  77745. // 获取 serverID
  77746. var serverId = layer.dataSource ? layer.dataSource.serverId : layer.serverId;
  77747. var url = "".concat(_this6.server, "web/datas/").concat(serverId, "/content.json?pageSize=9999999&currentPage=1"); // 获取图层数据
  77748. serverId && FetchRequest.get(url, null, {
  77749. withCredentials: _this6.withCredentials
  77750. }).then(function (response) {
  77751. return response.json();
  77752. }).then(function (data) {
  77753. if (data.succeed === false) {
  77754. //请求失败
  77755. layerAdded++;
  77756. _this6._sendMapToUser(layerAdded, len);
  77757. /**
  77758. * @event mapboxgl.supermap.WebMap#getlayersfailed
  77759. * @description 获取图层信息失败。
  77760. * @property {Object} error - 失败原因。
  77761. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  77762. */
  77763. _this6.fire('getlayersfailed', {
  77764. error: data.error,
  77765. map: _this6.map
  77766. });
  77767. return;
  77768. }
  77769. if (data.type) {
  77770. if (data.type === 'JSON' || data.type === 'GEOJSON') {
  77771. data.content = JSON.parse(data.content.trim());
  77772. features = _this6._formatGeoJSON(data.content, layer);
  77773. } else if (data.type === 'EXCEL' || data.type === 'CSV') {
  77774. features = _this6._excelData2Feature(data.content, layer);
  77775. }
  77776. _this6._addLayer(layer, features, index);
  77777. layerAdded++;
  77778. _this6._sendMapToUser(layerAdded, len);
  77779. }
  77780. })["catch"](function (error) {
  77781. layerAdded++;
  77782. _this6._sendMapToUser(layerAdded, len);
  77783. _this6.fire('getlayersfailed', {
  77784. error: error,
  77785. map: _this6.map
  77786. });
  77787. });
  77788. } else if (layer.layerType === 'SUPERMAP_REST' || layer.layerType === 'TILE' || layer.layerType === 'WMS' || layer.layerType === 'WMTS') {
  77789. _this6._createBaseLayer(layer);
  77790. layerAdded++;
  77791. _this6._sendMapToUser(layerAdded, len);
  77792. } else if (layer.dataSource && layer.dataSource.type === 'REST_DATA') {
  77793. var dataSource = layer.dataSource; //从restData获取数据
  77794. _this6._getFeatureBySQL(dataSource.url, [dataSource.dataSourseName || layer.name], function (result) {
  77795. features = _this6._parseGeoJsonData2Feature({
  77796. allDatas: {
  77797. features: result.result.features.features
  77798. },
  77799. fileCode: layer.projection,
  77800. featureProjection: _this6.baseProjection
  77801. });
  77802. _this6._addLayer(layer, features, index);
  77803. layerAdded++;
  77804. _this6._sendMapToUser(layerAdded, len);
  77805. }, function (err) {
  77806. layerAdded++;
  77807. _this6._sendMapToUser(layerAdded, len);
  77808. /**
  77809. * @event mapboxgl.supermap.WebMap#getfeaturesfailed
  77810. * @description 获取图层要素失败。
  77811. * @property {Object} error - 失败原因。
  77812. */
  77813. _this6.fire('getfeaturesfailed', {
  77814. error: err
  77815. });
  77816. });
  77817. } else if (layer.dataSource && layer.dataSource.type === 'REST_MAP' && layer.dataSource.url) {
  77818. _this6._queryFeatureBySQL(layer.dataSource.url, layer.dataSource.layerName, 'smid=1', null, null, function (result) {
  77819. var recordsets = result && result.result.recordsets;
  77820. var recordset = recordsets && recordsets[0];
  77821. var attributes = recordset.fields;
  77822. if (recordset && attributes) {
  77823. var fileterAttrs = [];
  77824. for (var i in attributes) {
  77825. var value = attributes[i];
  77826. if (value.indexOf('Sm') !== 0 || value === 'SmID') {
  77827. fileterAttrs.push(value);
  77828. }
  77829. }
  77830. _this6._getFeatures(fileterAttrs, layer, function (features) {
  77831. _this6._addLayer(layer, features, index);
  77832. layerAdded++;
  77833. _this6._sendMapToUser(layerAdded, len);
  77834. }, function (err) {
  77835. layerAdded++;
  77836. _this6.fire('getfeaturesfailed', {
  77837. error: err,
  77838. map: _this6.map
  77839. });
  77840. });
  77841. }
  77842. }, function (err) {
  77843. _this6.fire('getlayersfailed', {
  77844. error: err,
  77845. map: _this6.map
  77846. });
  77847. });
  77848. }
  77849. }, this);
  77850. }
  77851. /**
  77852. * @private
  77853. * @function mapboxgl.supermap.WebMap.prototype._getFeatures
  77854. * @description 将单个图层添加到地图上。
  77855. * @param layerInfo 某个图层的图层信息
  77856. * @param {Array.<GeoJSON>} features - feature。
  77857. */
  77858. }, {
  77859. key: "_getFeatures",
  77860. value: function _getFeatures(fields, layerInfo, resolve, reject) {
  77861. var _this7 = this;
  77862. var source = layerInfo.dataSource; //示例数据
  77863. var fileCode = layerInfo.projection;
  77864. this._queryFeatureBySQL(source.url, source.layerName, null, fields, null, function (result) {
  77865. var recordsets = result.result.recordsets[0];
  77866. var features = recordsets.features.features;
  77867. var featuresObj = _this7._parseGeoJsonData2Feature({
  77868. allDatas: {
  77869. features: features
  77870. },
  77871. fileCode: fileCode,
  77872. featureProjection: _this7.baseProjection
  77873. }, 'JSON');
  77874. resolve(featuresObj);
  77875. }, function (err) {
  77876. reject(err);
  77877. });
  77878. }
  77879. /**
  77880. * @private
  77881. * @function mapboxgl.supermap.WebMap.prototype._addLayer
  77882. * @description 将单个图层添加到地图上。
  77883. * @param layerInfo 某个图层的图层信息
  77884. * @param {Array.<GeoJSON>} features - feature。
  77885. */
  77886. }, {
  77887. key: "_addLayer",
  77888. value: function _addLayer(layerInfo, features, index) {
  77889. var layerType = layerInfo.layerType;
  77890. layerInfo.layerID = layerType + '-' + layerInfo.name + '-' + index;
  77891. layerInfo.visible = layerInfo.visible ? 'visible' : 'none'; // mbgl 目前不能处理 geojson 复杂面情况
  77892. // mbgl isssue https://github.com/mapbox/mapbox-gl-js/issues/7023
  77893. if (features[0] && features[0].geometry.type === 'Polygon') {
  77894. features = this._handleMultyPolygon(features);
  77895. }
  77896. if (layerInfo.style && layerInfo.filterCondition) {
  77897. //将 feature 根据过滤条件进行过滤, 分段专题图和单值专题图因为要计算 styleGroup 所以暂时不过滤
  77898. if (layerType !== 'RANGE' && layerType !== 'UNIQUE') {
  77899. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  77900. }
  77901. }
  77902. if (layerType === 'VECTOR') {
  77903. if (layerInfo.featureType === 'POINT') {
  77904. if (layerInfo.style.type === 'SYMBOL_POINT') {
  77905. this._createSymbolLayer(layerInfo, features);
  77906. } else {
  77907. this._createGraphicLayer(layerInfo, features);
  77908. }
  77909. } else {
  77910. //线和面
  77911. this._createVectorLayer(layerInfo, features);
  77912. }
  77913. } else if (layerType === 'UNIQUE') {
  77914. this._createUniqueLayer(layerInfo, features);
  77915. } else if (layerType === 'RANGE') {
  77916. this._createRangeLayer(layerInfo, features);
  77917. } else if (layerType === 'HEAT') {
  77918. this._createHeatLayer(layerInfo, features);
  77919. } else if (layerType === 'MARKER') {
  77920. this._createMarkerLayer(layerInfo, features);
  77921. }
  77922. if (layerInfo.labelStyle && layerInfo.labelStyle.labelField) {
  77923. // 存在标签专题图
  77924. this._addLabelLayer(layerInfo, features);
  77925. }
  77926. }
  77927. /**
  77928. * @private
  77929. * @function mapboxgl.supermap.WebMap.prototype._addLabelLayer
  77930. * @description 添加标签图层。
  77931. * @param layerInfo 某个图层的图层信息。
  77932. * @param {Array.<GeoJSON>} features - feature。
  77933. */
  77934. }, {
  77935. key: "_addLabelLayer",
  77936. value: function _addLabelLayer(layerInfo, features) {
  77937. var labelStyle = layerInfo.labelStyle;
  77938. this.map.addLayer({
  77939. id: layerInfo.layerID + 'label',
  77940. type: 'symbol',
  77941. source: {
  77942. type: 'geojson',
  77943. data: {
  77944. type: 'FeatureCollection',
  77945. features: features
  77946. }
  77947. },
  77948. paint: {
  77949. 'text-color': labelStyle.fill
  77950. },
  77951. layout: {
  77952. 'text-field': "{".concat(labelStyle.labelField, "}"),
  77953. 'text-size': parseFloat(labelStyle.fontSize) || 12,
  77954. 'text-offset': labelStyle.offsetX ? [labelStyle.offsetX / 10 || 0, labelStyle.offsetY / 10 || 0] : [0, -1.5],
  77955. 'text-font': ['DIN Offc Pro Italic', 'Arial Unicode MS Regular'],
  77956. visibility: layerInfo.visible
  77957. }
  77958. });
  77959. }
  77960. /**
  77961. * @private
  77962. * @function mapboxgl.supermap.WebMap.prototype._createSymbolLayer
  77963. * @description 添加 symbol 图层。
  77964. * @param layerInfo 某个图层的图层信息。
  77965. * @param {Array.<GeoJSON>} features - feature。
  77966. */
  77967. }, {
  77968. key: "_createSymbolLayer",
  77969. value: function _createSymbolLayer(layerInfo, features) {
  77970. //用来请求symbol_point字体文件
  77971. var target = document.getElementById("".concat(this.target));
  77972. target.classList.add('supermapol-icons-map');
  77973. var style = layerInfo.style;
  77974. var unicode = layerInfo.style.unicode;
  77975. var text = String.fromCharCode(parseInt(unicode.replace(/^&#x/, ''), 16));
  77976. var layerID = layerInfo.layerID;
  77977. this.map.addSource(layerID + '-source', {
  77978. type: 'geojson',
  77979. data: {
  77980. type: 'FeatureCollection',
  77981. features: []
  77982. }
  77983. });
  77984. this.map.addLayer({
  77985. id: layerID,
  77986. type: 'symbol',
  77987. source: layerID + '-source',
  77988. paint: {
  77989. 'text-color': style.fillColor
  77990. },
  77991. layout: {
  77992. 'text-field': text,
  77993. 'text-font': ['DIN Offc Pro Italic', 'Arial Unicode MS Regular'],
  77994. visibility: layerInfo.visible
  77995. }
  77996. });
  77997. this.map.getSource(layerID + '-source').setData({
  77998. type: 'FeatureCollection',
  77999. features: features
  78000. });
  78001. }
  78002. /**
  78003. * @private
  78004. * @function mapboxgl.supermap.WebMap.prototype._createGraphicLayer
  78005. * @description 创建 Graphic 图层。
  78006. * @param {Object} layerInfo - map 信息。
  78007. * @param {Array} features - 属性 信息。
  78008. */
  78009. }, {
  78010. key: "_createGraphicLayer",
  78011. value: function _createGraphicLayer(layerInfo, features) {
  78012. var _this8 = this;
  78013. var style = layerInfo.style;
  78014. var layerStyle = {};
  78015. var layerID = layerInfo.layerID;
  78016. var source = {
  78017. type: 'geojson',
  78018. data: {
  78019. type: 'FeatureCollection',
  78020. features: features
  78021. }
  78022. };
  78023. if (style.type === 'IMAGE_POINT') {
  78024. var imageInfo = style.imageInfo;
  78025. var imgDom = imageInfo.img;
  78026. if (!imgDom || !imgDom.src) {
  78027. //要组装成完整的url
  78028. imageInfo.url = this.server + imageInfo.url;
  78029. }
  78030. this.map.loadImage(imageInfo.url || imgDom.src, function (error, image) {
  78031. if (error) {
  78032. console.log(error);
  78033. }
  78034. var iconSize = Number.parseFloat((style.radius / image.height).toFixed(2)) * 2;
  78035. _this8.map.addImage('imageIcon', image);
  78036. _this8.map.addLayer({
  78037. id: layerID,
  78038. type: 'symbol',
  78039. source: source,
  78040. layout: {
  78041. 'icon-image': 'imageIcon',
  78042. 'icon-size': iconSize,
  78043. visibility: layerInfo.visible
  78044. }
  78045. });
  78046. });
  78047. } else if (style.type === 'SVG_POINT') {
  78048. var svg_url = style.url;
  78049. if (!this.svgDiv) {
  78050. this.svgDiv = document.createElement('div');
  78051. document.body.appendChild(this.svgDiv);
  78052. }
  78053. this._getCanvasFromSVG(svg_url, this.svgDiv, function (canvas) {
  78054. var imgUrl = canvas.toDataURL('img/png');
  78055. imgUrl && _this8.map.loadImage(imgUrl, function (error, image) {
  78056. if (error) {
  78057. console.log(error);
  78058. }
  78059. var iconSize = Number.parseFloat((style.radius / canvas.width).toFixed(2));
  78060. _this8.map.addImage('imageIcon', image);
  78061. _this8.map.addLayer({
  78062. id: layerID,
  78063. type: 'symbol',
  78064. source: source,
  78065. layout: {
  78066. 'icon-image': 'imageIcon',
  78067. 'icon-size': iconSize,
  78068. visibility: layerInfo.visible
  78069. }
  78070. });
  78071. }, _this8);
  78072. });
  78073. } else {
  78074. layerStyle.style = this._transformStyleToMapBoxGl(style, layerInfo.featureType);
  78075. layerStyle.layout = {
  78076. visibility: layerInfo.visible
  78077. };
  78078. this._addOverlayToMap('POINT', source, layerID, layerStyle);
  78079. }
  78080. }
  78081. /**
  78082. * @private
  78083. * @function mapboxgl.supermap.WebMap.prototype._createUniqueLayer
  78084. * @description 创建单值图层。
  78085. * @param layerInfo 某个图层的图层信息
  78086. * @param features 图层上的 feature
  78087. */
  78088. }, {
  78089. key: "_createUniqueLayer",
  78090. value: function _createUniqueLayer(layerInfo, features) {
  78091. var styleGroup = this._getUniqueStyleGroup(layerInfo, features);
  78092. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  78093. var style = layerInfo.style;
  78094. var layerStyle = {};
  78095. var themeField = layerInfo.themeSetting.themeField;
  78096. var type = layerInfo.featureType;
  78097. var expression = ['match', ['get', 'index']];
  78098. var layerID = layerInfo.layerID;
  78099. features.forEach(function (row) {
  78100. styleGroup.forEach(function (item) {
  78101. if (item.value === row.properties[themeField]) {
  78102. expression.push(row.properties['index'], item.color);
  78103. }
  78104. });
  78105. });
  78106. expression.push('#ffffff');
  78107. layerStyle.style = this._transformStyleToMapBoxGl(style, type, expression);
  78108. var visible = layerInfo.visible;
  78109. layerStyle.layout = {
  78110. visibility: visible
  78111. };
  78112. var source = {
  78113. type: 'geojson',
  78114. data: {
  78115. type: 'FeatureCollection',
  78116. features: features
  78117. }
  78118. };
  78119. this._addOverlayToMap(type, source, layerID, layerStyle);
  78120. type === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeLine', visible);
  78121. }
  78122. /**
  78123. * @private
  78124. * @function mapboxgl.supermap.WebMap.prototype._getUniqueStyleGroup
  78125. * @description 获取单值的目标字段与颜色的对应数组。
  78126. * @param layerInfo 某个图层的图层信息
  78127. * @param features 图层上的 feature
  78128. */
  78129. }, {
  78130. key: "_getUniqueStyleGroup",
  78131. value: function _getUniqueStyleGroup(parameters, features) {
  78132. // 找出所有的单值
  78133. var featureType = parameters.featureType,
  78134. style = parameters.style,
  78135. themeSetting = parameters.themeSetting;
  78136. var fieldName = themeSetting.themeField,
  78137. colors = themeSetting.colors;
  78138. var names = [],
  78139. customSettings = themeSetting.customSettings;
  78140. for (var i in features) {
  78141. var properties = features[i].properties;
  78142. var name = properties[fieldName];
  78143. var isSaved = false;
  78144. for (var j in names) {
  78145. if (names[j] === name) {
  78146. isSaved = true;
  78147. break;
  78148. }
  78149. }
  78150. if (!isSaved) {
  78151. names.push(name);
  78152. }
  78153. } //获取一定量的颜色
  78154. var curentColors = colors || this.defaultParameters.colors;
  78155. curentColors = ColorsPickerUtil.getGradientColors(curentColors, names.length); //生成styleGroup
  78156. var styleGroup = [];
  78157. names.forEach(function (name, index) {
  78158. var color = curentColors[index];
  78159. if (name in customSettings) {
  78160. color = customSettings[name];
  78161. }
  78162. if (featureType === 'LINE') {
  78163. style.strokeColor = color;
  78164. } else {
  78165. style.fillColor = color;
  78166. }
  78167. styleGroup.push({
  78168. color: color,
  78169. value: name
  78170. });
  78171. }, this);
  78172. return styleGroup;
  78173. }
  78174. /**
  78175. * @private
  78176. * @function mapboxgl.supermap.WebMap.prototype._getWMTSUrl
  78177. * @description 根据传入的配置信息拼接wmts url。
  78178. * @param options 配置对象
  78179. */
  78180. }, {
  78181. key: "_getWMTSUrl",
  78182. value: function _getWMTSUrl(options) {
  78183. var obj = {
  78184. service: 'WMTS',
  78185. request: 'GetTile',
  78186. version: '1.0.0',
  78187. style: 'default',
  78188. layer: options.layer,
  78189. tilematrixSet: options.tileMatrixSet,
  78190. format: 'image/png'
  78191. };
  78192. var url = options.url;
  78193. url += this._getParamString(obj, url) + '&tilematrix={z}&tilerow={y}&tilecol={x}';
  78194. return url;
  78195. }
  78196. /**
  78197. * @private
  78198. * @function mapboxgl.supermap.WebMap.prototype._createMarkerLayer
  78199. * @description 添加标记图层。
  78200. * @param {Array.<GeoJSON>} features - feature。
  78201. */
  78202. }, {
  78203. key: "_createMarkerLayer",
  78204. value: function _createMarkerLayer(layerInfo, features) {
  78205. var _this9 = this;
  78206. features && features.forEach(function (feature) {
  78207. var geomType = feature.geometry.type.toUpperCase();
  78208. var defaultStyle = feature.dv_v5_markerStyle;
  78209. if (geomType === 'POINT' && defaultStyle.text) {
  78210. //说明是文字的feature类型
  78211. geomType = 'TEXT';
  78212. }
  78213. var featureInfo = _this9.setFeatureInfo(feature);
  78214. feature.properties['useStyle'] = defaultStyle;
  78215. feature.properties['featureInfo'] = featureInfo;
  78216. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('http://') === -1 && defaultStyle.src.indexOf('https://') === -1) {
  78217. //说明地址不完整
  78218. defaultStyle.src = _this9.server + defaultStyle.src;
  78219. }
  78220. var source = {
  78221. type: 'geojson',
  78222. data: feature
  78223. };
  78224. var index = feature.properties.index;
  78225. var layerID = geomType + '-' + index; // image-marker
  78226. geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('svg') <= -1 && _this9.map.loadImage(defaultStyle.src, function (error, image) {
  78227. if (error) {
  78228. console.log(error);
  78229. }
  78230. _this9.map.addImage(index + '', image);
  78231. _this9.map.addLayer({
  78232. id: layerID,
  78233. type: 'symbol',
  78234. source: source,
  78235. layout: {
  78236. 'icon-image': index + '',
  78237. 'icon-size': defaultStyle.scale,
  78238. visibility: layerInfo.visible
  78239. }
  78240. });
  78241. }, _this9); // svg-marker
  78242. if (geomType === 'POINT' && defaultStyle.src && defaultStyle.src.indexOf('svg') > -1) {
  78243. if (!_this9.svgDiv) {
  78244. _this9.svgDiv = document.createElement('div');
  78245. document.body.appendChild(_this9.svgDiv);
  78246. }
  78247. _this9._getCanvasFromSVG(defaultStyle.src, _this9.svgDiv, function (canvas) {
  78248. var imgUrl = canvas.toDataURL('img/png');
  78249. imgUrl && _this9.map.loadImage(imgUrl, function (error, image) {
  78250. if (error) {
  78251. console.log(error);
  78252. }
  78253. _this9.map.addImage(index + '', image);
  78254. _this9.map.addLayer({
  78255. id: layerID,
  78256. type: 'symbol',
  78257. source: source,
  78258. layout: {
  78259. 'icon-image': index + '',
  78260. 'icon-size': defaultStyle.scale,
  78261. visibility: layerInfo.visible
  78262. }
  78263. });
  78264. }, _this9);
  78265. });
  78266. } // point-line-polygon-marker
  78267. if (!defaultStyle.src) {
  78268. var layeStyle = {
  78269. layout: {}
  78270. };
  78271. if (geomType === 'LINESTRING' && defaultStyle.lineCap) {
  78272. geomType = 'LINE';
  78273. layeStyle.layout = {
  78274. 'line-cap': defaultStyle.lineCap
  78275. };
  78276. }
  78277. var visible = layerInfo.visible;
  78278. layeStyle.layout.visibility = visible; // get style
  78279. layeStyle.style = _this9._transformStyleToMapBoxGl(defaultStyle, geomType);
  78280. _this9._addOverlayToMap(geomType, source, layerID, layeStyle); // 若面有边框
  78281. geomType === 'POLYGON' && defaultStyle.strokeColor && _this9._addStrokeLineForPoly(defaultStyle, source, layerID + '-strokeLine', visible);
  78282. }
  78283. }, this);
  78284. }
  78285. /**
  78286. * @private
  78287. * @function mapboxgl.supermap.WebMap.prototype.setFeatureInfo
  78288. * @description 设置 feature 信息。
  78289. * @param {Array.<GeoJSON>} features - feature。
  78290. */
  78291. }, {
  78292. key: "setFeatureInfo",
  78293. value: function setFeatureInfo(feature) {
  78294. var featureInfo;
  78295. var info = feature.dv_v5_markerInfo;
  78296. if (info && info.dataViz_title) {
  78297. //有featureInfo信息就不需要再添加
  78298. featureInfo = info;
  78299. } else {
  78300. // featureInfo = this.getDefaultAttribute();
  78301. return info;
  78302. }
  78303. var properties = feature.properties;
  78304. for (var key in featureInfo) {
  78305. if (properties[key]) {
  78306. featureInfo[key] = properties[key];
  78307. delete properties[key];
  78308. }
  78309. }
  78310. return featureInfo;
  78311. }
  78312. /**
  78313. * @private
  78314. * @function mapboxgl.supermap.WebMap.prototype._createHeatLayer
  78315. * @description 添加热力图。
  78316. * @param {Array.<GeoJSON>} features - feature。
  78317. */
  78318. }, {
  78319. key: "_createHeatLayer",
  78320. value: function _createHeatLayer(layerInfo, features) {
  78321. var style = layerInfo.themeSetting;
  78322. var layerOption = {};
  78323. layerOption.gradient = style.colors.slice();
  78324. layerOption.radius = parseInt(style.radius); //自定义颜色
  78325. var customSettings = style.customSettings;
  78326. for (var i in customSettings) {
  78327. layerOption.gradient[i] = customSettings[i];
  78328. } // 权重字段恢复
  78329. if (style.weight) {
  78330. this._changeWeight(features, style.weight);
  78331. }
  78332. var color = ['interpolate', ['linear'], ['heatmap-density']];
  78333. var length = layerOption.gradient.length;
  78334. var step = (1 / length).toFixed(2);
  78335. layerOption.gradient.forEach(function (item, index) {
  78336. color.push(index * step);
  78337. if (index === 0) {
  78338. item = core_Util_Util.hexToRgba(item, 0);
  78339. }
  78340. color.push(item);
  78341. });
  78342. var paint = {
  78343. 'heatmap-color': color,
  78344. 'heatmap-radius': style.radius + 15,
  78345. 'heatmap-intensity': {
  78346. base: 1,
  78347. stops: [[0, 0.8], [22, 1]]
  78348. }
  78349. };
  78350. if (features[0].weight && features.length >= 4) {
  78351. var weight = [];
  78352. features.forEach(function (item) {
  78353. weight.push(item.weight);
  78354. });
  78355. var max = ArrayStatistic.getMax(weight);
  78356. var min = ArrayStatistic.getMin(weight);
  78357. paint['heatmap-weight'] = ['interpolate', ['linear'], ['get', 'weight'], min, 0, max, 1];
  78358. }
  78359. this.map.addLayer({
  78360. id: layerInfo.layerID,
  78361. type: 'heatmap',
  78362. source: {
  78363. type: 'geojson',
  78364. data: {
  78365. type: 'FeatureCollection',
  78366. features: features
  78367. }
  78368. },
  78369. paint: paint
  78370. });
  78371. }
  78372. /**
  78373. * @private
  78374. * @function mapboxgl.supermap.WebMap.prototype._changeWeight
  78375. * @description 改变当前权重字段
  78376. * @param {Array.<GeoJSON>} features - feature。
  78377. * @param {String} weightFeild - 权重字段
  78378. */
  78379. }, {
  78380. key: "_changeWeight",
  78381. value: function _changeWeight(features, weightFeild) {
  78382. this.fieldMaxValue = {};
  78383. this._getMaxValue(features, weightFeild);
  78384. var maxValue = this.fieldMaxValue[weightFeild];
  78385. features.forEach(function (feature) {
  78386. var attributes = feature.properties;
  78387. var value = attributes[weightFeild];
  78388. feature['weight'] = value / maxValue;
  78389. });
  78390. }
  78391. /**
  78392. * @private
  78393. * @function mapboxgl.supermap.WebMap.prototype._getMaxValue
  78394. * @description 获取当前字段对应的最大值,用于计算权重。
  78395. * @param {Array.<GeoJSON>} features - feature。
  78396. * @param {String} weightFeild - 权重字段
  78397. */
  78398. }, {
  78399. key: "_getMaxValue",
  78400. value: function _getMaxValue(features, weightField) {
  78401. var values = [],
  78402. attributes;
  78403. var field = weightField;
  78404. if (this.fieldMaxValue[field]) {
  78405. return;
  78406. }
  78407. features.forEach(function (feature) {
  78408. //收集当前权重字段对应的所有值
  78409. attributes = feature.properties;
  78410. attributes && parseFloat(attributes[field]) && values.push(parseFloat(attributes[field]));
  78411. });
  78412. this.fieldMaxValue[field] = ArrayStatistic.getArrayStatistic(values, 'Maximum');
  78413. }
  78414. /**
  78415. * @private
  78416. * @function mapboxgl.supermap.WebMap.prototype._createRangeLayer
  78417. * @description 添加分段专题图。
  78418. * @param {Array.<GeoJSON>} features - feature。
  78419. */
  78420. }, {
  78421. key: "_createRangeLayer",
  78422. value: function _createRangeLayer(layerInfo, features) {
  78423. var fieldName = layerInfo.themeSetting.themeField;
  78424. var style = layerInfo.style;
  78425. var featureType = layerInfo.featureType;
  78426. var styleGroups = this._getRangeStyleGroup(layerInfo, features);
  78427. features = this._getFiterFeatures(layerInfo.filterCondition, features);
  78428. var source = {
  78429. type: 'geojson',
  78430. data: {
  78431. type: 'FeatureCollection',
  78432. features: features
  78433. }
  78434. }; // 获取 expression
  78435. var expression = ['match', ['get', 'index']];
  78436. features.forEach(function (row) {
  78437. var tartget = parseFloat(row.properties[fieldName]);
  78438. for (var i = 0; i < styleGroups.length; i++) {
  78439. if (styleGroups[i].start <= tartget && tartget < styleGroups[i].end) {
  78440. expression.push(row.properties['index'], styleGroups[i].color); // return;
  78441. }
  78442. }
  78443. !tartget && expression.push(row.properties['index'], 'rgba(0, 0, 0, 0)');
  78444. }, this);
  78445. expression.push('rgba(0, 0, 0, 0)'); // 获取样式
  78446. var layerStyle = {
  78447. layout: {}
  78448. };
  78449. if (featureType === 'LINE' && style.lineCap) {
  78450. layerStyle.layout = {
  78451. 'line-cap': style.lineCap
  78452. };
  78453. }
  78454. var visible = layerInfo.visible;
  78455. layerStyle.layout.visibility = visible;
  78456. layerStyle.style = this._transformStyleToMapBoxGl(style, featureType, expression); // 添加图层
  78457. var layerID = layerInfo.layerID;
  78458. this._addOverlayToMap(featureType, source, layerID, layerStyle); // 如果面有边框
  78459. featureType === 'POLYGON' && style.strokeColor && this._addStrokeLineForPoly(style, source, layerID + '-strokeline', visible);
  78460. }
  78461. /**
  78462. * @private
  78463. * @function mapboxgl.supermap.WebMap.prototype._getFiterFeatures
  78464. * @description 通过过滤条件查询满足的 feature。
  78465. * @param {String} filterCondition - 过滤条件。
  78466. * @param {array} allFeatures - 图层上的 feature 集合
  78467. */
  78468. }, {
  78469. key: "_getFiterFeatures",
  78470. value: function _getFiterFeatures(filterCondition, allFeatures) {
  78471. if (!filterCondition) {
  78472. return allFeatures;
  78473. }
  78474. var condition = this._replaceFilterCharacter(filterCondition);
  78475. var sql = 'select * from json where (' + condition + ')';
  78476. var filterFeatures = [];
  78477. for (var i = 0; i < allFeatures.length; i++) {
  78478. var feature = allFeatures[i];
  78479. var filterResult = false;
  78480. try {
  78481. filterResult = window.jsonsql.query(sql, {
  78482. properties: feature.properties
  78483. });
  78484. } catch (err) {
  78485. //必须把要过滤得内容封装成一个对象,主要是处理jsonsql(line : 62)中由于with语句遍历对象造成的问题
  78486. continue;
  78487. }
  78488. if (filterResult && filterResult.length > 0) {
  78489. //afterFilterFeatureIdx.push(i);
  78490. filterFeatures.push(feature);
  78491. }
  78492. }
  78493. return filterFeatures;
  78494. }
  78495. /**
  78496. * @private
  78497. * @function mapboxgl.supermap.WebMap.prototype._replaceFilterCharacter
  78498. * @description 获取过滤字符串。
  78499. * @param {String} filterString - 过滤条件。
  78500. */
  78501. }, {
  78502. key: "_replaceFilterCharacter",
  78503. value: function _replaceFilterCharacter(filterString) {
  78504. filterString = filterString.replace(/=/g, '==').replace(/AND|and/g, '&&').replace(/or|OR/g, '||').replace(/<==/g, '<=').replace(/>==/g, '>=');
  78505. return filterString;
  78506. }
  78507. /**
  78508. * @private
  78509. * @function mapboxgl.supermap.WebMap.prototype._getRangeStyleGroup
  78510. * @description 获取分段样式。
  78511. * @param {Array.<GeoJSON>} features - feature。
  78512. */
  78513. }, {
  78514. key: "_getRangeStyleGroup",
  78515. value: function _getRangeStyleGroup(layerInfo, features) {
  78516. // 找出分段值
  78517. var featureType = layerInfo.featureType;
  78518. var style = layerInfo.style;
  78519. var values = [],
  78520. attributes;
  78521. var themeSetting = layerInfo.themeSetting;
  78522. var customSettings = themeSetting.customSettings;
  78523. var fieldName = themeSetting.themeField;
  78524. var segmentCount = themeSetting.segmentCount;
  78525. features.forEach(function (feature) {
  78526. attributes = feature.properties || feature.get('Properties');
  78527. if (attributes) {
  78528. //过滤掉非数值的数据
  78529. attributes[fieldName] && core_Util_Util.isNumber(attributes[fieldName]) && values.push(parseFloat(attributes[fieldName]));
  78530. } else if (feature.get(fieldName) && core_Util_Util.isNumber(feature.get(fieldName))) {
  78531. feature.get(fieldName) && values.push(parseFloat(feature.get(fieldName)));
  78532. }
  78533. }, this);
  78534. var segements = ArrayStatistic.getArraySegments(values, themeSetting.segmentMethod, segmentCount);
  78535. if (segements) {
  78536. var itemNum = segmentCount;
  78537. if (attributes && segements[0] === segements[attributes.length - 1]) {
  78538. itemNum = 1;
  78539. segements.length = 2;
  78540. } //保留两位有效数
  78541. for (var key in segements) {
  78542. var value = segements[key];
  78543. value = key == 0 ? Math.floor(value * 100) / 100 : Math.ceil(value * 100) / 100 + 0.1; // 加0.1 解决最大值没有样式问题
  78544. segements[key] = Number(value.toFixed(2));
  78545. } //获取一定量的颜色
  78546. var curentColors = themeSetting.colors; // curentColors = ColorsPickerUtil.getGradientColors(curentColors, itemNum, 'RANGE');
  78547. for (var index = 0; index < itemNum; index++) {
  78548. if (index in customSettings) {
  78549. if (customSettings[index]['segment']['start']) {
  78550. segements[index] = customSettings[index]['segment']['start'];
  78551. }
  78552. if (customSettings[index]['segment']['end']) {
  78553. segements[index + 1] = customSettings[index]['segment']['end'];
  78554. }
  78555. }
  78556. } //生成styleGroup
  78557. var styleGroups = [];
  78558. for (var i = 0; i < itemNum; i++) {
  78559. var color = curentColors[i];
  78560. if (i in customSettings) {
  78561. if (customSettings[i].color) {
  78562. color = customSettings[i].color;
  78563. }
  78564. }
  78565. if (featureType === 'LINE') {
  78566. style.strokeColor = color;
  78567. } else {
  78568. style.fillColor = color;
  78569. }
  78570. var start = segements[i];
  78571. var end = segements[i + 1];
  78572. var styleObj = JSON.parse(JSON.stringify(style));
  78573. styleGroups.push({
  78574. style: styleObj,
  78575. color: color,
  78576. start: start,
  78577. end: end
  78578. });
  78579. }
  78580. return styleGroups;
  78581. }
  78582. }
  78583. /**
  78584. * @private
  78585. * @function mapboxgl.supermap.WebMap.prototype._formatGeoJSON
  78586. * @description 格式 GeoJSON。
  78587. * @param {GeoJSON} data - GeoJSON 数据。
  78588. */
  78589. }, {
  78590. key: "_formatGeoJSON",
  78591. value: function _formatGeoJSON(data) {
  78592. var features = data.features;
  78593. features.forEach(function (row, index) {
  78594. row.properties['index'] = index; // TODO 待优化 坐标转换
  78595. // if (fileCode !== 'EPSG:4326') {
  78596. // if(row.geometry.coordinates[0] instanceof Array){
  78597. // row.geometry.coordinates.forEach((coords, index) => {
  78598. // let lnglat = this._unproject(coords);
  78599. // row.geometry.coordinates[index] = [lnglat.lng, lnglat.lat];
  78600. // }, this)
  78601. // return;
  78602. // }
  78603. // let lnglat = this._unproject(row.geometry.coordinates);
  78604. // row.geometry.coordinates = [lnglat.lng, lnglat.lat];
  78605. // }
  78606. });
  78607. return features;
  78608. }
  78609. /**
  78610. * @private
  78611. * @function mapboxgl.supermap.WebMap.prototype._excelData2Feature将
  78612. * @description csv 和 xls 文件内容转换成 geojson
  78613. * @param content 文件内容
  78614. * @param layerInfo 图层信息
  78615. * @returns {Array} feature的数组集合
  78616. */
  78617. }, {
  78618. key: "_excelData2Feature",
  78619. value: function _excelData2Feature(dataContent) {
  78620. var fieldCaptions = dataContent.colTitles; // let fileCode = layerInfo.projection;
  78621. //位置属性处理
  78622. var xfieldIndex = -1,
  78623. yfieldIndex = -1;
  78624. for (var i = 0, len = fieldCaptions.length; i < len; i++) {
  78625. if (this._isXField(fieldCaptions[i])) {
  78626. xfieldIndex = i;
  78627. }
  78628. if (this._isYField(fieldCaptions[i])) {
  78629. yfieldIndex = i;
  78630. }
  78631. } // feature 构建后期支持坐标系 4326/3857
  78632. var features = [];
  78633. for (var _i4 = 0, _len = dataContent.rows.length; _i4 < _len; _i4++) {
  78634. var row = dataContent.rows[_i4];
  78635. var x = Number(row[xfieldIndex]),
  78636. y = Number(row[yfieldIndex]); // let coordinates = [x, y];
  78637. // TODO 待优化 坐标转换
  78638. // if (fileCode !== 'EPSG:4326') {
  78639. // if(row.geometry.coordinates[0] instanceof Array){
  78640. // row.geometry.coordinates.forEach((coords, index) => {
  78641. // let lnglat = this._unproject(coords);
  78642. // row.geometry.coordinates[index] = [lnglat.lng, lnglat.lat];
  78643. // }, this)
  78644. // return;
  78645. // }
  78646. // let lnglat = this._unproject(row.geometry.coordinates);
  78647. // row.geometry.coordinates = [lnglat.lng, lnglat.lat];
  78648. // }
  78649. //属性信息
  78650. var attributes = {};
  78651. for (var index in dataContent.colTitles) {
  78652. var key = dataContent.colTitles[index];
  78653. attributes[key] = dataContent.rows[_i4][index];
  78654. }
  78655. attributes['index'] = _i4 + ''; //目前csv 只支持处理点,所以先生成点类型的 geojson
  78656. var feature = {
  78657. type: 'Feature',
  78658. geometry: {
  78659. type: 'Point',
  78660. coordinates: [x, y]
  78661. },
  78662. properties: attributes
  78663. };
  78664. features.push(feature);
  78665. }
  78666. return features;
  78667. }
  78668. /**
  78669. * @private
  78670. * @function mapboxgl.supermap.WebMap.prototype._sendMapToUser
  78671. * @description 返回最终的 map 对象给用户,供他们操作使用。
  78672. * @param count
  78673. * @param layersLen
  78674. */
  78675. }, {
  78676. key: "_sendMapToUser",
  78677. value: function _sendMapToUser(count, layersLen) {
  78678. if (count === layersLen) {
  78679. /**
  78680. * @event mapboxgl.supermap.WebMap#addlayerssucceeded
  78681. * @description 添加图层成功。
  78682. * @property {mapboxgl.Map} map - MapBoxGL Map 对象。
  78683. * @property {Object} mapparams - 地图信息。
  78684. * @property {string} mapParams.title - 地图标题。
  78685. * @property {string} mapParams.description - 地图描述。
  78686. * @property {Array.<Object>} layers - 地图上所有的图层对象
  78687. */
  78688. this.fire('addlayerssucceeded', {
  78689. map: this.map,
  78690. mapparams: this.mapParams,
  78691. layers: this.layers
  78692. });
  78693. }
  78694. }
  78695. /**
  78696. * @function mapboxgl.supermap.WebMap.prototype._unproject
  78697. * @private
  78698. * @description 墨卡托转经纬度。
  78699. * @param {} point - 待转换的点。
  78700. */
  78701. }, {
  78702. key: "_unproject",
  78703. value: function _unproject(point) {
  78704. var d = 180 / Math.PI,
  78705. r = 6378137,
  78706. ts = Math.exp(-point[1] / r),
  78707. phi = Math.PI / 2 - 2 * Math.atan(ts);
  78708. for (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {
  78709. con = 1;
  78710. dphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;
  78711. phi += dphi;
  78712. }
  78713. return new (external_mapboxgl_default()).LngLat(point[0] * d / r, phi * d);
  78714. }
  78715. /**
  78716. * @function mapboxgl.supermap.WebMap.prototype._getParamString
  78717. * @private
  78718. * @param {Object} obj - 待添加的参数。
  78719. * @param {string} existingUrl - 待添加参数的 url。
  78720. * @param {Boolean} [uppercase] - 参数是否转换为大写。
  78721. */
  78722. }, {
  78723. key: "_getParamString",
  78724. value: function _getParamString(obj, existingUrl, uppercase) {
  78725. var params = [];
  78726. for (var i in obj) {
  78727. params.push((uppercase ? i.toUpperCase() : i) + '=' + obj[i]);
  78728. }
  78729. return (!existingUrl || existingUrl.indexOf('?') === -1 ? '?' : '&') + params.join('&');
  78730. }
  78731. /**
  78732. * @private
  78733. * @description 判断是否地理X坐标
  78734. * @param data
  78735. */
  78736. }, {
  78737. key: "_isXField",
  78738. value: function _isXField(data) {
  78739. var lowerdata = data.toLowerCase();
  78740. return lowerdata === 'x' || lowerdata === 'smx' || lowerdata === 'jd' || lowerdata === '经度' || lowerdata === '东经' || lowerdata === 'longitude' || lowerdata === 'lot' || lowerdata === 'lon' || lowerdata === 'lng';
  78741. }
  78742. /**
  78743. * @private
  78744. * @description 判断是否地理Y坐标
  78745. * @param data
  78746. */
  78747. }, {
  78748. key: "_isYField",
  78749. value: function _isYField(data) {
  78750. var lowerdata = data.toLowerCase();
  78751. return lowerdata === 'y' || lowerdata === 'smy' || lowerdata === 'wd' || lowerdata === '纬度' || lowerdata === '北纬' || lowerdata === 'latitude' || lowerdata === 'lat';
  78752. }
  78753. /**
  78754. * @private
  78755. * @function mapboxgl.supermap.WebMap.prototype._transformStyleToMapBoxGl
  78756. * @description 根据图层类型将 layerInfo 中的 style 属性格式转换为 mapboxgl 中的 style 格式。
  78757. * @param {Object} style - layerInfo中的style属性
  78758. * @param {String} type - 图层类型
  78759. * @param {Array} [expression] - 存储颜色值得表达式
  78760. */
  78761. }, {
  78762. key: "_transformStyleToMapBoxGl",
  78763. value: function _transformStyleToMapBoxGl(style, type, expression) {
  78764. var transTable = {};
  78765. if ((style.type === 'POINT' || style.type === 'BASIC_POINT' || type === 'POINT') && type !== 'LINE') {
  78766. transTable = {
  78767. fillColor: 'circle-color',
  78768. strokeWidth: 'circle-stroke-width',
  78769. fillOpacity: 'circle-opacity',
  78770. radius: 'circle-radius',
  78771. strokeColor: 'circle-stroke-color',
  78772. strokeOpacity: 'circle-stroke-opacity'
  78773. };
  78774. } else if (type === 'LINE') {
  78775. transTable = {
  78776. strokeWidth: 'line-width',
  78777. strokeColor: 'line-color',
  78778. strokeOpacity: 'line-opacity'
  78779. };
  78780. } else if (type === 'POLYGON') {
  78781. transTable = {
  78782. fillColor: 'fill-color',
  78783. fillOpacity: 'fill-opacity',
  78784. strokeColor: 'fill-outline-color'
  78785. };
  78786. }
  78787. var newObj = {};
  78788. for (var item in style) {
  78789. if (transTable[item]) {
  78790. newObj[transTable[item]] = style[item];
  78791. }
  78792. }
  78793. if (expression) {
  78794. if (newObj['circle-color']) {
  78795. newObj['circle-color'] = expression;
  78796. } else if (newObj['line-color']) {
  78797. newObj['line-color'] = expression;
  78798. } else {
  78799. newObj['fill-color'] = expression;
  78800. }
  78801. }
  78802. if (style.lineDash && style.lineDash !== 'solid' && type === 'LINE') {
  78803. newObj['line-dasharray'] = this._dashStyle(style);
  78804. }
  78805. return newObj;
  78806. }
  78807. /**
  78808. * @private
  78809. * @function mapboxgl.supermap.WebMap.prototype.._dashStyle
  78810. * @description 符号样式。
  78811. * @param {Object} style - 样式参数。
  78812. * @param {number} widthFactor - 宽度系数。
  78813. */
  78814. }, {
  78815. key: "_dashStyle",
  78816. value: function _dashStyle(style) {
  78817. if (!style) {
  78818. return [];
  78819. } // var w = style.strokeWidth * widthFactor;
  78820. var w = 1;
  78821. var str = style.strokeDashstyle || style.lineDash;
  78822. switch (str) {
  78823. case 'solid':
  78824. return [];
  78825. case 'dot':
  78826. return [1, 4 * w];
  78827. case 'dash':
  78828. return [4 * w, 4 * w];
  78829. case 'dashdot':
  78830. return [4 * w, 4 * w, 1 * w, 4 * w];
  78831. case 'longdash':
  78832. return [8 * w, 4 * w];
  78833. case 'longdashdot':
  78834. return [8 * w, 4 * w, 1, 4 * w];
  78835. default:
  78836. if (!str) {
  78837. return [];
  78838. }
  78839. if (Util.isArray(str)) {
  78840. return str;
  78841. }
  78842. str = StringExt.trim(str).replace(/\s+/g, ',');
  78843. return str.replace(/\[|\]/gi, '').split(',');
  78844. }
  78845. }
  78846. /**
  78847. * @private
  78848. * @description 将SVG转换成Canvas
  78849. * @param svgUrl
  78850. * @param divDom
  78851. * @param callBack
  78852. */
  78853. }, {
  78854. key: "_getCanvasFromSVG",
  78855. value: function _getCanvasFromSVG(svgUrl, divDom, callBack) {
  78856. //一个图层对应一个canvas
  78857. var canvas = document.createElement('canvas');
  78858. canvas.id = 'dataviz-canvas-' + core_Util_Util.newGuid(8);
  78859. canvas.style.display = 'none';
  78860. divDom.appendChild(canvas);
  78861. var canvgs = window.canvg ? window.canvg : (external_function_try_return_canvg_catch_e_return_default());
  78862. canvgs(canvas.id, svgUrl, {
  78863. ignoreMouse: true,
  78864. ignoreAnimation: true,
  78865. renderCallback: function renderCallback() {
  78866. if (canvas.width > 300 || canvas.height > 300) {
  78867. return;
  78868. }
  78869. callBack(canvas);
  78870. },
  78871. forceRedraw: function forceRedraw() {
  78872. return false;
  78873. }
  78874. });
  78875. }
  78876. /**
  78877. * @private
  78878. * @function mapboxgl.supermap.WebMap.prototype._addOverlayToMap
  78879. * @description 添加基础矢量图层到 MAP
  78880. * @param {Object} style - mabgl style
  78881. * @param {String} type - 图层类型
  78882. */
  78883. }, {
  78884. key: "_addOverlayToMap",
  78885. value: function _addOverlayToMap(type, source, layerID, layerStyle) {
  78886. var mbglTypeMap = {
  78887. POINT: 'circle',
  78888. LINE: 'line',
  78889. POLYGON: 'fill'
  78890. };
  78891. type = mbglTypeMap[type];
  78892. if (type === 'circle' || type === 'line' || type === 'fill') {
  78893. this.map.addLayer({
  78894. id: layerID,
  78895. type: type,
  78896. source: source,
  78897. paint: layerStyle.style,
  78898. layout: layerStyle.layout || {}
  78899. });
  78900. }
  78901. }
  78902. }, {
  78903. key: "_addBaselayer",
  78904. value: function _addBaselayer(url, layerID) {
  78905. var minzoom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  78906. var maxzoom = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 22;
  78907. var isIserver = arguments.length > 4 ? arguments[4] : undefined;
  78908. this.map.addLayer({
  78909. id: layerID,
  78910. type: 'raster',
  78911. source: {
  78912. type: 'raster',
  78913. tiles: url,
  78914. tileSize: 256,
  78915. rasterSource: isIserver ? 'iserver' : '',
  78916. prjCoordSys: isIserver ? {
  78917. epsgCode: this.baseProjection.split(':')[1]
  78918. } : ''
  78919. },
  78920. minzoom: minzoom,
  78921. maxzoom: maxzoom
  78922. });
  78923. }
  78924. /**
  78925. * @private
  78926. * @function mapboxgl.supermap.WebMap.prototype._addStrokeLineForPoly
  78927. * @description 添加面的边框。
  78928. * @param {Object} style - mabgl style
  78929. */
  78930. }, {
  78931. key: "_addStrokeLineForPoly",
  78932. value: function _addStrokeLineForPoly(style, source, layerID, visible) {
  78933. var lineStyle = {};
  78934. lineStyle.style = this._transformStyleToMapBoxGl(style, 'LINE');
  78935. lineStyle.layout = {
  78936. visibility: visible
  78937. };
  78938. this._addOverlayToMap('LINE', source, layerID, lineStyle);
  78939. }
  78940. /**
  78941. * @private
  78942. * @function mapboxgl.supermap.WebMap.prototype._parseGeoJsonData2Feature
  78943. * @description 将从restData地址上获取的json转换成feature(从iserver中获取的json转换成feature)
  78944. * @param {object} metaData - json内容
  78945. * @returns {Array} ol.feature的数组集合
  78946. */
  78947. }, {
  78948. key: "_parseGeoJsonData2Feature",
  78949. value: function _parseGeoJsonData2Feature(metaData) {
  78950. var allFeatures = metaData.allDatas.features,
  78951. features = [];
  78952. for (var i = 0, len = allFeatures.length; i < len; i++) {
  78953. // TODO 坐标转换
  78954. var feature = allFeatures[i];
  78955. var coordinate = feature.geometry.coordinates;
  78956. if (allFeatures[i].geometry.type === 'Point') {
  78957. // 标注图层 还没有属性值时候不加
  78958. if (allFeatures[i].properties) {
  78959. allFeatures[i].properties.lon = coordinate[0];
  78960. allFeatures[i].properties.lat = coordinate[1];
  78961. }
  78962. }
  78963. features.properties['index'] = i + '';
  78964. features.push(feature);
  78965. }
  78966. return features;
  78967. }
  78968. /**
  78969. * @private
  78970. * @function mapboxgl.supermap.WebMap.prototype._getFeatureBySQL
  78971. * @description 通过 sql 方式查询数据。
  78972. */
  78973. }, {
  78974. key: "_getFeatureBySQL",
  78975. value: function _getFeatureBySQL(url, datasetNames, _processCompleted, processFaild) {
  78976. var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
  78977. getFeatureParam = new FilterParameter({
  78978. name: datasetNames.join().replace(':', '@'),
  78979. attributeFilter: 'SMID > 0'
  78980. });
  78981. getFeatureBySQLParams = new GetFeaturesBySQLParameters({
  78982. queryParameter: getFeatureParam,
  78983. datasetNames: datasetNames,
  78984. fromIndex: 0,
  78985. toIndex: 100000,
  78986. returnContent: true
  78987. });
  78988. var options = {
  78989. eventListeners: {
  78990. processCompleted: function processCompleted(getFeaturesEventArgs) {
  78991. _processCompleted && _processCompleted(getFeaturesEventArgs);
  78992. },
  78993. processFailed: function processFailed(e) {
  78994. processFaild && processFaild(e);
  78995. }
  78996. }
  78997. };
  78998. getFeatureBySQLService = new GetFeaturesBySQLService(url, options);
  78999. getFeatureBySQLService.processAsync(getFeatureBySQLParams);
  79000. }
  79001. /**
  79002. * @private
  79003. * @function mapboxgl.supermap.WebMap.prototype._queryFeatureBySQL
  79004. * @description 通过 sql 方式查询数据。
  79005. */
  79006. }, {
  79007. key: "_queryFeatureBySQL",
  79008. value: function _queryFeatureBySQL(url, layerName, attributeFilter, fields, epsgCode, processCompleted, processFaild, startRecord, recordLength, onlyAttribute) {
  79009. var queryParam, queryBySQLParams, queryBySQLService;
  79010. queryParam = new FilterParameter({
  79011. name: layerName,
  79012. attributeFilter: attributeFilter
  79013. });
  79014. if (fields) {
  79015. queryParam.fields = fields;
  79016. }
  79017. var params = {
  79018. queryParams: [queryParam]
  79019. };
  79020. if (onlyAttribute) {
  79021. params.queryOption = QueryOption.ATTRIBUTE;
  79022. }
  79023. startRecord && (params.startRecord = startRecord);
  79024. recordLength && (params.expectCount = recordLength);
  79025. if (epsgCode) {
  79026. params.prjCoordSys = {
  79027. epsgCode: epsgCode
  79028. };
  79029. }
  79030. queryBySQLParams = new QueryBySQLParameters(params);
  79031. queryBySQLService = new (external_mapboxgl_default()).supermap.QueryService(url);
  79032. queryBySQLService.queryBySQL(queryBySQLParams, function (data) {
  79033. data.type === 'processCompleted' ? processCompleted(data) : processFaild(data);
  79034. });
  79035. }
  79036. /**
  79037. * @private
  79038. * @function mapboxgl.supermap.WebMap.prototype._handleMultyPolygon
  79039. * @description 处理复杂面情况
  79040. */
  79041. }, {
  79042. key: "_handleMultyPolygon",
  79043. value: function _handleMultyPolygon(features) {
  79044. features.forEach(function (feature) {
  79045. if (feature.geometry.type !== 'Polygon') {
  79046. return;
  79047. }
  79048. var coords = feature.geometry.coordinates;
  79049. if (coords.length > 1) {
  79050. var coordinates = [];
  79051. coords.forEach(function (coord) {
  79052. coordinates.push([coord]);
  79053. });
  79054. feature.geometry.coordinates = coordinates;
  79055. feature.geometry.type = 'MultiPolygon';
  79056. }
  79057. });
  79058. return features;
  79059. }
  79060. }, {
  79061. key: "_transformScaleToZoom",
  79062. value: function _transformScaleToZoom(scale, crs) {
  79063. var scale_0 = 295829515.2024169;
  79064. if ((crs || this.map.getCRS()).epsgCode !== 'EPSG:3857') {
  79065. scale_0 = 295295895;
  79066. }
  79067. var scaleDenominator = scale.split(':')[1];
  79068. return Math.min(24, +Math.log2(scale_0 / +scaleDenominator).toFixed(2));
  79069. }
  79070. }, {
  79071. key: "_getResolution",
  79072. value: function _getResolution(bounds) {
  79073. var tileSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 512.0;
  79074. if (bounds.leftBottom && bounds.rightTop) {
  79075. return Math.max(bounds.rightTop.x - bounds.leftBottom.x, bounds.rightTop.y - bounds.leftBottom.y) / tileSize;
  79076. }
  79077. return Math.max(bounds[2] - bounds[0], bounds[3] - bounds[1]) / tileSize;
  79078. }
  79079. }]);
  79080. return WebMap;
  79081. }((external_mapboxgl_default()).Evented);
  79082. (external_mapboxgl_default()).supermap.WebMap = WebMap;
  79083. ;// CONCATENATED MODULE: ./src/mapboxgl/mapping/index.js
  79084. ;// CONCATENATED MODULE: ./src/mapboxgl/index.js
  79085. /* Copyright© 2000 - 2021 SuperMap Software Co.Ltd. All rights reserved.
  79086. * This program are made available under the terms of the Apache License, Version 2.0
  79087. * which accompanies this distribution and is available at http://www.apache.org/licenses/LICENSE-2.0.html.*/
  79088. }();
  79089. !function() {
  79090. "use strict";
  79091. }();
  79092. /******/ })()
  79093. ;